diff --git a/omvs_gst.c b/omvs_gst.c index ab1d88f..9c63fb8 100644 --- a/omvs_gst.c +++ b/omvs_gst.c @@ -28,28 +28,31 @@ typedef struct _OMVSGstImpl { OMVSGst omvs_gst_open(const gchar *uri, const gchar *filename) { OMVSGstImpl *gst_impl; GstElement *play; + GstElement *conv; GstElement *png; GstElement *file; - GstElement *pngfile; + GstElement *convpngfile; GstPad *pad; GstPad *ghostpad; gst_impl = g_malloc0(sizeof(OMVSGstImpl)); gst_impl->play = play = gst_element_factory_make("playbin", "play"); g_object_set(G_OBJECT(play), "uri", uri, NULL); + conv = gst_element_factory_make("queue", "conv"); png = gst_element_factory_make("pngenc", "png"); g_object_set(G_OBJECT(png), "snapshot", 1, NULL); file = gst_element_factory_make("multifilesink", "file"); g_object_set(G_OBJECT(file), "max-files", 1, "location", filename, NULL); - pngfile = gst_bin_new("pngfile"); - gst_bin_add_many(GST_BIN(pngfile), png, file, NULL); - pad = gst_element_get_static_pad(png, "sink"); + convpngfile = gst_bin_new("convpngfile"); + gst_bin_add_many(GST_BIN(convpngfile), conv, png, file, NULL); + gst_element_link_many(conv, png, file, NULL); + pad = gst_element_get_static_pad(conv, "sink"); ghostpad = gst_ghost_pad_new("sink", pad); - gst_element_add_pad(pngfile, ghostpad); + gst_element_add_pad(convpngfile, ghostpad); gst_object_unref(GST_OBJECT(pad)); - g_object_set(play, "video-sink", pngfile, NULL); + g_object_set(play, "video-sink", convpngfile, NULL); g_object_set(play, "mute", TRUE, NULL); gst_element_set_state(play, GST_STATE_PLAYING);