[SCM] libav/experimental: added DTG active format information

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:35:27 UTC 2013


The following commit has been merged in the experimental branch:
commit e2f9490eab2fba465a0b611eb4524597b7286673
Author: Fabrice Bellard <fabrice at bellard.org>
Date:   Tue Feb 25 09:56:56 2003 +0000

    added DTG active format information
    
    Originally committed as revision 1605 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index b734381..297f502 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -16,8 +16,8 @@ extern "C" {
 
 #define LIBAVCODEC_VERSION_INT 0x000406
 #define LIBAVCODEC_VERSION     "0.4.6"
-#define LIBAVCODEC_BUILD       4656
-#define LIBAVCODEC_BUILD_STR   "4656"
+#define LIBAVCODEC_BUILD       4657
+#define LIBAVCODEC_BUILD_STR   "4657"
 
 enum CodecID {
     CODEC_ID_NONE, 
@@ -948,6 +948,24 @@ typedef struct AVCodecContext {
      * decoding: set by user, if not set then the native format will always be choosen
      */
     enum PixelFormat (*get_format)(struct AVCodecContext *s, enum PixelFormat * fmt);
+
+    /**
+     * DTG active format information (additionnal aspect ratio
+     * information only used in DVB MPEG2 transport streams). 0 if
+     * not set.
+     * 
+     * encoding: unused.
+     * decoding: set by decoder 
+     */
+    int dtg_active_format;
+#define FF_DTG_AFD_SAME         8
+#define FF_DTG_AFD_4_3          9
+#define FF_DTG_AFD_16_9         10
+#define FF_DTG_AFD_14_9         11
+#define FF_DTG_AFD_4_3_SP_14_9  13
+#define FF_DTG_AFD_16_9_SP_14_9 14
+#define FF_DTG_AFD_SP_4_3       15
+
 } AVCodecContext;
 
 //void avcodec_getopt(AVCodecContext* avctx, const char* str, avc_config_t** config);
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index c7622e8..35fb5c8 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -2009,6 +2009,35 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
     return 0;
 }
 
+static void mpeg_decode_user_data(AVCodecContext *avctx, 
+                                  const uint8_t *buf, int buf_size)
+{
+    const uint8_t *p;
+    int len, flags;
+    p = buf;
+    len = buf_size;
+
+    /* we parse the DTG active format information */
+    if (len >= 5 &&
+        p[0] == 'D' && p[1] == 'T' && p[2] == 'G' && p[3] == '1') {
+        flags = p[4];
+        p += 5;
+        len -= 5;
+        if (flags & 0x80) {
+            /* skip event id */
+            if (len < 2)
+                return;
+            p += 2;
+            len -= 2;
+        }
+        if (flags & 0x40) {
+            if (len < 1)
+                return;
+            avctx->dtg_active_format = p[0] & 0x0f;
+        }
+    }
+}
+
 /* handle buffering and image synchronisation */
 static int mpeg_decode_frame(AVCodecContext *avctx, 
                              void *data, int *data_size,
@@ -2099,6 +2128,10 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
                     mpeg_decode_extension(avctx,
                                           s->buffer, input_size);
                     break;
+                case USER_START_CODE:
+                    mpeg_decode_user_data(avctx, 
+                                          s->buffer, input_size);
+                    break;
                 default:
                     if (start_code >= SLICE_MIN_START_CODE &&
                         start_code <= SLICE_MAX_START_CODE) {

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list