diff --git a/gst/playback/Makefile.am b/gst/playback/Makefile.am index f4e4b6a06e..7b05587070 100644 --- a/gst/playback/Makefile.am +++ b/gst/playback/Makefile.am @@ -17,6 +17,7 @@ libgstplaybin_la_SOURCES = \ gstplaybasebin.c \ gstplay-enum.c \ gstfactorylists.c \ + gstinputselector.c \ gstscreenshot.c \ gststreaminfo.c \ gststreamselector.c @@ -59,6 +60,7 @@ noinst_HEADERS = \ gstplaysink.h \ gststreaminfo.h \ gstfactorylists.h \ + gstinputselector.h \ gstplay-enum.h \ gstscreenshot.h \ gststreamselector.h diff --git a/gst/playback/gstinputselector.c b/gst/playback/gstinputselector.c index 832707d0bd..ae0fa45a6e 100644 --- a/gst/playback/gstinputselector.c +++ b/gst/playback/gstinputselector.c @@ -36,7 +36,7 @@ #include #include "gstinputselector.h" -#include "gstselector-marshal.h" +#include "gstplay-marshal.h" GST_DEBUG_CATEGORY_STATIC (input_selector_debug); #define GST_CAT_DEFAULT input_selector_debug @@ -154,7 +154,7 @@ static GstFlowReturn gst_selector_pad_chain (GstPad * pad, GstBuffer * buf); static GstFlowReturn gst_selector_pad_bufferalloc (GstPad * pad, guint64 offset, guint size, GstCaps * caps, GstBuffer ** buf); -static GType +GType gst_selector_pad_get_type (void) { static GType selector_pad_type = 0; @@ -173,7 +173,7 @@ gst_selector_pad_get_type (void) }; selector_pad_type = - g_type_register_static (GST_TYPE_PAD, "GstSelectorPad", + g_type_register_static (GST_TYPE_PAD, "GstPlaybin2SelectorPad", &selector_pad_info, 0); } return selector_pad_type; @@ -711,9 +711,9 @@ gst_input_selector_get_type (void) }; input_selector_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstInputSelector", &input_selector_info, 0); + "GstPlaybin2InputSelector", &input_selector_info, 0); GST_DEBUG_CATEGORY_INIT (input_selector_debug, - "input-selector", 0, "An input stream selector element"); + "playbin2-input-selector", 0, "Playbin2 input stream selector element"); } return input_selector_type; @@ -770,7 +770,7 @@ gst_input_selector_class_init (GstInputSelectorClass * klass) g_signal_new ("block", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (GstInputSelectorClass, block), NULL, NULL, - gst_selector_marshal_INT64__VOID, G_TYPE_INT64, 0); + gst_play_marshal_INT64__VOID, G_TYPE_INT64, 0); /** * GstInputSelector::switch: * @inputselector: the #GstInputSelector @@ -820,7 +820,7 @@ gst_input_selector_class_init (GstInputSelectorClass * klass) gst_input_selector_signals[SIGNAL_SWITCH] = g_signal_new ("switch", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstInputSelectorClass, switch_), - NULL, NULL, gst_selector_marshal_VOID__OBJECT_INT64_INT64, + NULL, NULL, gst_play_marshal_VOID__OBJECT_INT64_INT64, G_TYPE_NONE, 3, GST_TYPE_PAD, G_TYPE_INT64, G_TYPE_INT64); gstelement_class->request_new_pad = gst_input_selector_request_new_pad; diff --git a/gst/playback/gstinputselector.h b/gst/playback/gstinputselector.h index 58a671d50c..83e0e54146 100644 --- a/gst/playback/gstinputselector.h +++ b/gst/playback/gstinputselector.h @@ -78,6 +78,7 @@ struct _GstInputSelectorClass { }; GType gst_input_selector_get_type (void); +GType gst_selector_pad_get_type (void); G_END_DECLS diff --git a/gst/playback/gstplay-marshal.list b/gst/playback/gstplay-marshal.list index d7eddf445b..c07fdce7a2 100644 --- a/gst/playback/gstplay-marshal.list +++ b/gst/playback/gstplay-marshal.list @@ -8,3 +8,5 @@ BOXED:OBJECT,BOXED,BOXED BOXED:INT OBJECT:BOXED OBJECT:INT +INT64:VOID +VOID:OBJECT,INT64,INT64 diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index dbe1c508f1..6fc8d2d1c1 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -230,6 +230,7 @@ #include "gstplay-marshal.h" #include "gstplaysink.h" #include "gstfactorylists.h" +#include "gstinputselector.h" #include "gstscreenshot.h" GST_DEBUG_CATEGORY_STATIC (gst_play_bin_debug); @@ -1955,7 +1956,10 @@ pad_added_cb (GstElement * decodebin, GstPad * pad, GstSourceGroup * group) if (select->selector == NULL && playbin->have_selector) { /* no selector, create one */ GST_DEBUG_OBJECT (playbin, "creating new selector"); - select->selector = gst_element_factory_make ("input-selector", NULL); + select->selector = g_object_new (GST_TYPE_INPUT_SELECTOR, NULL); + /* the above can't fail, but we keep the error handling around for when + * the selector plugin has moved to -base or -good and we stop using an + * internal copy of input-selector */ if (select->selector == NULL) { /* post the missing selector message only once */ playbin->have_selector = FALSE; @@ -2890,6 +2894,9 @@ gst_play_bin2_plugin_init (GstPlugin * plugin) { GST_DEBUG_CATEGORY_INIT (gst_play_bin_debug, "playbin2", 0, "play bin"); + g_type_class_ref (gst_input_selector_get_type ()); + g_type_class_ref (gst_selector_pad_get_type ()); + return gst_element_register (plugin, "playbin2", GST_RANK_NONE, GST_TYPE_PLAY_BIN); }