handle events / override event handling in appsrc

Cigarah cigarah at gmail.com
Mon Dec 23 22:13:55 PST 2013


I wish to make changes in gstappsrc.c and handle some of the events at appsrc
level and then post it downstream. There is no event handler at appsrc
level! The events that I post to the pipeline or appsrc, I can see logs
getting printed from the below code in gstbasesrc.c

static gboolean *gst_base_src_send_event* (GstElement * element, GstEvent *
event)
{
  GstBaseSrc *src;
  gboolean result = FALSE;

  src = GST_BASE_SRC (element);

  GST_DEBUG_OBJECT (src, "handling event %p %" GST_PTR_FORMAT, event,
event);

  switch (GST_EVENT_TYPE (event)) {
      /* bidirectional events */
    case GST_EVENT_FLUSH_START:
          break;
    case GST_EVENT_FLUSH_STOP:
...
   }
}

So, I tried to override or handle events the following way in gstappsrc.c
static void *gst_app_src_class_init *(GstAppSrcClass * klass)
{
  GstElementClass *gstelement_class= (GstElementClass *) klass;
  ...
  gstelement_class->send_event = GST_DEBUG_FUNCPTR(gst_app_src_send_event);
}


static gboolean *gst_app_src_send_event* (GstElement * element, GstEvent *
event)
{
  GstBaseSrc *src;
    src = GST_BASE_SRC (element);
  
  GST_DEBUG_OBJECT (src, "handling event %p %" GST_PTR_FORMAT, event,
event);

  switch (GST_EVENT_TYPE (event)) {
      /* bidirectional events */
    case GST_EVENT_FLUSH_START:
    case GST_EVENT_FLUSH_STOP:
         gst_pad_push_event (src->srcpad, event);
  ...
 }



But, I can still see the logs printed from gstbasesrc file. Can anyone
please help why the /send_event /function from/ appsrc/ is not getting
called, instead the /send_event/ from/ basesrc /is getting called?


    





--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/handle-events-override-event-handling-in-appsrc-tp4664245.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list