c - Why are seek events failing with my GStreamer app? -


this seeking function:

gboolean seek(customdata* data) {     gint64 position;     gstformat format = gst_format_time;     gstevent *seek_event;      /* obtain current position, needed seek event */     if (!gst_element_query_position(data->pipeline, &format, &position))     {         g_printerr("unable retrieve current position.\n");         return false;     }      /* create seek event */     if (data->rate > 0)     {         seek_event = gst_event_new_seek(data->rate, gst_format_time, gst_seek_flag_flush | gst_seek_flag_accurate, gst_seek_type_set,                 position, gst_seek_type_none, 0);     }     else if (data->rate < 0)     {         seek_event = gst_event_new_seek(data->rate, gst_format_time, gst_seek_flag_flush | gst_seek_flag_accurate, gst_seek_type_set, 0,                 gst_seek_type_set, position);     }     else     {         g_printerr("rate set 0.\n");         return false;     }      /* check seek_event created */     if (seek_event == null) {         g_printerr("could not create seek event.\n");         return false;     }      /* send event */     if (!gst_element_send_event(data->autovideosink, seek_event))     {         g_printerr("could not perform seek event.\n");         return false;     }      g_print("current rate: %gx\n", data->rate);      return true; } 

but fails @ sending seek event. code pertty modified gstreamer tutorials, i'm playing .vob file , have custom pipeline instead of playbin2. i'm using appsrc i'm feeding buffers file, don't imagine cause problems fast forwarding. however, can't seek either forward or backward (setting rate 2x or .5x fails @ same spot).

i have same problem , i've found on debug output:

0:00:49.048266933  4480   03b05000 debug                basesrc gstbasesrc.c:1972:gst_base_src_default_event:<app_source> not seekable 0:00:49.048386221  4480   03b05000 debug                basesrc gstbasesrc.c:2000:gst_base_src_event:<app_source> subclass refused event 0:00:49.048515238  4480   03b05000 debug               gst_pads gstpad.c:5050:gst_pad_send_event_unchecked:<app_source:src> sent event, ret error 

it looks appsrc element not support seeking or event sending upstream instead downstream.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -