Advertisement
Guest User

Untitled

a guest
May 27th, 2023
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1.  
  2. point->pipeline = gst_pipeline_new( "nullptr");
  3. point->src = gst_element_factory_make ("rtspsrc", nullptr);
  4. g_object_set (G_OBJECT (point->src), "latency", 1000, NULL);
  5. g_object_set (G_OBJECT (point->src), "do-retransmission", FALSE, NULL);
  6. g_object_set (G_OBJECT (point->src), "protocols", 4, NULL);
  7. point->decode = gst_element_factory_make ("decodebin", nullptr);
  8. point->convert = gst_element_factory_make ("d3d11colorconvert", nullptr);
  9. point->upload = gst_element_factory_make ("d3d11upload", nullptr);
  10. point->download = gst_element_factory_make("d3d11download", nullptr);
  11. point->sink = gst_element_factory_make("glsinkbin", nullptr);
  12. g_object_set (G_OBJECT (point->sink), "force-aspect-ratio", TRUE, NULL);
  13. g_object_set (G_OBJECT (point->sink), "throttle-time", 1000, NULL);
  14. GstElement *fakesink = gst_element_factory_make("fakesink", nullptr);
  15. point->bus = gst_pipeline_get_bus(GST_PIPELINE(point->pipeline));
  16.  
  17. g_object_set(point->sink, "sink", fakesink, nullptr);
  18. g_object_set (G_OBJECT (point->sink), "sync", FALSE, NULL);
  19. g_object_set (G_OBJECT (point->sink), "async", TRUE, NULL);
  20. GstPad *sinkPad = gst_element_get_static_pad(point->sink, "sink");
  21. GstCaps *caps = gst_caps_from_string("video/x-raw(memory:GLMemory), format=RGBA");
  22. gst_pad_set_caps(sinkPad, caps);
  23. gst_caps_unref(caps);
  24. gst_bin_add_many(GST_BIN(point->pipeline), point->src, point->decode, point->upload, point->convert ,point->download,/*gload,*/ point->sink, nullptr);
  25.  
  26. if (!gst_element_link( point->upload, point->convert))
  27. qDebug() << "Linking GStreamer pipeline elements failed 1";
  28. if (!gst_element_link( point->convert, point->download))
  29. qDebug() << "Linking GStreamer pipeline elements failed 2";
  30. if (!gst_element_link( point->download, /*gload,*/ point->sink))
  31. qDebug() << "Linking GStreamer pipeline elements failed";
  32. qDebug() << "finish" <<item->camera()->name();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement