Handle crash on cleanup

It's possible that the last ref to a source-output is removed with
the remove signal, in that case, remove the object from the client
watched objects to avoid freeing it twice.

Use installed gstreamer and fix library name
This commit is contained in:
Wim Taymans 2015-06-02 17:01:35 +02:00
parent 273a5d35dc
commit f6bb35cb98
5 changed files with 31 additions and 33 deletions

View file

@ -179,27 +179,27 @@ AC_SUBST([GDBUS_CODEGEN], [`$PKG_CONFIG --variable gdbus_codegen gio-2.0`])
#### GStreamer #### #### GStreamer ####
PKG_CHECK_MODULES(GST, gstreamer-1.0-uninstalled >= 1.5.0, dummy=yes, PKG_CHECK_MODULES(GST, gstreamer-1.0 >= 1.5.0, dummy=yes,
AC_MSG_ERROR(GStreamer >= 1.5.0 is required)) AC_MSG_ERROR(GStreamer >= 1.5.0 is required))
AC_SUBST(GST_CFLAGS) AC_SUBST(GST_CFLAGS)
AC_SUBST(GST_LIBS) AC_SUBST(GST_LIBS)
PKG_CHECK_MODULES(GSTBASE, gstreamer-base-1.0-uninstalled >= 1.5.0, dummy=yes, PKG_CHECK_MODULES(GSTBASE, gstreamer-base-1.0 >= 1.5.0, dummy=yes,
AC_MSG_ERROR(GStreamer Base>= 1.5.0 is required)) AC_MSG_ERROR(GStreamer Base>= 1.5.0 is required))
GST_CFLAGS="$GST_CFLAGS $GSTBASE_CFLAGS" GST_CFLAGS="$GST_CFLAGS $GSTBASE_CFLAGS"
GST_LIBS="$GST_LIBS $GSTBASE_LIBS" GST_LIBS="$GST_LIBS $GSTBASE_LIBS"
PKG_CHECK_MODULES(GSTPBASE, gstreamer-plugins-base-1.0-uninstalled >= 1.5.0, dummy=yes, PKG_CHECK_MODULES(GSTPBASE, gstreamer-plugins-base-1.0 >= 1.5.0, dummy=yes,
AC_MSG_ERROR(GStreamer Plugins Base>= 1.5.0 is required)) AC_MSG_ERROR(GStreamer Plugins Base>= 1.5.0 is required))
GST_CFLAGS="$GST_CFLAGS $GSTPBASE_CFLAGS" GST_CFLAGS="$GST_CFLAGS $GSTPBASE_CFLAGS"
GST_LIBS="$GST_LIBS $GSTPBASE_LIBS" GST_LIBS="$GST_LIBS $GSTPBASE_LIBS"
PKG_CHECK_MODULES(GSTNET, gstreamer-net-1.0-uninstalled >= 1.5.0, dummy=yes, PKG_CHECK_MODULES(GSTNET, gstreamer-net-1.0 >= 1.5.0, dummy=yes,
AC_MSG_ERROR(GStreamer Net>= 1.5.0 is required)) AC_MSG_ERROR(GStreamer Net>= 1.5.0 is required))
GST_CFLAGS="$GST_CFLAGS $GSTNET_CFLAGS" GST_CFLAGS="$GST_CFLAGS $GSTNET_CFLAGS"
GST_LIBS="$GST_LIBS $GSTNET_LIBS" GST_LIBS="$GST_LIBS $GSTNET_LIBS"
PKG_CHECK_MODULES(GSTALLOC, gstreamer-allocators-1.0-uninstalled >= 1.5.0, dummy=yes, PKG_CHECK_MODULES(GSTALLOC, gstreamer-allocators-1.0 >= 1.5.0, dummy=yes,
AC_MSG_ERROR(GStreamer Allocators>= 1.5.0 is required)) AC_MSG_ERROR(GStreamer Allocators>= 1.5.0 is required))
GST_CFLAGS="$GST_CFLAGS $GSTALLOC_CFLAGS" GST_CFLAGS="$GST_CFLAGS $GSTALLOC_CFLAGS"
GST_LIBS="$GST_LIBS $GSTALLOC_LIBS" GST_LIBS="$GST_LIBS $GSTALLOC_LIBS"

View file

@ -1,4 +1,4 @@
prefix=/usr/local prefix=/mnt/d00b721c-6d2d-4050-8d52-431da51984ef/home/wim/src/gnome/prefix
exec_prefix=${prefix} exec_prefix=${prefix}
libdir=${exec_prefix}/lib libdir=${exec_prefix}/lib
includedir=${prefix}/include includedir=${prefix}/include

View file

@ -203,20 +203,20 @@ libpulsevideocore_@PV_MAJORMINOR@_la_LIBADD = $(AM_LIBADD) $(LIBLTDL) $(LTLIBICO
plugindir = $(libdir)/gstreamer-1.0 plugindir = $(libdir)/gstreamer-1.0
plugin_LTLIBRARIES = libgstpulsevideosrc.la plugin_LTLIBRARIES = libgstpulsevideo.la
libgstpulsevideosrc_la_SOURCES = \ libgstpulsevideo_la_SOURCES = \
gst/gstpv.c \ gst/gstpv.c \
gst/gstfdpay.c \ gst/gstfdpay.c \
gst/gstfddepay.c \ gst/gstfddepay.c \
gst/gstpvsrc.c \ gst/gstpvsrc.c \
gst/gstpvsink.c gst/gstpvsink.c
libgstpulsevideosrc_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GLIB_CFLAGS) libgstpulsevideo_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GLIB_CFLAGS)
libgstpulsevideosrc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstpulsevideo_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstpulsevideosrc_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) $(GLIB_LIBS) $(LIBM) -lgstvideo-1.0 \ libgstpulsevideo_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) $(GLIB_LIBS) $(LIBM) -lgstvideo-1.0 \
libpulsevideo-@PV_MAJORMINOR@.la libpulsevideocore-@PV_MAJORMINOR@.la libpulsevideo-@PV_MAJORMINOR@.la libpulsevideocore-@PV_MAJORMINOR@.la
libgstpulsevideosrc_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) libgstpulsevideo_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
noinst_HEADERS = gst/gstpvsrc.h gst/gstpvsink.h gst/gstfdpay.h gst/gstfddepay.h noinst_HEADERS = gst/gstpvsrc.h gst/gstpvsink.h gst/gstfdpay.h gst/gstfddepay.h
@ -243,23 +243,4 @@ update-map-file:
update-all: update-map-file update-all: update-map-file
# Force installation order of libraries. libtool relinks on install time, in
# which case libpulsecommon has to be installed before others, but the padsp
# preload library has to be done after the normal libraries (e.g. libpulse)
# ...
# Unfortunately automake behaviour means that rules without commands also
# override build-in rules, so it's not trivial to add dependencies.
# See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7328 for the workaround
# ...
# Isn't libtool/autotools fun!
installlibLTLIBRARIES = install-libLTLIBRARIES
$(installlibLTLIBRARIES): install-pkglibLTLIBRARIES
installmodlibexecLTLIBRARIES = install-modlibexecLTLIBRARIES
$(installmodlibexecLTLIBRARIES): install-pkglibLTLIBRARIES
installpadsplibLTLIBRARIES = install-padsplibLTLIBRARIES
$(installpadsplibLTLIBRARIES): install-libLTLIBRARIES
.PHONY: update-all update-map-file coverage .PHONY: update-all update-map-file coverage

View file

@ -125,6 +125,14 @@ pv_client_set_property (GObject *_object,
} }
} }
static void
handle_remove_source_output (PvSourceOutput *output,
gpointer user_data)
{
g_object_steal_data (G_OBJECT (user_data),
pv_source_output_get_object_path (output));
}
static gboolean static gboolean
handle_create_source_output (PvClient1 *interface, handle_create_source_output (PvClient1 *interface,
GDBusMethodInvocation *invocation, GDBusMethodInvocation *invocation,
@ -164,6 +172,11 @@ handle_create_source_output (PvClient1 *interface,
object_path = pv_source_output_get_object_path (output); object_path = pv_source_output_get_object_path (output);
g_signal_connect (output,
"remove",
(GCallback) handle_remove_source_output,
client);
g_object_set_data_full (G_OBJECT (client), g_object_set_data_full (G_OBJECT (client),
object_path, object_path,
output, output,
@ -238,6 +251,11 @@ handle_create_source_input (PvClient1 *interface,
source_input_path = pv_source_output_get_object_path (input); source_input_path = pv_source_output_get_object_path (input);
g_signal_connect (input,
"remove",
(GCallback) handle_remove_source_output,
client);
g_object_set_data_full (G_OBJECT (client), g_object_set_data_full (G_OBJECT (client),
source_input_path, source_input_path,
input, input,

View file

@ -351,7 +351,6 @@ pv_source_update_state (PvSource *source, PvSourceState state)
if (priv->state != state) { if (priv->state != state) {
priv->state = state; priv->state = state;
g_print ("source changed state %d\n", state);
pv_source1_set_state (priv->iface, state); pv_source1_set_state (priv->iface, state);
g_object_notify (G_OBJECT (source), "state"); g_object_notify (G_OBJECT (source), "state");
} }