Skip to content

Commit

Permalink
Merge pull request #6 from AMWA-TV/jf/dev/gstreamer_remove_element_names
Browse files Browse the repository at this point in the history
Remove GStreamer element name to allow different pipelines
  • Loading branch information
joaofigueiredobisect authored Sep 17, 2024
2 parents 7831b66 + a2f6503 commit 0825389
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ struct gst_st2110_20_receiver_impl : gst_receiver_plugin_t
maybe_ok create_gstreamer_pipeline()
{
// Create pipeline and check if all elements are created successfully
BST_CHECK_ASSIGN(pipeline_, bisect::gst::pipeline::create("receiver_pipeline"));
BST_CHECK_ASSIGN(pipeline_, bisect::gst::pipeline::create(NULL));
auto* pipeline = pipeline_.get();

// Add pipeline udp source
auto* source = gst_element_factory_make("udpsrc", "source");
auto* source = gst_element_factory_make("udpsrc", NULL);
BST_ENFORCE(source != nullptr, "Failed creating GStreamer element udpsrc");
BST_ENFORCE(gst_bin_add(GST_BIN(pipeline), source), "Failed adding udpsrc to the pipeline");
// Set udp source params
Expand All @@ -53,27 +53,27 @@ struct gst_st2110_20_receiver_impl : gst_receiver_plugin_t
g_object_set(G_OBJECT(source), "caps", caps, NULL);

// Add pipeline rtpjitterbuffer
auto* jitter_buffer = gst_element_factory_make("rtpjitterbuffer", "jitter_buffer");
auto* jitter_buffer = gst_element_factory_make("rtpjitterbuffer", NULL);
BST_ENFORCE(jitter_buffer != nullptr, "Failed creating GStreamer element jitter_buffer");
BST_ENFORCE(gst_bin_add(GST_BIN(pipeline), jitter_buffer), "Failed adding jitter_buffer to the pipeline");

// Add pipeline queue1
auto* queue1 = gst_element_factory_make("queue", "queue1");
auto* queue1 = gst_element_factory_make("queue", NULL);
BST_ENFORCE(queue1 != nullptr, "Failed creating GStreamer element queue");
BST_ENFORCE(gst_bin_add(GST_BIN(pipeline), queue1), "Failed adding queue to the pipeline");

// Add pipeline rtp depay
auto* depay = gst_element_factory_make("rtpvrawdepay", "rtp_raw_depay");
auto* depay = gst_element_factory_make("rtpvrawdepay", NULL);
BST_ENFORCE(depay != nullptr, "Failed creating GStreamer element depay");
BST_ENFORCE(gst_bin_add(GST_BIN(pipeline), depay), "Failed adding depay to the pipeline");

// Add pipeline videoconvert
auto* videoconvert = gst_element_factory_make("videoconvert", "converter");
auto* videoconvert = gst_element_factory_make("videoconvert", NULL);
BST_ENFORCE(videoconvert != nullptr, "Failed creating GStreamer element converter");
BST_ENFORCE(gst_bin_add(GST_BIN(pipeline), videoconvert), "Failed adding converter to the pipeline");

// Add pipeline video sink
auto* sink = gst_element_factory_make("autovideosink", "sink");
auto* sink = gst_element_factory_make("autovideosink", NULL);
BST_ENFORCE(sink != nullptr, "Failed creating GStreamer element sink");
BST_ENFORCE(gst_bin_add(GST_BIN(pipeline), sink), "Failed adding sink to the pipeline");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ struct gst_st2110_20_sender_impl : gst_sender_plugin_t
maybe_ok create_gstreamer_pipeline(int pattern)
{
// Create pipeline and check if all elements are created successfully
BST_CHECK_ASSIGN(pipeline_, bisect::gst::pipeline::create("sender_pipeline"));
BST_CHECK_ASSIGN(pipeline_, bisect::gst::pipeline::create(NULL));
auto* pipeline = pipeline_.get();

// Add pipeline videotestsrc
auto* source = gst_element_factory_make("videotestsrc", "source");
auto* source = gst_element_factory_make("videotestsrc", NULL);
BST_ENFORCE(source != nullptr, "Failed creating GStreamer element videotestsrc");
g_object_set(G_OBJECT(source), "pattern", pattern, NULL);
BST_ENFORCE(gst_bin_add(GST_BIN(pipeline), source), "Failed adding videotestsrc to the pipeline");

// Add pipeline capsfilter
auto* capsfilter = gst_element_factory_make("capsfilter", "capsfilter");
auto* capsfilter = gst_element_factory_make("capsfilter", NULL);
BST_ENFORCE(capsfilter != nullptr, "Failed creating capsfilter");

// Create caps for capsfilter
Expand All @@ -56,22 +56,22 @@ struct gst_st2110_20_sender_impl : gst_sender_plugin_t
gst_caps_unref(caps);

// Add pipeline queue1
auto* queue1 = gst_element_factory_make("queue", "queue1");
auto* queue1 = gst_element_factory_make("queue", NULL);
BST_ENFORCE(queue1 != nullptr, "Failed creating GStreamer element queue");
BST_ENFORCE(gst_bin_add(GST_BIN(pipeline), queue1), "Failed adding queue to the pipeline");

// Add pipeline rtpvrawpay
auto* rtpvrawpay = gst_element_factory_make("rtpvrawpay", "rtpvrawpay");
auto* rtpvrawpay = gst_element_factory_make("rtpvrawpay", NULL);
BST_ENFORCE(rtpvrawpay != nullptr, "Failed creating GStreamer element rtpvrawpay");
BST_ENFORCE(gst_bin_add(GST_BIN(pipeline), rtpvrawpay), "Failed adding rtpvrawpay to the pipeline");

// Add pipeline queue2
auto* queue2 = gst_element_factory_make("queue", "queue2");
auto* queue2 = gst_element_factory_make("queue", NULL);
BST_ENFORCE(queue2 != nullptr, "Failed creating GStreamer element queue");
BST_ENFORCE(gst_bin_add(GST_BIN(pipeline), queue2), "Failed adding queue to the pipeline");

// Add pipeline udpsink
auto* udpsink = gst_element_factory_make("udpsink", "udpsink");
auto* udpsink = gst_element_factory_make("udpsink", NULL);
BST_ENFORCE(udpsink != nullptr, "Failed creating GStreamer element udpsink");
// Set properties
g_object_set(G_OBJECT(udpsink), "host", s_.primary.destination_ip_address.c_str(), NULL);
Expand Down

0 comments on commit 0825389

Please sign in to comment.