On Mon, 30 Sep 2013 15:14:39 +0200, Vittorio Giovara 
<vittorio.giov...@gmail.com> wrote:
> ---
>  Changelog            |    1 +
>  libavutil/Makefile   |    1 +
>  libavutil/frame.h    |    4 ++
>  libavutil/stereo3d.h |  160 
> ++++++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 166 insertions(+)
>  create mode 100644 libavutil/stereo3d.h
> 
> diff --git a/Changelog b/Changelog
> index b0ff897..9dee989 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -37,6 +37,7 @@ version 10:
>  - Error Resilient AAC syntax (ER AAC LC) decoding
>  - Low Delay AAC (ER AAC LD) decoding
>  - mux chapters in ASF files
> +- codec level stereoscopic metadata handling
>  
>  
>  version 9:
> diff --git a/libavutil/Makefile b/libavutil/Makefile
> index 9381c77..44f7681 100644
> --- a/libavutil/Makefile
> +++ b/libavutil/Makefile
> @@ -41,6 +41,7 @@ HEADERS = adler32.h                                         
>             \
>            rational.h                                                    \
>            samplefmt.h                                                   \
>            sha.h                                                         \
> +          stereo3d.h                                                 \
>            time.h                                                        \
>            version.h                                                     \
>            xtea.h                                                        \
> diff --git a/libavutil/frame.h b/libavutil/frame.h
> index b0676e7..5217b60 100644
> --- a/libavutil/frame.h
> +++ b/libavutil/frame.h
> @@ -35,6 +35,10 @@ enum AVFrameSideDataType {
>       * The data is the AVPanScan struct defined in libavcodec.
>       */
>      AV_FRAME_DATA_PANSCAN,
> +    /**
> +     * The data is the AVStereo3D struct defined in libavcodec.
                                            ^^^^^^^^^^^^^^^^^^^^^
not true anymore

> +
> +/* How views are packed within the frame or container*/
> +enum AVStereo3DType {
> +    /**
> +     * Video is not stereoscopic
> +     */
> +    AV_STEREO3D_NONE,
> +
> +    /**
> +     * Video is not stereoscopic but metadata has to be there
> +     */
> +    AV_STEREO3D_NOT_REALLY,

Can't say I like the name. Does this thing even have to exist? Can't we use
AV_STEREO3D_NONE for this?

> +
> +    /**
> +     * Views are colored funny
> +     */
> +    AV_STEREO3D_ANAGLYPH,
> +
> +    /**
> +     * Views are in two different streams
> +     *  could be per container (like Matroska)
> +     *  or per frame (like MVC Stereo profile)
> +     */
> +    AV_STEREO3D_MULTISTREAM,
> +
> +    /**
> +     * Views are alternated temporally
> +     *
> +     *     frame0   frame1   frame2   ...
> +     *    LLLLLLLL RRRRRRRR LLLLLLLL
> +     *    LLLLLLLL RRRRRRRR LLLLLLLL
> +     *    LLLLLLLL RRRRRRRR LLLLLLLL
> +     *    ...      ...      ...
> +     */
> +    AV_STEREO3D_FRAMESEQUENCE,
> +
> +    /**
> +     * Views are packed in a checkerboard-like structure per pixel
> +     *
> +     *    LRLRLRLR
> +     *    RLRLRLRL
> +     *    LRLRLRLR
> +     *    ...
> +     */
> +    AV_STEREO3D_CHECKERS,
> +
> +    /**
> +     * Views are packed per line, as if interlaced
> +     *
> +     *    LLLLLLLL
> +     *    RRRRRRRR
> +     *    LLLLLLLL
> +     *    ...
> +     */
> +    AV_STEREO3D_LINES,
> +
> +    /**
> +     * Views are packed per column
> +     *
> +     *    LRLRLRLR
> +     *    LRLRLRLR
> +     *    LRLRLRLR
> +     *    ...
> +     */
> +    AV_STEREO3D_COLUMNS,
> +
> +    /**
> +     * Views are next to each other
> +     *
> +     *    LLLLRRRR
> +     *    LLLLRRRR
> +     *    LLLLRRRR
> +     *    ...
> +     */
> +    AV_STEREO3D_SIDEBYSIDE,
> +
> +    /**
> +     * Views are on top of each other
> +     *
> +     *    LLLLLLLL
> +     *    LLLLLLLL
> +     *    RRRRRRRR
> +     *    RRRRRRRR
> +     */
> +    AV_STEREO3D_TOPBOTTOM,
> +};
> +
> +
> +enum AVStereo3DInfo {
> +    /**
> +     * Views are assumed to be at full resolution and is
> +     * "Left is Left" mode, with no other fancy stuff
> +     */
> +    AV_STEREO3D_NORMAL            = 0x00000000,
> +
> +    /**
> +     * View are at half resolution
> +     */
> +    AV_STEREO3D_SIZE_HALF         = 0x00000001,
> +
> +    /**
> +     * Inverted views, L becomes R and R becomes L
> +     */
> +    AV_STEREO3D_ORDER_INVERT      = 0x00000002,
> +
> +    /**
> +     * When upscaling apply a checkerboard pattern, like
> +     *
> +     *     LLLLRRRR          L L L L    R R R R
> +     *     LLLLRRRR    =>     L L L L  R R R R
> +     *     LLLLRRRR          L L L L    R R R R
> +     *     LLLLRRRR           L L L L  R R R R
> +     *
> +     * AV_STEREO3D_SIZE_HALF is implied
> +     */
> +    AV_STEREO3D_QUINCUNX          = 0x00000004,
> +};
> +
> +/**
> + * Stereo 3D type.
> + * This specifies how a stereo pair is packed in a video.
> + * Normally you get this information either in the transport header
> + * or at every keyframe
> + */
> +typedef struct AVStereo3D {
> +    /**
> +     * type
> +     * - encoding: Set by libavcodec.
> +     * - decoding: Set by libavcodec.

It's really not. Just drop those two entries.
Same below.

> +     */
> +    enum AVStereo3DType type;
> +
> +    /**
> +     * additional data
> +     * - encoding: Set by libavcodec.
> +     * - decoding: Set by libavcodec.
> +     */
> +    enum AVStereo3DInfo info;
> +} AVStereo3D;

I think I said this before, if you want to extend this struct in the future
without breaking ABI, then you need a constructor function, like
av_stereo3d_alloc().

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to