From 71ab6314a14b30e712cdbaaf02232a6439cf2e0f Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Tue, 6 Sep 2005 23:26:49 +0000 Subject: [PATCH] configure.ac: In the output at the end, don't show the first plugin on the same line as "Core plug-ins, always built:". Original commit message from CVS: * configure.ac: In the output at the end, don't show the first plugin on the same line as "Core plug-ins, always built:". Indent the output as for other plugin categories * gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_create): #define that can be used to not use peer buffer_alloc functions for test purposes. * sys/ximage/ximagesink.c: (gst_ximage_buffer_init), (gst_ximage_buffer_get_type), (gst_ximagesink_ximage_new), (gst_ximagesink_show_frame): * sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_init), (gst_xvimage_buffer_get_type), (gst_xvimagesink_setcaps), (gst_xvimagesink_show_frame): Error case handling fixes. gst-launch fakesrc ! x[v]imagesink now fails gracefully instead of XError aborting or deadlocking. --- ChangeLog | 18 ++++++++++++++++++ configure.ac | 4 ++-- gst/videotestsrc/gstvideotestsrc.c | 10 ++++++++++ sys/ximage/ximagesink.c | 11 ++++++----- sys/xvimage/xvimagesink.c | 9 +++++---- 5 files changed, 41 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index fc291c8ce6..8513a3f30d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2005-09-07 Jan Schmidt + + * configure.ac: + In the output at the end, don't show the first plugin on the same + line as "Core plug-ins, always built:". + Indent the output as for other plugin categories + * gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_create): + #define that can be used to not use peer buffer_alloc functions for + test purposes. + * sys/ximage/ximagesink.c: (gst_ximage_buffer_init), + (gst_ximage_buffer_get_type), (gst_ximagesink_ximage_new), + (gst_ximagesink_show_frame): + * sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_init), + (gst_xvimage_buffer_get_type), (gst_xvimagesink_setcaps), + (gst_xvimagesink_show_frame): + Error case handling fixes. gst-launch fakesrc ! x[v]imagesink now + fails gracefully instead of XError aborting or deadlocking. + 2005-09-07 Stefan Kost * ext/libvisual/Makefile.am: diff --git a/configure.ac b/configure.ac index eebf2b7c8f..40d9df8f33 100644 --- a/configure.ac +++ b/configure.ac @@ -867,8 +867,8 @@ m4/Makefile ) AC_OUTPUT -echo -n "configure: *** Core plug-ins, always built:" -( for i in $GST_PLUGINS_ALL; do echo $i; done ) | sort +echo "configure: *** Core plug-ins, always built:" +( for i in $GST_PLUGINS_ALL; do echo -e '\t'$i; done ) | sort echo echo -n "configure: *** Plug-ins relying on libraries that will be built:" echo -e "$GST_PLUGINS_YES" | sort diff --git a/gst/videotestsrc/gstvideotestsrc.c b/gst/videotestsrc/gstvideotestsrc.c index e94a8aab5f..6271c5e9a0 100644 --- a/gst/videotestsrc/gstvideotestsrc.c +++ b/gst/videotestsrc/gstvideotestsrc.c @@ -29,6 +29,7 @@ #include #include +#define USE_PEER_BUFFERALLOC GST_DEBUG_CATEGORY (videotestsrc_debug); #define GST_CAT_DEFAULT videotestsrc_debug @@ -402,11 +403,20 @@ gst_videotestsrc_create (GstPushSrc * psrc, GstBuffer ** buffer) GST_LOG_OBJECT (videotestsrc, "creating buffer of %ld bytes for %dx%d image", newsize, videotestsrc->width, videotestsrc->height); +#ifdef USE_PEER_BUFFERALLOC res = gst_pad_alloc_buffer (GST_BASE_SRC_PAD (psrc), GST_BUFFER_OFFSET_NONE, newsize, GST_PAD_CAPS (GST_BASE_SRC_PAD (psrc)), &outbuf); if (res != GST_FLOW_OK) goto no_buffer; +#else + res = GST_FLOW_OK; + + outbuf = gst_buffer_new_and_alloc (newsize); + if (outbuf == NULL) + goto no_buffer; + gst_buffer_set_caps (outbuf, GST_PAD_CAPS (GST_BASE_SRC_PAD (psrc))); +#endif videotestsrc->make_image (videotestsrc, (void *) GST_BUFFER_DATA (outbuf), videotestsrc->width, videotestsrc->height); diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index 993b560c62..9f62b9ce1d 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -141,9 +141,10 @@ gst_ximage_buffer_finalize (GstXImageBuffer * ximage_buffer) } static void -gst_ximage_buffer_init (GTypeInstance * instance, gpointer g_class) +gst_ximage_buffer_init (GstXImageBuffer * ximage_buffer, gpointer g_class) { - + ximage_buffer->SHMInfo.shmaddr = ((void *) -1); + ximage_buffer->SHMInfo.shmid = -1; } static void @@ -170,7 +171,7 @@ gst_ximage_buffer_get_type (void) NULL, sizeof (GstXImageBuffer), 0, - gst_ximage_buffer_init, + (GInstanceInitFunc) gst_ximage_buffer_init, NULL }; _gst_ximage_buffer_type = g_type_register_static (GST_TYPE_BUFFER, @@ -354,9 +355,9 @@ gst_ximagesink_ximage_new (GstXImageSink * ximagesink, gint width, gint height) GST_BUFFER_DATA (ximage) = (guchar *) ximage->ximage->data; GST_BUFFER_SIZE (ximage) = ximage->size; +beach: g_mutex_unlock (ximagesink->x_lock); -beach: if (!succeeded) { gst_buffer_unref (GST_BUFFER (ximage)); ximage = NULL; @@ -1253,7 +1254,7 @@ no_ximage: { /* No image available. That's very bad ! */ g_mutex_unlock (ximagesink->stream_lock); - gst_buffer_unref (buf); + GST_DEBUG ("could not create image"); GST_ELEMENT_ERROR (ximagesink, CORE, NEGOTIATION, (NULL), ("Failed creating an XImage in ximagesink chain function.")); return GST_FLOW_ERROR; diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 50f6080b5c..fba849a037 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -202,8 +202,10 @@ gst_xvimage_buffer_free (GstXvImageBuffer * xvimage) } static void -gst_xvimage_buffer_init (GTypeInstance * instance, gpointer g_class) +gst_xvimage_buffer_init (GstXvImageBuffer * xvimage, gpointer g_class) { + xvimage->SHMInfo.shmaddr = ((void *) -1); + xvimage->SHMInfo.shmid = -1; } static void @@ -230,7 +232,7 @@ gst_xvimage_buffer_get_type (void) NULL, sizeof (GstXvImageBuffer), 0, - gst_xvimage_buffer_init, + (GInstanceInitFunc) gst_xvimage_buffer_init, NULL }; _gst_xvimage_buffer_type = g_type_register_static (GST_TYPE_BUFFER, @@ -1309,7 +1311,7 @@ gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps) xvimagesink = GST_XVIMAGESINK (bsink); GST_DEBUG_OBJECT (xvimagesink, - "sinkconnect possible caps %" GST_PTR_FORMAT " with given caps %" + "In setcaps. Possible caps %" GST_PTR_FORMAT ", setting caps %" GST_PTR_FORMAT, xvimagesink->xcontext->caps, caps); structure = gst_caps_get_structure (caps, 0); @@ -1548,7 +1550,6 @@ gst_xvimagesink_show_frame (GstBaseSink * bsink, GstBuffer * buf) no_image: { /* No image available. That's very bad ! */ - gst_buffer_unref (buf); GST_DEBUG ("could not create image"); GST_ELEMENT_ERROR (xvimagesink, CORE, NEGOTIATION, (NULL), ("Failed creating an XvImage in xvimagesink chain function."));