History

Move format from AVFilterBuffer to AVFilterPicRef.

Patch by S.N. Hemanth Meenakshisundaram |smeenaks|ucsd|edu|. Originally committed as revision 24728 to svn://svn.ffmpeg.org/ffmpeg/trunk

S.N. Hemanth Meenakshisundaram committed 16 years ago

Commit d54e0941 parent 59ff3fd4 files · +12 −12Browse files

Unified · Split

4 files
  1. ffplay.c +4 −4
  2. libavfilter/avfilter.h +3 −3
  3. libavfilter/defaults.c +4 −4
  4. libavfilter/vsrc_buffer.c +1 −1
ffplay.c+4−4
@@ -1585,8 +1585,8 @@ static int input_get_buffer(AVCodecContext *codec, AVFrame *pic) · 1584 unmodified lines
15851585 ref->w = codec->width;
15861586 ref->h = codec->height;
15871587 for(i = 0; i < 4; i ++) {
1588− unsigned hshift = (i == 1 || i == 2) ? av_pix_fmt_descriptors[ref->pic->format].log2_chroma_w : 0;
1589− unsigned vshift = (i == 1 || i == 2) ? av_pix_fmt_descriptors[ref->pic->format].log2_chroma_h : 0;
1588+ unsigned hshift = (i == 1 || i == 2) ? av_pix_fmt_descriptors[ref->format].log2_chroma_w : 0;
1589+ unsigned vshift = (i == 1 || i == 2) ? av_pix_fmt_descriptors[ref->format].log2_chroma_h : 0;
15901590
15911591 if (ref->data[i]) {
15921592 ref->data[i] += (edge >> hshift) + ((edge * ref->linesize[i]) >> vshift);
@@ -1617,7 +1617,7 @@ static int input_reget_buffer(AVCodecContext *codec, AVFrame *pic) · 24 unmodified lines
16171617 }
16181618
16191619 if ((codec->width != ref->w) || (codec->height != ref->h) ||
1620− (codec->pix_fmt != ref->pic->format)) {
1620+ (codec->pix_fmt != ref->format)) {
16211621 av_log(codec, AV_LOG_ERROR, "Picture properties changed.\n");
16221622 return -1;
16231623 }
@@ -1671,7 +1671,7 @@ static int input_request_frame(AVFilterLink *link) · 47 unmodified lines
16711671 } else {
16721672 picref = avfilter_get_video_buffer(link, AV_PERM_WRITE, link->w, link->h);
16731673 av_picture_copy((AVPicture *)&picref->data, (AVPicture *)priv->frame,
1674− picref->pic->format, link->w, link->h);
1674+ picref->format, link->w, link->h);
16751675 }
16761676 av_free_packet(&pkt);
16771677
libavfilter/avfilter.h+3−3
@@ -25,8 +25,8 @@ · 24 unmodified lines
2525 #include "libavutil/avutil.h"
2626
2727 #define LIBAVFILTER_VERSION_MAJOR 1
28−#define LIBAVFILTER_VERSION_MINOR 27
29−#define LIBAVFILTER_VERSION_MICRO 1
28+#define LIBAVFILTER_VERSION_MINOR 28
29+#define LIBAVFILTER_VERSION_MICRO 0
3030
3131 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
3232 LIBAVFILTER_VERSION_MINOR, \
@@ -68,7 +68,6 @@ typedef struct AVFilterBuffer · 35 unmodified lines
6868 {
6969 uint8_t *data[8]; ///< buffer data for each plane/channel
7070 int linesize[8]; ///< number of bytes per line
71− int format; ///< media format
7271
7372 unsigned refcount; ///< number of references to this buffer
7473
@@ -104,6 +103,7 @@ typedef struct AVFilterPicRef · 29 unmodified lines
104103 int linesize[4]; ///< number of bytes per line
105104 int w; ///< image width
106105 int h; ///< image height
106+ int format; ///< media format
107107
108108 int64_t pts; ///< presentation timestamp in units of 1/AV_TIME_BASE
109109 int64_t pos; ///< byte position in stream, -1 if unknown
libavfilter/defaults.c+4−4
@@ -47,17 +47,17 @@ AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, · 46 unmodified lines
4747 ref->perms = perms | AV_PERM_READ;
4848
4949 pic->refcount = 1;
50− pic->format = link->format;
50+ ref->format = link->format;
5151 pic->free = avfilter_default_free_buffer;
52− av_fill_image_linesizes(pic->linesize, pic->format, ref->w);
52+ av_fill_image_linesizes(pic->linesize, ref->format, ref->w);
5353
5454 for (i=0; i<4;i++)
5555 pic->linesize[i] = FFALIGN(pic->linesize[i], 16);
5656
57− tempsize = av_fill_image_pointers(pic->data, pic->format, ref->h, NULL, pic->linesize);
57+ tempsize = av_fill_image_pointers(pic->data, ref->format, ref->h, NULL, pic->linesize);
5858 buf = av_malloc(tempsize + 16); // +2 is needed for swscaler, +16 to be
5959 // SIMD-friendly
60− av_fill_image_pointers(pic->data, pic->format, ref->h, buf, pic->linesize);
60+ av_fill_image_pointers(pic->data, ref->format, ref->h, buf, pic->linesize);
6161
6262 memcpy(ref->data, pic->data, 4*sizeof(pic->data[0]));
6363 memcpy(ref->linesize, pic->linesize, 4*sizeof(pic->linesize[0]));
libavfilter/vsrc_buffer.c+1−1
@@ -120,7 +120,7 @@ static int request_frame(AVFilterLink *link) · 119 unmodified lines
120120 link->w, link->h);
121121
122122 av_picture_copy((AVPicture *)&picref->data, (AVPicture *)&c->frame,
123− picref->pic->format, link->w, link->h);
123+ picref->format, link->w, link->h);
124124
125125 picref->pts = c->pts;
126126 picref->pixel_aspect = c->pixel_aspect;

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