typedef struct AVPicture {
uint8_t *data[4];
int linesize[4]; ///< number of bytes per line
+ int interlaced;
} AVPicture;
/**
*/
int
gst_ffmpegcsp_avpicture_fill (AVPicture * picture,
- uint8_t * ptr, enum PixelFormat pix_fmt, int width, int height)
+ uint8_t * ptr, enum PixelFormat pix_fmt, int width, int height,
+ int interlaced)
{
int size, w2, h2, size2;
int stride, stride2;
pinfo = get_pix_fmt_info (pix_fmt);
+ picture->interlaced = interlaced;
+
switch (pix_fmt) {
case PIX_FMT_YUV420P:
case PIX_FMT_YUV422P:
uint8_t * ptr,
enum PixelFormat pix_fmt,
int width,
- int height);
+ int height,
+ int interlaced);
#endif /* __GST_FFMPEG_CODECMAP_H__ */
space->width = ctx->width = in_width;
space->height = ctx->height = in_height;
+ space->interlaced = FALSE;
+ gst_structure_get_boolean (structure, "interlaced", &space->interlaced);
+
/* get from format */
ctx->pix_fmt = PIX_FMT_NB;
gst_ffmpegcsp_caps_with_codectype (CODEC_TYPE_VIDEO, incaps, ctx);
/* fill from with source data */
gst_ffmpegcsp_avpicture_fill (&space->from_frame,
- GST_BUFFER_DATA (inbuf), space->from_pixfmt, space->width, space->height);
+ GST_BUFFER_DATA (inbuf), space->from_pixfmt, space->width, space->height,
+ space->interlaced);
/* fill optional palette */
if (space->palette)
/* fill target frame */
gst_ffmpegcsp_avpicture_fill (&space->to_frame,
- GST_BUFFER_DATA (outbuf), space->to_pixfmt, space->width, space->height);
+ GST_BUFFER_DATA (outbuf), space->to_pixfmt, space->width, space->height,
+ space->interlaced);
/* and convert */
result = img_convert (&space->to_frame, space->to_pixfmt,
GstBaseTransform element;
gint width, height;
+ gboolean interlaced;
gfloat fps;
enum PixelFormat from_pixfmt, to_pixfmt;
AVPicture from_frame, to_frame;
AVPicture dummy_pict;
return gst_ffmpegcsp_avpicture_fill (&dummy_pict, NULL, pix_fmt, width,
- height);
+ height, FALSE);
}
/**
}
static int
-avpicture_alloc (AVPicture * picture, int pix_fmt, int width, int height)
+avpicture_alloc (AVPicture * picture, int pix_fmt, int width, int height,
+ int interlaced)
{
unsigned int size;
void *ptr;
ptr = av_malloc (size);
if (!ptr)
goto fail;
- gst_ffmpegcsp_avpicture_fill (picture, ptr, pix_fmt, width, height);
+ gst_ffmpegcsp_avpicture_fill (picture, ptr, pix_fmt, width, height,
+ interlaced);
return 0;
fail:
memset (picture, 0, sizeof (AVPicture));
else
int_pix_fmt = PIX_FMT_RGB24;
}
- if (avpicture_alloc (tmp, int_pix_fmt, dst_width, dst_height) < 0)
+ if (avpicture_alloc (tmp, int_pix_fmt, dst_width, dst_height,
+ dst->interlaced) < 0)
return -1;
ret = -1;
if (img_convert (tmp, int_pix_fmt,