mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-01 01:11:11 +00:00
gst/ffmpegcolorspace/gstffmpegcolorspace.c: Don't ignore return code from ffmpeg convert function.
Original commit message from CVS: * 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.
This commit is contained in:
parent
7bf899a3f5
commit
b4f055fe0f
3 changed files with 29 additions and 5 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
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>
|
2006-02-27 Jan Schmidt <thaytan@mad.scientist.com>
|
||||||
|
|
||||||
* ext/libvisual/visual.c: (gst_visual_init),
|
* ext/libvisual/visual.c: (gst_visual_init),
|
||||||
|
|
|
@ -429,6 +429,7 @@ gst_ffmpegcsp_transform (GstBaseTransform * btrans, GstBuffer * inbuf,
|
||||||
GstBuffer * outbuf)
|
GstBuffer * outbuf)
|
||||||
{
|
{
|
||||||
GstFFMpegCsp *space;
|
GstFFMpegCsp *space;
|
||||||
|
gint result;
|
||||||
|
|
||||||
space = GST_FFMPEGCSP (btrans);
|
space = GST_FFMPEGCSP (btrans);
|
||||||
|
|
||||||
|
@ -449,8 +450,10 @@ gst_ffmpegcsp_transform (GstBaseTransform * btrans, GstBuffer * inbuf,
|
||||||
GST_BUFFER_DATA (outbuf), space->to_pixfmt, space->width, space->height);
|
GST_BUFFER_DATA (outbuf), space->to_pixfmt, space->width, space->height);
|
||||||
|
|
||||||
/* and convert */
|
/* 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);
|
&space->from_frame, space->from_pixfmt, space->width, space->height);
|
||||||
|
if (result == -1)
|
||||||
|
goto not_supported;
|
||||||
|
|
||||||
/* copy timestamps */
|
/* copy timestamps */
|
||||||
gst_buffer_stamp (outbuf, inbuf);
|
gst_buffer_stamp (outbuf, inbuf);
|
||||||
|
@ -465,6 +468,12 @@ unknown_format:
|
||||||
("attempting to convert colorspaces between unknown formats"));
|
("attempting to convert colorspaces between unknown formats"));
|
||||||
return GST_FLOW_NOT_NEGOTIATED;
|
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
|
gboolean
|
||||||
|
|
|
@ -2109,6 +2109,7 @@ img_convert (AVPicture * dst, int dst_pix_fmt,
|
||||||
x_shift = (dst_pix->x_chroma_shift - src_pix->x_chroma_shift);
|
x_shift = (dst_pix->x_chroma_shift - src_pix->x_chroma_shift);
|
||||||
y_shift = (dst_pix->y_chroma_shift - src_pix->y_chroma_shift);
|
y_shift = (dst_pix->y_chroma_shift - src_pix->y_chroma_shift);
|
||||||
xy_shift = ((x_shift & 0xf) << 4) | (y_shift & 0xf);
|
xy_shift = ((x_shift & 0xf) << 4) | (y_shift & 0xf);
|
||||||
|
|
||||||
/* there must be filters for conversion at least from and to
|
/* there must be filters for conversion at least from and to
|
||||||
YUV444 format */
|
YUV444 format */
|
||||||
switch (xy_shift) {
|
switch (xy_shift) {
|
||||||
|
@ -2156,11 +2157,15 @@ img_convert (AVPicture * dst, int dst_pix_fmt,
|
||||||
#define GEN_MASK(x) ((1<<(x))-1)
|
#define GEN_MASK(x) ((1<<(x))-1)
|
||||||
#define DIV_ROUND_UP_X(v,x) (((v) + GEN_MASK(x)) >> (x))
|
#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],
|
resize_func (dst->data[i], dst->linesize[i],
|
||||||
src->data[i], src->linesize[i],
|
src->data[i], src->linesize[i], w, h);
|
||||||
DIV_ROUND_UP_X (dst_width, dst_pix->x_chroma_shift),
|
}
|
||||||
DIV_ROUND_UP_X (dst_height, dst_pix->y_chroma_shift));
|
|
||||||
/* if yuv color space conversion is needed, we do it here on
|
/* if yuv color space conversion is needed, we do it here on
|
||||||
the destination image */
|
the destination image */
|
||||||
if (dst_pix->color_type != src_pix->color_type) {
|
if (dst_pix->color_type != src_pix->color_type) {
|
||||||
|
@ -2228,6 +2233,7 @@ no_chroma_filter:
|
||||||
if (img_convert (tmp, int_pix_fmt,
|
if (img_convert (tmp, int_pix_fmt,
|
||||||
src, src_pix_fmt, src_width, src_height) < 0)
|
src, src_pix_fmt, src_width, src_height) < 0)
|
||||||
goto fail1;
|
goto fail1;
|
||||||
|
|
||||||
if (img_convert (dst, dst_pix_fmt,
|
if (img_convert (dst, dst_pix_fmt,
|
||||||
tmp, int_pix_fmt, dst_width, dst_height) < 0)
|
tmp, int_pix_fmt, dst_width, dst_height) < 0)
|
||||||
goto fail1;
|
goto fail1;
|
||||||
|
|
Loading…
Reference in a new issue