gst_plugins_base/gst/playback/gststreamselector.c
changeset 16 8e837d1bf446
parent 0 0e761a78d257
child 30 7e817e7e631c
equal deleted inserted replaced
15:4b0c6ed43234 16:8e837d1bf446
    26 
    26 
    27 #include <string.h>
    27 #include <string.h>
    28 
    28 
    29 #include "gststreamselector.h"
    29 #include "gststreamselector.h"
    30 
    30 
    31 #ifdef __SYMBIAN32__
       
    32 #include <glib_global.h>
       
    33 #endif
       
    34 
       
    35 GST_DEBUG_CATEGORY_STATIC (stream_selector_debug);
    31 GST_DEBUG_CATEGORY_STATIC (stream_selector_debug);
    36 #define GST_CAT_DEFAULT stream_selector_debug
    32 #define GST_CAT_DEFAULT stream_selector_debug
    37 
    33 
    38 static const GstElementDetails gst_stream_selector_details =
    34 static const GstElementDetails gst_stream_selector_details =
    39 GST_ELEMENT_DETAILS ("StreamSelector",
    35 GST_ELEMENT_DETAILS ("StreamSelector",
   145       0,
   141       0,
   146       (GInstanceInitFunc) gst_selector_pad_init,
   142       (GInstanceInitFunc) gst_selector_pad_init,
   147     };
   143     };
   148 
   144 
   149     selector_pad_type =
   145     selector_pad_type =
   150         g_type_register_static (GST_TYPE_PAD, "GstSelectorPad",
   146         g_type_register_static (GST_TYPE_PAD, "GstPlaybinSelectorPad",
   151         &selector_pad_info, 0);
   147         &selector_pad_info, 0);
   152   }
   148   }
   153   return selector_pad_type;
   149   return selector_pad_type;
   154 }
   150 }
   155 
   151 
   167       GST_DEBUG_FUNCPTR (gst_selector_pad_get_property);
   163       GST_DEBUG_FUNCPTR (gst_selector_pad_get_property);
   168 
   164 
   169   g_object_class_install_property (gobject_class, PROP_PAD_TAGS,
   165   g_object_class_install_property (gobject_class, PROP_PAD_TAGS,
   170       g_param_spec_boxed ("tags", "Tags",
   166       g_param_spec_boxed ("tags", "Tags",
   171           "The currently active tags on the pad", GST_TYPE_TAG_LIST,
   167           "The currently active tags on the pad", GST_TYPE_TAG_LIST,
   172           G_PARAM_READABLE));
   168           G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
   173 
   169 
   174   g_object_class_install_property (gobject_class, PROP_PAD_ACTIVE,
   170   g_object_class_install_property (gobject_class, PROP_PAD_ACTIVE,
   175       g_param_spec_boolean ("active", "Active",
   171       g_param_spec_boolean ("active", "Active",
   176           "If the pad is currently active", FALSE, G_PARAM_READABLE));
   172           "If the pad is currently active", FALSE,
       
   173           G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
   177 }
   174 }
   178 
   175 
   179 static void
   176 static void
   180 gst_selector_pad_init (GstSelectorPad * pad)
   177 gst_selector_pad_init (GstSelectorPad * pad)
   181 {
   178 {
   255 {
   252 {
   256   gboolean res = TRUE;
   253   gboolean res = TRUE;
   257   gboolean forward = TRUE;
   254   gboolean forward = TRUE;
   258   GstStreamSelector *sel;
   255   GstStreamSelector *sel;
   259   GstSelectorPad *selpad;
   256   GstSelectorPad *selpad;
       
   257   GstPad *active_sinkpad;
   260 
   258 
   261   sel = GST_STREAM_SELECTOR (gst_pad_get_parent (pad));
   259   sel = GST_STREAM_SELECTOR (gst_pad_get_parent (pad));
   262   selpad = GST_SELECTOR_PAD_CAST (pad);
   260   selpad = GST_SELECTOR_PAD_CAST (pad);
   263 
   261 
   264   /* only forward if we are dealing with the active sinkpad */
   262   /* only forward if we are dealing with the active sinkpad */
   265   forward = gst_stream_selector_is_active_sinkpad (sel, pad);
   263   active_sinkpad = gst_stream_selector_activate_sinkpad (sel, pad);
       
   264   forward = (active_sinkpad == pad);
   266 
   265 
   267   switch (GST_EVENT_TYPE (event)) {
   266   switch (GST_EVENT_TYPE (event)) {
   268     case GST_EVENT_FLUSH_STOP:
   267     case GST_EVENT_FLUSH_STOP:
   269       gst_selector_pad_reset (selpad);
   268       gst_selector_pad_reset (selpad);
   270       break;
   269       break;
   517   gobject_class->get_property =
   516   gobject_class->get_property =
   518       GST_DEBUG_FUNCPTR (gst_stream_selector_get_property);
   517       GST_DEBUG_FUNCPTR (gst_stream_selector_get_property);
   519 
   518 
   520   g_object_class_install_property (gobject_class, PROP_N_PADS,
   519   g_object_class_install_property (gobject_class, PROP_N_PADS,
   521       g_param_spec_uint ("n-pads", "Number of Pads",
   520       g_param_spec_uint ("n-pads", "Number of Pads",
   522           "The number of sink pads", 0, G_MAXUINT, 0, G_PARAM_READABLE));
   521           "The number of sink pads", 0, G_MAXUINT, 0,
       
   522           G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
   523   g_object_class_install_property (gobject_class, PROP_ACTIVE_PAD,
   523   g_object_class_install_property (gobject_class, PROP_ACTIVE_PAD,
   524       g_param_spec_object ("active-pad", "Active Pad",
   524       g_param_spec_object ("active-pad", "Active Pad",
   525           "The currently active sink pad", GST_TYPE_PAD, G_PARAM_READWRITE));
   525           "The currently active sink pad", GST_TYPE_PAD,
       
   526           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
   526 
   527 
   527   gstelement_class->request_new_pad = gst_stream_selector_request_new_pad;
   528   gstelement_class->request_new_pad = gst_stream_selector_request_new_pad;
   528   gstelement_class->release_pad = gst_stream_selector_release_pad;
   529   gstelement_class->release_pad = gst_stream_selector_release_pad;
   529 }
   530 }
   530 
   531