summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2014-10-02 03:40:18 +0200
committerChristian Pointner <equinox@spreadspace.org>2014-10-02 03:40:18 +0200
commita14bc47072eb9ed796c2ba2400a73c9c57e2f534 (patch)
treebf89e519a4d4f444063179c5dcbcd8e43e3ff3af /src
parenta fixed length for the filename is just fine! (diff)
added some names for bins
Diffstat (limited to 'src')
-rw-r--r--src/pipelines.c18
-rw-r--r--src/sydra.c2
-rw-r--r--src/utils.c7
-rw-r--r--src/utils.h2
4 files changed, 15 insertions, 14 deletions
diff --git a/src/pipelines.c b/src/pipelines.c
index 7434f0a..114a2c5 100644
--- a/src/pipelines.c
+++ b/src/pipelines.c
@@ -60,7 +60,7 @@ struct av_elements {
static GstElement* create_avsend_src(const char* desc, GstElement* pipeline)
{
- GstElement* src = sydra_create_bin_from_desc("AV source", desc, FALSE);
+ GstElement* src = sydra_create_bin_from_desc("AV source bin", desc, FALSE);
if(!src) return NULL;
gst_bin_add(GST_BIN(pipeline), src);
@@ -91,7 +91,7 @@ static gboolean create_avsend_elements(struct av_elements *ave, GstElement* pipe
GstElement *qr = sydra_create_element("queue", NULL);
char bin_name[32];
- snprintf(bin_name, sizeof(bin_name), "%s encoder", ave->name_);
+ snprintf(bin_name, sizeof(bin_name), "%s encoder bin", ave->name_);
ave->encdec_ = sydra_create_bin_from_desc(bin_name, ave->encdec_str_, TRUE);
ave->tee_enc_ = sydra_create_element("tee", NULL);
GstElement *qe = sydra_create_element("queue", NULL);
@@ -122,7 +122,7 @@ static gboolean create_avsend_elements(struct av_elements *ave, GstElement* pipe
static GstElement* create_avrecv_sink(const char* desc, GstElement* pipeline)
{
- GstElement* sink = sydra_create_bin_from_desc("AV sink", desc, FALSE);
+ GstElement* sink = sydra_create_bin_from_desc("AV sink bin", desc, FALSE);
if(!sink) return NULL;
gst_bin_add(GST_BIN(pipeline), sink);
@@ -153,7 +153,7 @@ static gboolean create_avrecv_elements(struct av_elements *ave, GstElement* pipe
GstElement *qr = sydra_create_element("queue", NULL);
char bin_name[32];
- snprintf(bin_name, sizeof(bin_name), "%s decoder", ave->name_);
+ snprintf(bin_name, sizeof(bin_name), "%s decoder bin", ave->name_);
ave->encdec_ = sydra_create_bin_from_desc(bin_name, ave->encdec_str_, TRUE);
ave->tee_enc_ = sydra_create_element("tee", NULL);
GstElement *qe = sydra_create_element("queue", NULL);
@@ -271,7 +271,7 @@ static gboolean create_udp_sources(options_t* opt, GstElement* pipeline, GstElem
static gboolean create_preview_elements(const char* preview_bin_desc, GstElement* pipeline, GstElement* tee)
{
GstElement *qr = sydra_create_element("queue", NULL);
- GstElement *preview_bin = sydra_create_bin_from_desc("preview sink", preview_bin_desc, TRUE);
+ GstElement *preview_bin = sydra_create_bin_from_desc("preview sink bin", preview_bin_desc, TRUE);
if(!qr || !preview_bin) {
return FALSE;
@@ -303,13 +303,13 @@ static gboolean create_recorder_elements(options_t* opt, GstElement* pipeline, s
GstElement *ev = NULL, *tv = ve->tee_enc_;
if(opt->video_enc_rec_) {
- ev = sydra_create_bin_from_desc("record video encoder", opt->video_enc_rec_, TRUE);
+ ev = sydra_create_bin_from_desc("record video encoder bin", opt->video_enc_rec_, TRUE);
if(!ev) return FALSE;
tv = ve->tee_raw_;
}
GstElement *ea = NULL, *ta = ae->tee_enc_;
if(opt->audio_enc_rec_) {
- ea = sydra_create_bin_from_desc("record audio encoder", opt->audio_enc_rec_, TRUE);
+ ea = sydra_create_bin_from_desc("record audio encoder bin", opt->audio_enc_rec_, TRUE);
if(!ea) return FALSE;
ta = ae->tee_raw_;
}
@@ -353,7 +353,7 @@ static gboolean create_recorder_elements(options_t* opt, GstElement* pipeline, s
GstElement* create_sender_pipeline(options_t* opt, struct udp_sinks *udp)
{
- GstElement *pipeline = gst_pipeline_new ("sydra");
+ GstElement *pipeline = gst_pipeline_new ("sydra-sender");
if(!pipeline) {
log_printf(ERROR, "Creating pipeline failed!");
return NULL;
@@ -434,7 +434,7 @@ static void rtpbin_pad_added(GstElement* rtp, GstPad* pad, gpointer user_data)
GstElement* create_receiver_pipeline(options_t* opt, struct udp_sources *udp)
{
- GstElement *pipeline = gst_pipeline_new ("sydra");
+ GstElement *pipeline = gst_pipeline_new ("sydra-receiver");
if(!pipeline) {
log_printf(ERROR, "Creating pipeline failed!");
return NULL;
diff --git a/src/sydra.c b/src/sydra.c
index ec8d805..70b9e56 100644
--- a/src/sydra.c
+++ b/src/sydra.c
@@ -173,7 +173,7 @@ int main_loop(options_t* opt)
GstElement *pipeline = opt->mode_ == SENDER ? create_sender_pipeline(opt, &sinks) :
create_receiver_pipeline(opt, &sources);
if(!pipeline) {
- log_printf(ERROR, "creating pipeline failed");
+ log_printf(ERROR, "creating pipeline failed - exitting");
return -1;
}
diff --git a/src/utils.c b/src/utils.c
index b1bcee3..abeb595 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -51,19 +51,20 @@ gint cmp_udp_client(gconstpointer A, gconstpointer B)
return strncmp(a->host_.addr_, b->host_.addr_, sizeof(a->host_.addr_));
}
-GstElement* sydra_create_bin_from_desc(const char* type, const char* desc, gboolean ghost_unlinked_pads)
+GstElement* sydra_create_bin_from_desc(const char* name, const char* desc, gboolean ghost_unlinked_pads)
{
GError *error = NULL;
GstElement *bin = gst_parse_bin_from_description(desc, ghost_unlinked_pads, &error);
if(!bin) {
- log_printf(ERROR, "Bin description for %s parser error: %s", type, error ? error->message : "unknown");
+ log_printf(ERROR, "Bin description for %s parser error: %s", name, error ? error->message : "unknown");
g_error_free(error);
return NULL;
}
if(error) {
- log_printf(WARNING, "Bin description for %s parser warning: %s", type, error ? error->message : "unknown");
+ log_printf(WARNING, "Bin description for %s parser warning: %s", name, error ? error->message : "unknown");
g_error_free(error);
}
+ gst_element_set_name(bin, name);
return bin;
}
diff --git a/src/utils.h b/src/utils.h
index 8bd2c42..97c497f 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -39,7 +39,7 @@
#include <gst/gst.h>
gint cmp_udp_client(gconstpointer A, gconstpointer B);
-GstElement* sydra_create_bin_from_desc(const char* type, const char* desc, gboolean ghost_unlinked_pads);
+GstElement* sydra_create_bin_from_desc(const char* name, const char* desc, gboolean ghost_unlinked_pads);
GstElement* sydra_create_element(const char* type, const char* name);
gboolean sydra_link_request_static(GstElement* src, const char* src_pad_name, GstElement* sink, const char* sink_pad_name);
gboolean sydra_link_static_request(GstElement* src, const char* src_pad_name, GstElement* sink, const char* sink_pad_name);