Commit 22333a6b authored by Stefano Sabatini's avatar Stefano Sabatini

lavc: add width and height fields to AVFrame

width and height are per-frame properties, setting these values in
AVFrame simplify the operation of extraction of that information,
since avoids the need to check the codec/stream context.
parent 314374e5
...@@ -13,6 +13,9 @@ libavutil: 2011-04-18 ...@@ -13,6 +13,9 @@ libavutil: 2011-04-18
API changes, most recent first: API changes, most recent first:
2011-05-07 - xxxxxxx - lavc 53.4.0 - AVFrame
Add width and height fields to AVFrame.
2011-05-01 - xxxxxxx - lavfi 2.4.0 - avfilter.h 2011-05-01 - xxxxxxx - lavfi 2.4.0 - avfilter.h
Rename AVFilterBufferRefVideoProps.pixel_aspect to Rename AVFilterBufferRefVideoProps.pixel_aspect to
sample_aspect_ratio. sample_aspect_ratio.
......
...@@ -1018,6 +1018,13 @@ typedef struct AVPanScan{ ...@@ -1018,6 +1018,13 @@ typedef struct AVPanScan{
* - decoding: Read by user.\ * - decoding: Read by user.\
*/\ */\
AVRational sample_aspect_ratio;\ AVRational sample_aspect_ratio;\
\
/**\
* width and height of the video frame\
* - encoding: unused\
* - decoding: Read by user.\
*/\
int width, height;\
#define FF_QSCALE_TYPE_MPEG1 0 #define FF_QSCALE_TYPE_MPEG1 0
......
...@@ -739,6 +739,10 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi ...@@ -739,6 +739,10 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
picture->pkt_pos= avpkt->pos; picture->pkt_pos= avpkt->pos;
if (!picture->sample_aspect_ratio.num) if (!picture->sample_aspect_ratio.num)
picture->sample_aspect_ratio = avctx->sample_aspect_ratio; picture->sample_aspect_ratio = avctx->sample_aspect_ratio;
if (!picture->width)
picture->width = avctx->width;
if (!picture->height)
picture->height = avctx->height;
} }
emms_c(); //needed to avoid an emms_c() call before every return; emms_c(); //needed to avoid an emms_c() call before every return;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#define AVCODEC_VERSION_H #define AVCODEC_VERSION_H
#define LIBAVCODEC_VERSION_MAJOR 53 #define LIBAVCODEC_VERSION_MAJOR 53
#define LIBAVCODEC_VERSION_MINOR 3 #define LIBAVCODEC_VERSION_MINOR 4
#define LIBAVCODEC_VERSION_MICRO 0 #define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
......
...@@ -102,6 +102,8 @@ int av_vsrc_buffer_add_frame2(AVFilterContext *buffer_filter, AVFrame *frame, ...@@ -102,6 +102,8 @@ int av_vsrc_buffer_add_frame2(AVFilterContext *buffer_filter, AVFrame *frame,
memcpy(c->frame.data , frame->data , sizeof(frame->data)); memcpy(c->frame.data , frame->data , sizeof(frame->data));
memcpy(c->frame.linesize, frame->linesize, sizeof(frame->linesize)); memcpy(c->frame.linesize, frame->linesize, sizeof(frame->linesize));
c->frame.width = frame->width;
c->frame.height = frame->height;
c->frame.interlaced_frame= frame->interlaced_frame; c->frame.interlaced_frame= frame->interlaced_frame;
c->frame.top_field_first = frame->top_field_first; c->frame.top_field_first = frame->top_field_first;
c->frame.key_frame = frame->key_frame; c->frame.key_frame = frame->key_frame;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment