Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2011
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.93 KB | None | 0 0
  1. gboolean frame_stepping (GstEngine * engine, gboolean foward)
  2. {
  3.   GstFormat fmt = GST_FORMAT_BUFFERS;
  4.   gint64 pos;
  5.   gboolean ok;
  6.   g_print ("frame_steeping\n");
  7.  
  8.   if (!foward)
  9.   {
  10.     fmt = GST_FORMAT_TIME;
  11.     ok = gst_element_query_position (engine->player, &fmt, &pos);
  12.     ok = gst_element_seek (engine->player, -1.0, fmt, GST_SEEK_FLAG_FLUSH,
  13.         GST_SEEK_TYPE_SET, pos, GST_SEEK_TYPE_NONE, pos);
  14.     fmt = GST_FORMAT_BUFFERS;
  15.     // g_print ("position: %ld\n", pos);
  16.   }
  17.  
  18.   gst_element_send_event (engine->player,
  19.       gst_event_new_step (fmt, 1, 1.0, TRUE, FALSE));
  20.  
  21.   if (!foward)
  22.   {
  23.     fmt = GST_FORMAT_TIME;
  24.     ok = gst_element_query_position (engine->player, &fmt, &pos);
  25.     ok = gst_element_seek (engine->player, 1.0, fmt, GST_SEEK_FLAG_FLUSH,
  26.         GST_SEEK_TYPE_SET, pos, GST_SEEK_TYPE_NONE, pos);
  27.     fmt = GST_FORMAT_BUFFERS;
  28.     // g_print ("position: %ld\n", pos);
  29.   }
  30.  
  31.   return FALSE;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement