On Thu, 2009-08-06 at 12:40 +0100, Jianchun Zhou wrote:
> Hi, all:

Hi,

> I got a problem about ClutterMedia, after creating a
> ClutterGstVideoTexture object "tex",  I want to use
> clutter_media_set_progress to let it show a specified frame of this
> video file, I do it this way:
> 
> 
> ClutterActor *tex = clutter_gst_video_texture_new();
> clutter_media_set_filename(CLUTTER_MEDIA(tex), argv[1]);
> clutter_media_set_progress(CLUTTER_MEDIA(tex), 0.6);
> 
> But when the application window comes out, it also shows the first
> frame of the video file.
> 
> Any body any idea why?

I'm not sure to understand what you mean and want, still what is sure is
that setting the progress before the video is actually being played does
not currently work as the we have know the duration of the video to seek
at the right position (at 0.6 * duration in your case).

As a quick & dirty workaround you can listen the the notify::duration
signal and set the progress there, something along these lines (you may
want to disconnect it after use):

static void
on_duration_changed (GObject      *object,
                     GParamSpec   *pspec,
                     VideoApp     *app)
{
  ClutterMedia *video_texture = CLUTTER_MEDIA (object);
  clutter_media_set_progress (video_texture, 0.6);
}
[...]
g_signal_connect (app->vtexture,
                  "notify::duration", G_CALLBACK (on_duration_changed),
                  app);

I guess we could save the set_progress() issued before knowing the
duration inside clutter-gst itself and do that automatically. I'll look
at it with the review of ClutterGstVideoTexture I'm currently doing.

-- 
Damien


 

-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com

Reply via email to