diff --git a/ext/libav/gstavdeinterlace.c b/ext/libav/gstavdeinterlace.c index 0a1809a40d..faa0398f3c 100644 --- a/ext/libav/gstavdeinterlace.c +++ b/ext/libav/gstavdeinterlace.c @@ -96,7 +96,7 @@ typedef struct _GstFFMpegDeinterlace GstFFMpegDeinterlaceMode new_mode; enum AVPixelFormat pixfmt; - AVPicture from_frame, to_frame; + AVFrame from_frame, to_frame; AVFilterContext *buffersink_ctx; AVFilterContext *buffersrc_ctx; @@ -355,8 +355,8 @@ init_filter_graph (GstFFMpegDeinterlace * deinterlace, } static int -process_filter_graph (GstFFMpegDeinterlace * deinterlace, AVPicture * dst, - const AVPicture * src, enum AVPixelFormat pixfmt, int width, int height) +process_filter_graph (GstFFMpegDeinterlace * deinterlace, AVFrame * dst, + const AVFrame * src, enum AVPixelFormat pixfmt, int width, int height) { int res; @@ -384,8 +384,9 @@ process_filter_graph (GstFFMpegDeinterlace * deinterlace, AVPicture * dst, deinterlace->filter_frame); if (res < 0) return res; - av_picture_copy (dst, (const AVPicture *) deinterlace->filter_frame, pixfmt, - width, height); + av_image_copy (dst->data, dst->linesize, + (const uint8_t **) deinterlace->filter_frame->data, + deinterlace->filter_frame->linesize, pixfmt, width, height); av_frame_unref (deinterlace->filter_frame); return 0; diff --git a/ext/libav/gstavdemux.c b/ext/libav/gstavdemux.c index 7de25e4f63..c296238ec0 100644 --- a/ext/libav/gstavdemux.c +++ b/ext/libav/gstavdemux.c @@ -26,6 +26,7 @@ #include #include +#include /* #include */ #include #include @@ -1491,7 +1492,7 @@ gst_ffmpegdemux_loop (GstFFMpegDemux * demux) /* copy the data from packet into the target buffer * and do conversions for raw video packets */ if (rawvideo) { - AVPicture src, dst; + AVFrame src, dst; const gchar *plugin_name = ((GstFFMpegDemuxClass *) (G_OBJECT_GET_CLASS (demux)))->in_plugin->name; GstMapInfo map; @@ -1506,8 +1507,9 @@ gst_ffmpegdemux_loop (GstFFMpegDemux * demux) avstream->codec->pix_fmt, avstream->codec->width, avstream->codec->height); - av_picture_copy (&dst, &src, avstream->codec->pix_fmt, - avstream->codec->width, avstream->codec->height); + av_image_copy (dst.data, dst.linesize, (const uint8_t **) src.data, + src.linesize, avstream->codec->pix_fmt, avstream->codec->width, + avstream->codec->height); gst_buffer_unmap (outbuf, &map); } else { gst_buffer_fill (outbuf, 0, pkt.data, outsize); diff --git a/ext/libav/gstavutils.c b/ext/libav/gstavutils.c index 2f04abf5a4..3780cff4f8 100644 --- a/ext/libav/gstavutils.c +++ b/ext/libav/gstavutils.c @@ -77,7 +77,7 @@ av_smp_format_depth (enum AVSampleFormat smp_fmt) /* - * Fill in pointers to memory in a AVPicture, where + * Fill in pointers to memory in a AVFrame, where * everything is aligned by 4 (as required by X). * This is mostly a copy from imgconvert.c with some * small changes. @@ -88,7 +88,7 @@ av_smp_format_depth (enum AVSampleFormat smp_fmt) #define FF_COLOR_YUV 2 /* YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */ #define FF_COLOR_YUV_JPEG 3 /* YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */ -#define FF_PIXEL_PLANAR 0 /* each channel has one component in AVPicture */ +#define FF_PIXEL_PLANAR 0 /* each channel has one component in AVFrame */ #define FF_PIXEL_PACKED 1 /* only one components containing all the channels */ #define FF_PIXEL_PALETTE 2 /* one components containing indexes for a palette */ @@ -267,7 +267,7 @@ gst_ffmpeg_init_pix_fmt_info (void) int gst_ffmpeg_avpicture_get_size (int pix_fmt, int width, int height) { - AVPicture dummy_pict; + AVFrame dummy_pict; return gst_ffmpeg_avpicture_fill (&dummy_pict, NULL, pix_fmt, width, height); } @@ -280,7 +280,7 @@ gst_ffmpeg_avpicture_get_size (int pix_fmt, int width, int height) #define DIV_ROUND_UP_X(v,x) (((v) + GEN_MASK(x)) >> (x)) int -gst_ffmpeg_avpicture_fill (AVPicture * picture, +gst_ffmpeg_avpicture_fill (AVFrame * picture, uint8_t * ptr, enum AVPixelFormat pix_fmt, int width, int height) { int size, w2, h2, size2; diff --git a/ext/libav/gstavutils.h b/ext/libav/gstavutils.h index f4d90ef848..d18b979f3a 100644 --- a/ext/libav/gstavutils.h +++ b/ext/libav/gstavutils.h @@ -36,11 +36,11 @@ int gst_ffmpeg_avpicture_get_size (int pix_fmt, int width, int height); /* - * Fill in pointers in an AVPicture, aligned by 4 (required by X). + * Fill in pointers in an AVFrame, aligned by 4 (required by X). */ int -gst_ffmpeg_avpicture_fill (AVPicture * picture, +gst_ffmpeg_avpicture_fill (AVFrame * picture, uint8_t * ptr, enum AVPixelFormat pix_fmt, int width,