Push Mode fast rewind of mp4 file

Chetan chetanrp.sjce at gmail.com
Thu Oct 10 04:17:28 CEST 2013


Hello All,

I am trying to implement the fast rewind scenario in qtdemux in push mode. I
am using a gstreamer application to perform fast forward and fast rewind in
both local mp4 files and also streaming mp4 files. FF and FR work fine for
local playback(Pull mode) but only FF works for streaming playback(Push
mode).

As I can see in the qtdemux.c file of gst-plugins-good, playback rates less
than 0 are categorized as unsupported in the function
"gst_qtdemux_do_push_seek"

Following is the portion of code in my gstreamer application which performs
FF and FR.

typedef struct _CustomData {
  GstElement *pipeline;
  GstElement *video_sink;
  GMainLoop *loop;
   
  gboolean playing;  /* Playing or Paused */
  gdouble rate;      /* Current playback rate (can be negative) */
} CustomData;
   
/* Send seek event to change rate */
static void send_seek_event (CustomData *data) {
  gint64 position;
  GstFormat format = GST_FORMAT_TIME;
  GstEvent *seek_event;
   
  /* Obtain the current position, needed for the seek event */
  if (!gst_element_query_position (data->pipeline, &format, &position)) {
    return;
  }
   
  /* Create the 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 {
    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);
  }
   
  if (data->video_sink == NULL) {
    /* If we have not done so, obtain the sink through which we will send
the seek events */
    g_object_get (data->pipeline, "video-sink", &data->video_sink, NULL);
  }
   
  /* Send the event */
  gst_element_send_event (data->video_sink, seek_event);

}


Any help appreciated.



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Push-Mode-fast-rewind-of-mp4-file-tp4662492.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list