GstFFMpegDeinterlaceMode new_mode;
enum AVPixelFormat pixfmt;
- AVPicture from_frame, to_frame;
+ AVFrame from_frame, to_frame;
AVFilterContext *buffersink_ctx;
AVFilterContext *buffersrc_ctx;
}
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;
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;
#include <string.h>
#include <libavformat/avformat.h>
+#include <libavutil/imgutils.h>
/* #include <ffmpeg/avi.h> */
#include <gst/gst.h>
#include <gst/base/gstflowcombiner.h>
/* 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;
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);
/*
- * 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.
#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 */
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);
}
#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;
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,