History

lavc: add format field to AVFrame

The format is a per-frame property, having it in AVFrame simplify the operation of extraction of that information, since avoids the need to access the codec/stream context.

Stefano Sabatini committed 15 years ago

Commit 18ded931 parent 22333a65 files · +17 −1Browse files

Unified · Split

5 files
  1. doc/APIchanges +3 −0
  2. libavcodec/avcodec.h +9 −0
  3. libavcodec/utils.c +3 −0
  4. libavcodec/version.h +1 −1
  5. libavfilter/vsrc_buffer.c +1 −0
doc/APIchanges+3−0
@@ -13,6 +13,9 @@ libavutil: 2011-04-18 · 12 unmodified lines
13 13
14API changes, most recent first:14API changes, most recent first:
15 15
162011-05-07 - xxxxxxx - lavc 53.5.0 - AVFrame
17 Add format field to AVFrame.
18
162011-05-07 - xxxxxxx - lavc 53.4.0 - AVFrame192011-05-07 - xxxxxxx - lavc 53.4.0 - AVFrame
17 Add width and height fields to AVFrame.20 Add width and height fields to AVFrame.
18 21
libavcodec/avcodec.h+9−0
@@ -1025,6 +1025,15 @@ typedef struct AVPanScan{ · 1024 unmodified lines
1025 * - decoding: Read by user.\1025 * - decoding: Read by user.\
1026 */\1026 */\
1027 int width, height;\1027 int width, height;\
1028\
1029 /**\
1030 * format of the frame, -1 if unknown or unset\
1031 * It should be cast to the corresponding enum (enum PixelFormat\
1032 * for video, enum AVSampleFormat for audio)\
1033 * - encoding: unused\
1034 * - decoding: Read by user.\
1035 */\
1036 int format;\
1028 1037
1029 1038
1030#define FF_QSCALE_TYPE_MPEG1 01039#define FF_QSCALE_TYPE_MPEG1 0
libavcodec/utils.c+3−0
@@ -456,6 +456,7 @@ void avcodec_get_frame_defaults(AVFrame *pic){ · 455 unmodified lines
456 pic->pkt_pos = -1;456 pic->pkt_pos = -1;
457 pic->key_frame= 1;457 pic->key_frame= 1;
458 pic->sample_aspect_ratio = (AVRational){0, 1};458 pic->sample_aspect_ratio = (AVRational){0, 1};
459 pic->format = -1; /* unknown */
459}460}
460 461
461AVFrame *avcodec_alloc_frame(void){462AVFrame *avcodec_alloc_frame(void){
@@ -743,6 +744,8 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi · 281 unmodified lines
743 picture->width = avctx->width;744 picture->width = avctx->width;
744 if (!picture->height)745 if (!picture->height)
745 picture->height = avctx->height;746 picture->height = avctx->height;
747 if (picture->format == PIX_FMT_NONE)
748 picture->format = avctx->pix_fmt;
746 }749 }
747 750
748 emms_c(); //needed to avoid an emms_c() call before every return;751 emms_c(); //needed to avoid an emms_c() call before every return;
libavcodec/version.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
21#define AVCODEC_VERSION_H21#define AVCODEC_VERSION_H
22 22
23#define LIBAVCODEC_VERSION_MAJOR 5323#define LIBAVCODEC_VERSION_MAJOR 53
24#define LIBAVCODEC_VERSION_MINOR 424#define LIBAVCODEC_VERSION_MINOR 5
25#define LIBAVCODEC_VERSION_MICRO 025#define LIBAVCODEC_VERSION_MICRO 0
26 26
27#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \27#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
libavfilter/vsrc_buffer.c+1−0
@@ -104,6 +104,7 @@ int av_vsrc_buffer_add_frame2(AVFilterContext *buffer_filter, AVFrame *frame, · 103 unmodified lines
104 memcpy(c->frame.linesize, frame->linesize, sizeof(frame->linesize));104 memcpy(c->frame.linesize, frame->linesize, sizeof(frame->linesize));
105 c->frame.width = frame->width;105 c->frame.width = frame->width;
106 c->frame.height = frame->height;106 c->frame.height = frame->height;
107 c->frame.format = frame->format;
107 c->frame.interlaced_frame= frame->interlaced_frame;108 c->frame.interlaced_frame= frame->interlaced_frame;
108 c->frame.top_field_first = frame->top_field_first;109 c->frame.top_field_first = frame->top_field_first;
109 c->frame.key_frame = frame->key_frame;110 c->frame.key_frame = frame->key_frame;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t