[SCM] libav/experimental: Export H264 profile and level in AVCodecContext.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:58:54 UTC 2013


The following commit has been merged in the experimental branch:
commit dd0cd3d2730b93958a34dea7c7890e71d2d72bf6
Author: Rafaël Carré <rafael.carre at gmail.com>
Date:   Thu Jan 28 20:57:29 2010 +0000

    Export H264 profile and level in AVCodecContext.
    
    Patch by Rafaël Carré, rafael D carre A gmail
    
    Originally committed as revision 21517 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index aa59097..e66691f 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -30,7 +30,7 @@
 #include "libavutil/avutil.h"
 
 #define LIBAVCODEC_VERSION_MAJOR 52
-#define LIBAVCODEC_VERSION_MINOR 48
+#define LIBAVCODEC_VERSION_MINOR 49
 #define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@@ -2123,11 +2123,21 @@ typedef struct AVCodecContext {
      */
      int profile;
 #define FF_PROFILE_UNKNOWN -99
+
 #define FF_PROFILE_AAC_MAIN 0
 #define FF_PROFILE_AAC_LOW  1
 #define FF_PROFILE_AAC_SSR  2
 #define FF_PROFILE_AAC_LTP  3
 
+#define FF_PROFILE_H264_BASELINE    66
+#define FF_PROFILE_H264_MAIN        77
+#define FF_PROFILE_H264_EXTENDED    88
+#define FF_PROFILE_H264_HIGH        100
+#define FF_PROFILE_H264_HIGH_10     110
+#define FF_PROFILE_H264_HIGH_422    122
+#define FF_PROFILE_H264_HIGH_444    244
+#define FF_PROFILE_H264_CAVLC_444   44
+
     /**
      * level
      * - encoding: Set by user.
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index dcd2398..d9b1d5f 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2527,6 +2527,9 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
             if((err = decode_slice_header(hx, h)))
                break;
 
+            avctx->profile = hx->sps.profile_idc;
+            avctx->level   = hx->sps.level_idc;
+
             if (s->avctx->hwaccel && h->current_slice == 1) {
                 if (s->avctx->hwaccel->start_frame(s->avctx, NULL, 0) < 0)
                     return -1;
@@ -2560,6 +2563,9 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
             if ((err = decode_slice_header(hx, h)) < 0)
                 break;
 
+            avctx->profile = hx->sps.profile_idc;
+            avctx->level   = hx->sps.level_idc;
+
             hx->s.data_partitioning = 1;
 
             break;
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index d9af8c9..521597d 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -185,6 +185,9 @@ static inline int parse_nal_units(AVCodecParserContext *s,
             h->sps = *h->sps_buffers[h->pps.sps_id];
             h->frame_num = get_bits(&h->s.gb, h->sps.log2_max_frame_num);
 
+            avctx->profile = h->sps.profile_idc;
+            avctx->level   = h->sps.level_idc;
+
             if(h->sps.frame_mbs_only_flag){
                 h->s.picture_structure= PICT_FRAME;
             }else{

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list