mirror of
https://bitbucket.org/ohhara/ohmulticastvideoscanner.git
synced 2025-06-07 16:06:11 +00:00
Add videoconvert and link it with pngenc plugin.
In the case of pngenc can't recognize the video format.
This commit is contained in:
parent
4ebf609062
commit
22de3de619
15
omvs_gst.c
15
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user