diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-22 20:49:01 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-22 20:49:01 +0200 |
commit | 975257ffe6501c2017d2d6e7d912abfa168881b3 (patch) | |
tree | dc15bd4553d75a236501a302279915192174a9dc /libavcodec | |
parent | caba19a5becce2e867fc0ff7c3466c57736f49ad (diff) | |
download | ffmpeg-975257ffe6501c2017d2d6e7d912abfa168881b3.tar.gz |
avcodec/libx264: Export choosen pict_type
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/libx264.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 3a55b5dafb..44c6a70827 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -253,6 +253,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, x264_nal_t *nal; int nnal, i, ret; x264_picture_t pic_out = {0}; + int pict_type; x264_picture_init( &x4->pic ); x4->pic.img.i_csp = x4->params.i_csp; @@ -287,27 +288,31 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, pkt->pts = pic_out.i_pts; pkt->dts = pic_out.i_dts; -#if FF_API_CODED_FRAME -FF_DISABLE_DEPRECATION_WARNINGS + switch (pic_out.i_type) { case X264_TYPE_IDR: case X264_TYPE_I: - ctx->coded_frame->pict_type = AV_PICTURE_TYPE_I; + pict_type = AV_PICTURE_TYPE_I; break; case X264_TYPE_P: - ctx->coded_frame->pict_type = AV_PICTURE_TYPE_P; + pict_type = AV_PICTURE_TYPE_P; break; case X264_TYPE_B: case X264_TYPE_BREF: - ctx->coded_frame->pict_type = AV_PICTURE_TYPE_B; + pict_type = AV_PICTURE_TYPE_B; break; + default: + pict_type = AV_PICTURE_TYPE_NONE; } +#if FF_API_CODED_FRAME +FF_DISABLE_DEPRECATION_WARNINGS + ctx->coded_frame->pict_type = pict_type; FF_ENABLE_DEPRECATION_WARNINGS #endif pkt->flags |= AV_PKT_FLAG_KEY*pic_out.b_keyframe; if (ret) { - ff_side_data_set_encoder_stats(pkt, (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA, NULL, 0, 0); + ff_side_data_set_encoder_stats(pkt, (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA, NULL, 0, pict_type); #if FF_API_CODED_FRAME FF_DISABLE_DEPRECATION_WARNINGS |