mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-29 20:35:40 +00:00
ext/ffmpeg/gstffmpegcolorspace.c: Fixing the pad_alloc_buffer implementation to use ->srcpad
Original commit message from CVS: 2004-01-11 Julien MOUTTE <julien@moutte.net> * ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain): Fixing the pad_alloc_buffer implementation to use ->srcpad * ext/hermes/gstcolorspace.c: (gst_colorspace_chain): Fixing the pad_alloc_buffer implementation to use ->srcpad * gst/videoscale/gstvideoscale.c: (gst_videoscale_chain): Fixing the pad_alloc_buffer implementation to use ->srcpad * sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new), (gst_ximagesink_chain), (gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc): Now only use GST_BUFFER_PRIVATE to keep a reference to everything we need. * sys/ximage/ximagesink.h: adding a reference to the sink in the image. * sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new), (gst_xvimagesink_chain), (gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc): Now only use GST_BUFFER_PRIVATE to keep a reference to everything we need. * sys/xvimage/xvimagesink.h: adding a reference to the sink in the image
This commit is contained in:
parent
0cae73e234
commit
becf91cdfc
6 changed files with 48 additions and 15 deletions
19
ChangeLog
19
ChangeLog
|
@ -1,3 +1,22 @@
|
|||
2004-01-11 Julien MOUTTE <julien@moutte.net>
|
||||
|
||||
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain): Fixing the
|
||||
pad_alloc_buffer implementation to use ->srcpad
|
||||
* ext/hermes/gstcolorspace.c: (gst_colorspace_chain): Fixing the
|
||||
pad_alloc_buffer implementation to use ->srcpad
|
||||
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain): Fixing the
|
||||
pad_alloc_buffer implementation to use ->srcpad
|
||||
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
|
||||
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
|
||||
(gst_ximagesink_buffer_alloc): Now only use GST_BUFFER_PRIVATE to keep
|
||||
a reference to everything we need.
|
||||
* sys/ximage/ximagesink.h: adding a reference to the sink in the image.
|
||||
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
|
||||
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
|
||||
(gst_xvimagesink_buffer_alloc): Now only use GST_BUFFER_PRIVATE to keep
|
||||
a reference to everything we need.
|
||||
* sys/xvimage/xvimagesink.h: adding a reference to the sink in the image
|
||||
|
||||
2004-01-11 David Schleef <ds@schleef.org>
|
||||
|
||||
* ext/divx/gstdivxenc.c: remove bogus gst_caps_is_fixed() test
|
||||
|
|
|
@ -370,7 +370,7 @@ gst_videoscale_chain (GstPad *pad, GstData *_data)
|
|||
g_return_if_fail (size == videoscale->from_buf_size);
|
||||
|
||||
outbuf = gst_buffer_new();
|
||||
outbuf = gst_pad_alloc_buffer (gst_pad_get_peer (pad),
|
||||
outbuf = gst_pad_alloc_buffer (videoscale->srcpad,
|
||||
GST_BUFFER_OFFSET_NONE, videoscale->to_buf_size);
|
||||
|
||||
/*GST_BUFFER_SIZE(outbuf) = videoscale->to_buf_size;*/
|
||||
|
|
|
@ -73,6 +73,7 @@ gst_ximagesink_ximage_new (GstXImageSink *ximagesink, gint width, gint height)
|
|||
ximage->width = width;
|
||||
ximage->height = height;
|
||||
ximage->data = NULL;
|
||||
ximage->ximagesink = ximagesink;
|
||||
|
||||
g_mutex_lock (ximagesink->x_lock);
|
||||
|
||||
|
@ -738,10 +739,9 @@ gst_ximagesink_chain (GstPad *pad, GstData *data)
|
|||
|
||||
/* If this buffer has been allocated using our buffer management we simply
|
||||
put the ximage which is in the PRIVATE pointer */
|
||||
if (GST_BUFFER_PRIVATE (buf) == ximagesink)
|
||||
if (GST_BUFFER_PRIVATE (buf))
|
||||
{
|
||||
GstXImage * image = buf->_gst_reserved[0];
|
||||
gst_ximagesink_ximage_put (ximagesink, image);
|
||||
gst_ximagesink_ximage_put (ximagesink, GST_BUFFER_PRIVATE (buf));
|
||||
}
|
||||
else /* Else we have to copy the data into our private image, */
|
||||
{ /* if we have one... */
|
||||
|
@ -779,9 +779,12 @@ gst_ximagesink_buffer_free (GstData *data)
|
|||
GstXImage *ximage;
|
||||
GstBuffer *buffer;
|
||||
|
||||
ximagesink = GST_BUFFER_PRIVATE (data);
|
||||
ximage = GST_BUFFER_PRIVATE (data);
|
||||
|
||||
g_assert (GST_IS_XIMAGESINK (ximage->ximagesink));
|
||||
ximagesink = ximage->ximagesink;
|
||||
|
||||
buffer = GST_BUFFER (data);
|
||||
ximage = buffer->_gst_reserved[0];
|
||||
|
||||
/* If our geometry changed we can't reuse that image. */
|
||||
if ( (ximage->width != GST_VIDEOSINK_WIDTH (ximagesink)) ||
|
||||
|
@ -849,8 +852,8 @@ gst_ximagesink_buffer_alloc (GstPad *pad, guint64 offset, guint size)
|
|||
{
|
||||
buffer = gst_buffer_new ();
|
||||
|
||||
GST_BUFFER_PRIVATE (buffer) = ximagesink;
|
||||
buffer->_gst_reserved[0] = (void *)ximage;
|
||||
/* Storing some pointers in the buffer */
|
||||
GST_BUFFER_PRIVATE (buffer) = ximage;
|
||||
|
||||
GST_BUFFER_DATA (buffer) = ximage->ximage->data;
|
||||
GST_DATA_FREE_FUNC (buffer) = gst_ximagesink_buffer_free;
|
||||
|
|
|
@ -89,6 +89,9 @@ struct _GstXWindow {
|
|||
|
||||
/* XImage stuff */
|
||||
struct _GstXImage {
|
||||
/* Reference to the ximagesink we belong to */
|
||||
GstXImageSink *ximagesink;
|
||||
|
||||
XImage *ximage;
|
||||
|
||||
#ifdef HAVE_XSHM
|
||||
|
|
|
@ -80,6 +80,7 @@ gst_xvimagesink_xvimage_new (GstXvImageSink *xvimagesink,
|
|||
xvimage->width = width;
|
||||
xvimage->height = height;
|
||||
xvimage->data = NULL;
|
||||
xvimage->xvimagesink = xvimagesink;
|
||||
|
||||
g_mutex_lock (xvimagesink->x_lock);
|
||||
|
||||
|
@ -898,8 +899,10 @@ gst_xvimagesink_chain (GstPad *pad, GstData *data)
|
|||
|
||||
/* If this buffer has been allocated using our buffer management we simply
|
||||
put the ximage which is in the PRIVATE pointer */
|
||||
if (GST_BUFFER_PRIVATE (buf) == xvimagesink)
|
||||
gst_xvimagesink_xvimage_put (xvimagesink, buf->_gst_reserved[0]);
|
||||
if (GST_BUFFER_PRIVATE (buf))
|
||||
{
|
||||
gst_xvimagesink_xvimage_put (xvimagesink, GST_BUFFER_PRIVATE (buf));
|
||||
}
|
||||
else /* Else we have to copy the data into our private image, */
|
||||
{ /* if we have one... */
|
||||
if (xvimagesink->xvimage)
|
||||
|
@ -936,9 +939,12 @@ gst_xvimagesink_buffer_free (GstData *data)
|
|||
GstXvImage *xvimage;
|
||||
GstBuffer *buffer;
|
||||
|
||||
xvimagesink = GST_BUFFER_PRIVATE (data);
|
||||
xvimage = GST_BUFFER_PRIVATE (data);
|
||||
|
||||
g_assert (GST_IS_XVIMAGESINK (xvimage->xvimagesink));
|
||||
xvimagesink = xvimage->xvimagesink;
|
||||
|
||||
buffer = GST_BUFFER (data);
|
||||
xvimage = buffer->_gst_reserved[0];
|
||||
|
||||
/* If our geometry changed we can't reuse that image. */
|
||||
if ( (xvimage->width != GST_VIDEOSINK_WIDTH (xvimagesink)) ||
|
||||
|
@ -1007,9 +1013,8 @@ gst_xvimagesink_buffer_alloc (GstPad *pad, guint64 offset, guint size)
|
|||
{
|
||||
buffer = gst_buffer_new ();
|
||||
|
||||
/* Storing some pointers in the buffer (bit hackish) */
|
||||
GST_BUFFER_PRIVATE (buffer) = xvimagesink;
|
||||
buffer->_gst_reserved[0] = xvimage;
|
||||
/* Storing some pointers in the buffer */
|
||||
GST_BUFFER_PRIVATE (buffer) = xvimage;
|
||||
|
||||
GST_BUFFER_DATA (buffer) = xvimage->xvimage->data;
|
||||
GST_DATA_FREE_FUNC (buffer) = gst_xvimagesink_buffer_free;
|
||||
|
|
|
@ -104,6 +104,9 @@ struct _GstXvImageFormat {
|
|||
|
||||
/* XvImage stuff */
|
||||
struct _GstXvImage {
|
||||
/* Reference to the xvimagesink we belong to */
|
||||
GstXvImageSink *xvimagesink;
|
||||
|
||||
XvImage *xvimage;
|
||||
|
||||
#ifdef HAVE_XSHM
|
||||
|
|
Loading…
Reference in a new issue