Revision e2f9490e

View differences:

libavcodec/avcodec.h
16 16

  
17 17
#define LIBAVCODEC_VERSION_INT 0x000406
18 18
#define LIBAVCODEC_VERSION     "0.4.6"
19
#define LIBAVCODEC_BUILD       4656
20
#define LIBAVCODEC_BUILD_STR   "4656"
19
#define LIBAVCODEC_BUILD       4657
20
#define LIBAVCODEC_BUILD_STR   "4657"
21 21

  
22 22
enum CodecID {
23 23
    CODEC_ID_NONE, 
......
948 948
     * decoding: set by user, if not set then the native format will always be choosen
949 949
     */
950 950
    enum PixelFormat (*get_format)(struct AVCodecContext *s, enum PixelFormat * fmt);
951

  
952
    /**
953
     * DTG active format information (additionnal aspect ratio
954
     * information only used in DVB MPEG2 transport streams). 0 if
955
     * not set.
956
     * 
957
     * encoding: unused.
958
     * decoding: set by decoder 
959
     */
960
    int dtg_active_format;
961
#define FF_DTG_AFD_SAME         8
962
#define FF_DTG_AFD_4_3          9
963
#define FF_DTG_AFD_16_9         10
964
#define FF_DTG_AFD_14_9         11
965
#define FF_DTG_AFD_4_3_SP_14_9  13
966
#define FF_DTG_AFD_16_9_SP_14_9 14
967
#define FF_DTG_AFD_SP_4_3       15
968

  
951 969
} AVCodecContext;
952 970

  
953 971
//void avcodec_getopt(AVCodecContext* avctx, const char* str, avc_config_t** config);
libavcodec/mpeg12.c
2009 2009
    return 0;
2010 2010
}
2011 2011

  
2012
static void mpeg_decode_user_data(AVCodecContext *avctx, 
2013
                                  const uint8_t *buf, int buf_size)
2014
{
2015
    const uint8_t *p;
2016
    int len, flags;
2017
    p = buf;
2018
    len = buf_size;
2019

  
2020
    /* we parse the DTG active format information */
2021
    if (len >= 5 &&
2022
        p[0] == 'D' && p[1] == 'T' && p[2] == 'G' && p[3] == '1') {
2023
        flags = p[4];
2024
        p += 5;
2025
        len -= 5;
2026
        if (flags & 0x80) {
2027
            /* skip event id */
2028
            if (len < 2)
2029
                return;
2030
            p += 2;
2031
            len -= 2;
2032
        }
2033
        if (flags & 0x40) {
2034
            if (len < 1)
2035
                return;
2036
            avctx->dtg_active_format = p[0] & 0x0f;
2037
        }
2038
    }
2039
}
2040

  
2012 2041
/* handle buffering and image synchronisation */
2013 2042
static int mpeg_decode_frame(AVCodecContext *avctx, 
2014 2043
                             void *data, int *data_size,
......
2099 2128
                    mpeg_decode_extension(avctx,
2100 2129
                                          s->buffer, input_size);
2101 2130
                    break;
2131
                case USER_START_CODE:
2132
                    mpeg_decode_user_data(avctx, 
2133
                                          s->buffer, input_size);
2134
                    break;
2102 2135
                default:
2103 2136
                    if (start_code >= SLICE_MIN_START_CODE &&
2104 2137
                        start_code <= SLICE_MAX_START_CODE) {

Also available in: Unified diff