sys/: Fixed a tricky bug. When caps renegotiation happens (only visible on ximagesink but bug is in xv too) set_caps ...

Original commit message from CVS:
2005-11-28  Julien MOUTTE  <julien@moutte.net>

* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_setcaps):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_setcaps): Fixed a tricky bug. When caps
renegotiation
happens (only visible on ximagesink but bug is in xv too)
set_caps was
destroying the internal x[v]image used to memcpy non locally
alloced
buffers so that it got renewed on next _chain. The issue is that
_expose will try to put that image as it reffed it in _put.
Using gst_buffer_unref instead of destroy fixes it !
This commit is contained in:
Julien Moutte 2005-11-28 22:13:33 +00:00
parent 4ab5321400
commit ff7304769f
4 changed files with 19 additions and 3 deletions

View file

@ -1,3 +1,15 @@
2005-11-28 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_setcaps):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_setcaps): Fixed a tricky bug. When caps renegotiation
happens (only visible on ximagesink but bug is in xv too) set_caps was
destroying the internal x[v]image used to memcpy non locally alloced
buffers so that it got renewed on next _chain. The issue is that
_expose will try to put that image as it reffed it in _put.
Using gst_buffer_unref instead of destroy fixes it !
2005-11-28 Edward Hervey <edward@fluendo.com>
* gst/playback/gstdecodebin.c: (gst_decode_bin_init),

2
common

@ -1 +1 @@
Subproject commit b0b08bcd66ca385364b6f90663585b09693aec67
Subproject commit f31468e933b5b980398cf636a37abf16ca46c4a0

View file

@ -574,6 +574,7 @@ gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstXImageBuffer * ximage)
GST_DEBUG_OBJECT (ximagesink, "unreffing %p", ximagesink->cur_image);
gst_buffer_unref (ximagesink->cur_image);
}
GST_DEBUG_OBJECT (ximagesink, "reffing %p as our current image", ximage);
ximagesink->cur_image = GST_XIMAGE_BUFFER (gst_buffer_ref (ximage));
}
@ -1249,7 +1250,9 @@ gst_ximagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
if ((ximagesink->ximage) &&
((GST_VIDEO_SINK_WIDTH (ximagesink) != ximagesink->ximage->width) ||
(GST_VIDEO_SINK_HEIGHT (ximagesink) != ximagesink->ximage->height))) {
gst_ximagesink_ximage_destroy (ximagesink, ximagesink->ximage);
GST_DEBUG_OBJECT (ximagesink, "our image is not usable anymore, unref %p",
ximagesink->ximage);
gst_buffer_unref (GST_BUFFER (ximagesink->ximage));
ximagesink->ximage = NULL;
}

View file

@ -598,6 +598,7 @@ gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink,
GST_DEBUG_OBJECT (xvimagesink, "unreffing %p", xvimagesink->cur_image);
gst_buffer_unref (xvimagesink->cur_image);
}
GST_DEBUG_OBJECT (xvimagesink, "reffing %p as our current image", xvimage);
xvimagesink->cur_image = GST_XVIMAGE_BUFFER (gst_buffer_ref (xvimage));
}
@ -1641,7 +1642,7 @@ gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
GST_FOURCC_ARGS (xvimagesink->xcontext->im_format),
GST_FOURCC_ARGS (im_format));
GST_DEBUG_OBJECT (xvimagesink, "renewing xvimage");
gst_xvimage_buffer_free (xvimagesink->xvimage);
gst_buffer_unref (GST_BUFFER (xvimagesink->xvimage));
xvimagesink->xvimage = NULL;
}