diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-01 14:02:08 +0200 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-07 11:45:30 +0200 |
commit | 22333a6b19f59ebc83933b910069d00c445d01ed (patch) | |
tree | 143d3dd337af034562802e529489d21964a27cd6 /libavcodec | |
parent | 314374e57978bd215ae42d5444f0e76f2bebdc27 (diff) | |
download | ffmpeg-22333a6b19f59ebc83933b910069d00c445d01ed.tar.gz |
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.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/avcodec.h | 7 | ||||
-rw-r--r-- | libavcodec/utils.c | 4 | ||||
-rw-r--r-- | libavcodec/version.h | 2 |
3 files changed, 12 insertions, 1 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 11af5eaea4..e26fcc212d 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1018,6 +1018,13 @@ typedef struct AVPanScan{ * - decoding: Read by user.\ */\ 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 diff --git a/libavcodec/utils.c b/libavcodec/utils.c index fd1c09063f..dc26092dd1 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -739,6 +739,10 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi picture->pkt_pos= avpkt->pos; if (!picture->sample_aspect_ratio.num) 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; diff --git a/libavcodec/version.h b/libavcodec/version.h index 4b8e70f314..362c4f1f2d 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -21,7 +21,7 @@ #define AVCODEC_VERSION_H #define LIBAVCODEC_VERSION_MAJOR 53 -#define LIBAVCODEC_VERSION_MINOR 3 +#define LIBAVCODEC_VERSION_MINOR 4 #define LIBAVCODEC_VERSION_MICRO 0 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |