Commit c1db7bff authored by S.N. Hemanth Meenakshisundaram's avatar S.N. Hemanth Meenakshisundaram Committed by Stefano Sabatini

Resize data and linesize in AVFilterBufferRef to 8.

This is required to make AVFilterBufferRef able to contain also audio
data, required by audio filtering integration.

Patch by S.N. Hemanth Meenakshisundaram smeen?ks@ucsd.ed?.

Originally committed as revision 24773 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent e1f4dd6d
...@@ -1670,8 +1670,9 @@ static int input_request_frame(AVFilterLink *link) ...@@ -1670,8 +1670,9 @@ static int input_request_frame(AVFilterLink *link)
picref = avfilter_ref_buffer(priv->frame->opaque, ~0); picref = avfilter_ref_buffer(priv->frame->opaque, ~0);
} else { } else {
picref = avfilter_get_video_buffer(link, AV_PERM_WRITE, link->w, link->h); picref = avfilter_get_video_buffer(link, AV_PERM_WRITE, link->w, link->h);
av_picture_copy((AVPicture *)&picref->data, (AVPicture *)priv->frame, av_picture_data_copy(picref->data, picref->linesize,
picref->format, link->w, link->h); priv->frame->data, priv->frame->linesize,
picref->format, link->w, link->h);
} }
av_free_packet(&pkt); av_free_packet(&pkt);
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "libavutil/avutil.h" #include "libavutil/avutil.h"
#define LIBAVFILTER_VERSION_MAJOR 1 #define LIBAVFILTER_VERSION_MAJOR 1
#define LIBAVFILTER_VERSION_MINOR 33 #define LIBAVFILTER_VERSION_MINOR 34
#define LIBAVFILTER_VERSION_MICRO 0 #define LIBAVFILTER_VERSION_MICRO 0
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
...@@ -113,8 +113,8 @@ typedef struct AVFilterBufferRefVideoProps ...@@ -113,8 +113,8 @@ typedef struct AVFilterBufferRefVideoProps
typedef struct AVFilterBufferRef typedef struct AVFilterBufferRef
{ {
AVFilterBuffer *buf; ///< the buffer that this is a reference to AVFilterBuffer *buf; ///< the buffer that this is a reference to
uint8_t *data[4]; ///< picture data for each plane uint8_t *data[8]; ///< picture data for each plane
int linesize[4]; ///< number of bytes per line int linesize[8]; ///< number of bytes per line
int format; ///< media format int format; ///< media format
int64_t pts; ///< presentation timestamp in units of 1/AV_TIME_BASE int64_t pts; ///< presentation timestamp in units of 1/AV_TIME_BASE
......
...@@ -60,8 +60,8 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int per ...@@ -60,8 +60,8 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int per
// SIMD-friendly // SIMD-friendly
av_fill_image_pointers(pic->data, ref->format, ref->video->h, buf, pic->linesize); av_fill_image_pointers(pic->data, ref->format, ref->video->h, buf, pic->linesize);
memcpy(ref->data, pic->data, 4*sizeof(pic->data[0])); memcpy(ref->data, pic->data, sizeof(ref->data));
memcpy(ref->linesize, pic->linesize, 4*sizeof(pic->linesize[0])); memcpy(ref->linesize, pic->linesize, sizeof(ref->linesize));
return ref; return ref;
} }
......
...@@ -119,8 +119,9 @@ static int request_frame(AVFilterLink *link) ...@@ -119,8 +119,9 @@ static int request_frame(AVFilterLink *link)
AV_PERM_REUSE2, AV_PERM_REUSE2,
link->w, link->h); link->w, link->h);
av_picture_copy((AVPicture *)&picref->data, (AVPicture *)&c->frame, av_picture_data_copy(picref->data, picref->linesize,
picref->format, link->w, link->h); c->frame.data, c->frame.linesize,
picref->format, link->w, link->h);
picref->pts = c->pts; picref->pts = c->pts;
picref->video->pixel_aspect = c->pixel_aspect; picref->video->pixel_aspect = c->pixel_aspect;
......
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