[gst-devel] how to make a files playable...

Stefan Kost ensonic at hora-obscura.de
Thu Jul 8 10:55:51 CEST 2010


On 06.07.2010 13:15, paper at gmx.net wrote:
> I have follow function to change the pad of a output-selector.
>
> (PIPELINE: VIDEOTESTSRC -> TIMEOVERLAY -> x264enc -> output-selector -> mp4mux -> filesink / mp4mux -> filesink )
>
> but files does not have metadata, just the first one, what is wrong?
>   

This is really a kind of special case. You could add a pad-probe on
output-selector sink-pad and ref the tag-event. Then you can resend it
whenever switching pads. It might be a good idea to actualy add this to
output-selector (add a "resend-tags" property, that is by-.default off.
Could you file a bug for it? Should not be difficult to be added.

Stefan
> paused state i tried allready...
>
> static gboolean
> switch_cb (gpointer user_data)
> {
>     GstElement *sel = GST_ELEMENT (user_data);
>     GstPad *old_pad, *new_pad = NULL;
>
>     g_object_get (G_OBJECT (sel), "active-pad", &old_pad, NULL);
>
>    char buffer[800];
>
>    sprintf (buffer,file_path_prefix,fr_counter++);
>
>
>     if (old_pad == osel_src1){
>         new_pad = osel_src2;
>         gst_element_set_state (mux0, GST_STATE_NULL);
>         gst_element_set_state (fsink0, GST_STATE_NULL);
>         g_object_set (G_OBJECT (fsink0), "location", &buffer[0], NULL);
>         gst_element_set_state (mux0, GST_STATE_PLAYING);
>         gst_element_set_state (fsink0, GST_STATE_PLAYING);
>     }else{
>         new_pad = osel_src1;
>         gst_element_set_state (mux1, GST_STATE_NULL);
>         gst_element_set_state (fsink1, GST_STATE_NULL);
>         g_object_set (G_OBJECT (fsink1), "location", &buffer[0], NULL);
>         gst_element_set_state (mux1, GST_STATE_PLAYING);
>        gst_element_set_state (fsink1, GST_STATE_PLAYING);
>     }
>     g_object_set (G_OBJECT (sel), "active-pad", new_pad, NULL);
>
>     g_print ("switched from %s:%s to %s:%s\n", GST_DEBUG_PAD_NAME (old_pad),
>              GST_DEBUG_PAD_NAME (new_pad));
>
>     gst_object_unref (old_pad);
>
>     return TRUE;
>
> }
>
>   





More information about the gstreamer-devel mailing list