+2006-02-28 Wim Taymans <wim@fluendo.com>
+
+ * gst/ffmpegcolorspace/gstffmpegcolorspace.c:
+ (gst_ffmpegcsp_transform):
+ Don't ignore return code from ffmpeg convert function.
+
+ * gst/ffmpegcolorspace/imgconvert.c: (img_convert):
+ Split out some long statements to ease debugging.
+
2006-02-27 Jan Schmidt <thaytan@mad.scientist.com>
* ext/libvisual/visual.c: (gst_visual_init),
GstBuffer * outbuf)
{
GstFFMpegCsp *space;
+ gint result;
space = GST_FFMPEGCSP (btrans);
GST_BUFFER_DATA (outbuf), space->to_pixfmt, space->width, space->height);
/* and convert */
- img_convert (&space->to_frame, space->to_pixfmt,
+ result = img_convert (&space->to_frame, space->to_pixfmt,
&space->from_frame, space->from_pixfmt, space->width, space->height);
+ if (result == -1)
+ goto not_supported;
/* copy timestamps */
gst_buffer_stamp (outbuf, inbuf);
("attempting to convert colorspaces between unknown formats"));
return GST_FLOW_NOT_NEGOTIATED;
}
+not_supported:
+ {
+ GST_ELEMENT_ERROR (space, CORE, NOT_IMPLEMENTED, (NULL),
+ ("cannot convert between formats"));
+ return GST_FLOW_NOT_SUPPORTED;
+ }
}
gboolean
x_shift = (dst_pix->x_chroma_shift - src_pix->x_chroma_shift);
y_shift = (dst_pix->y_chroma_shift - src_pix->y_chroma_shift);
xy_shift = ((x_shift & 0xf) << 4) | (y_shift & 0xf);
+
/* there must be filters for conversion at least from and to
YUV444 format */
switch (xy_shift) {
#define GEN_MASK(x) ((1<<(x))-1)
#define DIV_ROUND_UP_X(v,x) (((v) + GEN_MASK(x)) >> (x))
- for (i = 1; i <= 2; i++)
+ for (i = 1; i <= 2; i++) {
+ gint w, h;
+
+ w = DIV_ROUND_UP_X (dst_width, dst_pix->x_chroma_shift);
+ h = DIV_ROUND_UP_X (dst_height, dst_pix->y_chroma_shift);
+
resize_func (dst->data[i], dst->linesize[i],
- src->data[i], src->linesize[i],
- DIV_ROUND_UP_X (dst_width, dst_pix->x_chroma_shift),
- DIV_ROUND_UP_X (dst_height, dst_pix->y_chroma_shift));
+ src->data[i], src->linesize[i], w, h);
+ }
/* if yuv color space conversion is needed, we do it here on
the destination image */
if (dst_pix->color_type != src_pix->color_type) {
if (img_convert (tmp, int_pix_fmt,
src, src_pix_fmt, src_width, src_height) < 0)
goto fail1;
+
if (img_convert (dst, dst_pix_fmt,
tmp, int_pix_fmt, dst_width, dst_height) < 0)
goto fail1;