---
 Changelog            |    1 +
 libavutil/Makefile   |    1 +
 libavutil/frame.h    |    4 ++
 libavutil/stereo3d.h |  158 ++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 164 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..0fd0d8d 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.
+     */
+    AV_FRAME_DATA_STEREO3D,
 };
 
 typedef struct AVFrameSideData {
diff --git a/libavutil/stereo3d.h b/libavutil/stereo3d.h
new file mode 100644
index 0000000..077b0bc
--- /dev/null
+++ b/libavutil/stereo3d.h
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2013 Vittorio Giovara <[email protected]>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+  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,
+
+    /**
+     * Views are colored funny.
+     */
+    AV_STEREO3D_ANAGLYPH,
+
+    /**
+     * Views are in two different streams: this could be per container
+     * (like Matroska) or per frame (like MVC Stereo High 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 are in
+     * "Left is Left" mode, with no other fancy stuff.
+     */
+    AV_STEREO3D_NORMAL            = 0x00000000,
+
+    /**
+     * Views are at half resolution.
+     */
+    AV_STEREO3D_SIZE_HALF         = 0x00000001,
+
+    /**
+     * Inverted views, L and R are in opposite position.
+     */
+    AV_STEREO3D_ORDER_INVERT      = 0x00000002,
+
+    /**
+     * When upscaling apply a checkerboard pattern.
+     *
+     *     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.
+     */
+    enum AVStereo3DType type;
+
+    /**
+     * additional data
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by libavcodec.
+     */
+    enum AVStereo3DInfo info;
+} AVStereo3D;
-- 
1.7.9.5

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to