handle events / override event handling in appsrc
Cigarah
cigarah at gmail.com
Wed Dec 25 23:25:00 PST 2013
/Can you provide the complete changed code of appsrc that you're using
here/,
I have already given the exact code that I am using. I shall explain it. I
have added the following in appsrc code
... a function declaration
static gboolean gst_app_src_send_event (GstElement * element, GstEvent *
event) ;
... it's definition
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);
}
return TRUE;
}
... below two lines in gst_app_src_class_init ()
GstElementClass *gstelement_class= (GstElementClass *) klass;
...
gstelement_class->send_event = GST_DEBUG_FUNCPTR(gst_app_src_send_event);
Rest all appsrc code is same.
/and are you sure you're using the appsrc built from that in your
application? /
Yes, I can see the logs getting printed
/Also what's your use case for intercepting the events or handling them
in a custom way. /
Use case ...
Handle some events inside appsrc.c as have to pass them downstream only for
appsrc (and also do something else from inside appsrc for these events).
/Maybe there's a better way to do what you want./
Yes, I am sure there's a proper way to do it. That's why I asked on devel
list.
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/handle-events-override-event-handling-in-appsrc-tp4664245p4664277.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list