Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- point->pipeline = gst_pipeline_new( "nullptr");
- point->src = gst_element_factory_make ("rtspsrc", nullptr);
- g_object_set (G_OBJECT (point->src), "latency", 1000, NULL);
- g_object_set (G_OBJECT (point->src), "do-retransmission", FALSE, NULL);
- g_object_set (G_OBJECT (point->src), "protocols", 4, NULL);
- point->decode = gst_element_factory_make ("decodebin", nullptr);
- point->convert = gst_element_factory_make ("d3d11colorconvert", nullptr);
- point->upload = gst_element_factory_make ("d3d11upload", nullptr);
- point->download = gst_element_factory_make("d3d11download", nullptr);
- point->sink = gst_element_factory_make("glsinkbin", nullptr);
- g_object_set (G_OBJECT (point->sink), "force-aspect-ratio", TRUE, NULL);
- g_object_set (G_OBJECT (point->sink), "throttle-time", 1000, NULL);
- GstElement *fakesink = gst_element_factory_make("fakesink", nullptr);
- point->bus = gst_pipeline_get_bus(GST_PIPELINE(point->pipeline));
- g_object_set(point->sink, "sink", fakesink, nullptr);
- g_object_set (G_OBJECT (point->sink), "sync", FALSE, NULL);
- g_object_set (G_OBJECT (point->sink), "async", TRUE, NULL);
- GstPad *sinkPad = gst_element_get_static_pad(point->sink, "sink");
- GstCaps *caps = gst_caps_from_string("video/x-raw(memory:GLMemory), format=RGBA");
- gst_pad_set_caps(sinkPad, caps);
- gst_caps_unref(caps);
- gst_bin_add_many(GST_BIN(point->pipeline), point->src, point->decode, point->upload, point->convert ,point->download,/*gload,*/ point->sink, nullptr);
- if (!gst_element_link( point->upload, point->convert))
- qDebug() << "Linking GStreamer pipeline elements failed 1";
- if (!gst_element_link( point->convert, point->download))
- qDebug() << "Linking GStreamer pipeline elements failed 2";
- if (!gst_element_link( point->download, /*gload,*/ point->sink))
- qDebug() << "Linking GStreamer pipeline elements failed";
- qDebug() << "finish" <<item->camera()->name();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement