summaryrefslogtreecommitdiff
path: root/src/options.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2014-10-02 00:24:31 +0200
committerChristian Pointner <equinox@spreadspace.org>2014-10-02 00:24:31 +0200
commit9f2b989e2dd9c8e50a8b3accb2f5afdee045b89e (patch)
treea909466325338948933a732c83d015b4ce13b337 /src/options.c
parentsydra create bin now lets the caller control wheter to create ghost pads or not (diff)
source and sink are now same bin for video and audio
Diffstat (limited to 'src/options.c')
-rw-r--r--src/options.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/src/options.c b/src/options.c
index 532039b..c9d1af3 100644
--- a/src/options.c
+++ b/src/options.c
@@ -61,21 +61,22 @@ static void options_defaults(options_t* opt)
opt->appname_ = NULL;
opt->mode_ = SENDER;
- opt->video_src_ = g_strdup("v4l2src ! videoconvert ! videoscale ! video/x-raw,format=I420,width=864,height=480,framerate=25/1,pixel-aspect-ratio=1/1 ! identity");
+ opt->source_ = g_strdup("v4l2src ! videoconvert ! videoscale ! video/x-raw,format=I420,width=864,height=480,framerate=25/1,pixel-aspect-ratio=1/1 ! identity name=\"videosrc\" " \
+ "autoaudiosrc ! audio/x-raw,format=S16LE,channels=1,rate=48000 ! identity name=\"audiosrc\"");
+ opt->sink_ = g_strdup("videoconvert name=\"videosink\" ! videoscale add-borders=true ! xvimagesink " \
+ "audioconvert name=\"audiosink\" ! autoaudiosink");
+
opt->video_enc_ = g_strdup("vp8enc keyframe-max-dist=25 error-resilient=2 end-usage=1 target-bitrate=1200000 cpu-used=4 deadline=1000000 threads=2");
opt->video_payloader_ = g_strdup("rtpvp8pay");
opt->video_caps_ = g_strdup("application/x-rtp,media=video,clock-rate=90000,encoding-name=VP8-DRAFT-IETF-01,caps=\"video/x-vp8\"");
opt->video_depayloader_ = g_strdup("rtpvp8depay");
opt->video_dec_ = g_strdup("vp8dec");
- opt->video_sink_ = g_strdup("videoconvert ! videoscale add-borders=true ! xvimagesink");
- opt->audio_src_ = g_strdup("autoaudiosrc ! audio/x-raw,format=S16LE,channels=1,rate=48000 ! identity");
opt->audio_enc_ = g_strdup("opusenc bitrate=64000 cbr=true packet-loss-percentage=0 inband-fec=false");
opt->audio_payloader_ = g_strdup("rtpopuspay");
opt->audio_caps_ = g_strdup("application/x-rtp,media=audio,clock-rate=48000,payload=96,encoding-name=X-GST-OPUS-DRAFT-SPITTKA-00,caps=\"audio/x-opus\"");
opt->audio_depayloader_ = g_strdup("rtpopusdepay");
opt->audio_dec_ = g_strdup("opusdec");
- opt->audio_sink_ = g_strdup("audioconvert ! autoaudiosink");
opt->rtp_host_ = NULL;
opt->rtp_port_base_ = 5000;
@@ -104,16 +105,14 @@ static GQuark options_error_quark()
static GOptionGroup* options_get_avsend_group(options_t* opt)
{
GOptionEntry avsend_entries[] = {
- { "video-source", 0, 0, G_OPTION_ARG_STRING, &opt->video_src_,
- "pipeline for raw video (i.e. videotestsrc)", "BIN DESCRIPTION" },
+ { "source", 0, 0, G_OPTION_ARG_STRING, &opt->source_,
+ "pipeline for raw video and audio", "BIN DESCRIPTION" },
{ "video-encoder", 0, 0, G_OPTION_ARG_STRING, &opt->video_enc_,
"pipeline for video encoder (i.e. videoconvert ! vp8enc)", "BIN DESCRIPTION" },
{ "video-payloader", 0, 0, G_OPTION_ARG_STRING, &opt->video_payloader_,
"video RTP payloader element (i.e. rtpvp8pay)", "ELEMENT" },
{ "previewsink", 0, 0, G_OPTION_ARG_STRING, &opt->preview_videosink_,
"video sink element for local preview (i.e. textoverlay text=\" preview \" ! xvimagesink) - leave empty to disable preview", "BIN DESCRIPTION" },
- { "audio-source", 0, 0, G_OPTION_ARG_STRING, &opt->audio_src_,
- "pipeline for raw audio (i.e. audiotestsrc)", "BIN DESCRIPTION" },
{ "audio-encoder", 0, 0, G_OPTION_ARG_STRING, &opt->audio_enc_,
"pipeline for audio encoder (i.e. audioconvert ! opusenc)", "BIN DESCRIPTION" },
{ "audio-payloader", 0, 0, G_OPTION_ARG_STRING, &opt->audio_payloader_,
@@ -137,16 +136,14 @@ static GOptionGroup* options_get_avrecv_group(options_t* opt)
"video RTP depayloader element (i.e. rtpvp8depay)", "ELEMENT" },
{ "video-decoder", 0, 0, G_OPTION_ARG_STRING, &opt->video_dec_,
"pipeline for video decoder (i.e. vp8dec)", "BIN DESCRIPTION" },
- { "video-sink", 0, 0, G_OPTION_ARG_STRING, &opt->video_sink_,
- "video sink element (i.e. videoconvert ! xvimagesink)", "BIN DESCRIPTION" },
{ "audio-caps", 0, 0, G_OPTION_ARG_STRING, &opt->audio_caps_,
"Caps for incoming Audio RTP packets", "CAPS" },
{ "audio-depayloader", 0, 0, G_OPTION_ARG_STRING, &opt->audio_depayloader_,
"audio RTP depayloader element (i.e. rtpopusdepay)", "ELEMENT" },
{ "audio-decoder", 0, 0, G_OPTION_ARG_STRING, &opt->audio_dec_,
"pipeline for audio decoder (i.e. opusdnc)", "BIN DESCRIPTION" },
- { "audio-sink", 0, 0, G_OPTION_ARG_STRING, &opt->audio_sink_,
- "audio sink element (i.e. audioconvert ! autoaudiosink)", "BIN DESCRIPTION" },
+ { "sink", 0, 0, G_OPTION_ARG_STRING, &opt->sink_,
+ "video/audio sink element", "BIN DESCRIPTION" },
{ NULL }
};
GOptionGroup* avrecv_group = g_option_group_new ("avrecv", "Audio/Video Receiver Options",
@@ -342,20 +339,18 @@ void options_clear(options_t* opt)
g_free(opt->pid_file_);
g_strfreev(opt->log_targets_);
g_free(opt->appname_);
- g_free(opt->video_src_);
+ g_free(opt->source_);
+ g_free(opt->sink_);
g_free(opt->video_enc_);
g_free(opt->video_payloader_);
g_free(opt->video_caps_);
g_free(opt->video_depayloader_);
g_free(opt->video_dec_);
- g_free(opt->video_sink_);
- g_free(opt->audio_src_);
g_free(opt->audio_enc_);
g_free(opt->audio_payloader_);
g_free(opt->audio_caps_);
g_free(opt->audio_depayloader_);
g_free(opt->audio_dec_);
- g_free(opt->audio_sink_);
g_free(opt->rtp_host_);
g_free(opt->rtp_addr_local_);
g_free(opt->preview_videosink_);
@@ -407,20 +402,18 @@ void options_print(options_t* opt)
printf(" debug: %s\n", opt->debug_ ? "true" : "false");
printf(" appname: >>%s<<\n", opt->appname_);
printf(" mode: >>%s<<\n", opt->mode_ == SENDER ? "sender" : "receiver");
- printf(" video_src: >>%s<<\n", opt->video_src_);
+ printf(" source: >>%s<<\n", opt->source_);
+ printf(" sink: >>%s<<\n", opt->sink_);
printf(" video_enc: >>%s<<\n", opt->video_enc_);
printf(" video_payloader: >>%s<<\n", opt->video_payloader_);
printf(" video_caps: >>%s<<\n", opt->video_caps_);
printf(" video_depayloader: >>%s<<\n", opt->video_depayloader_);
printf(" video_dec: >>%s<<\n", opt->video_dec_);
- printf(" video_sink: >>%s<<\n", opt->video_sink_);
- printf(" audio_src: >>%s<<\n", opt->audio_src_);
printf(" audio_enc: >>%s<<\n", opt->audio_enc_);
printf(" audio_payloader: >>%s<<\n", opt->audio_payloader_);
printf(" audio_caps: >>%s<<\n", opt->audio_caps_);
printf(" audio_depayloader: >>%s<<\n", opt->audio_depayloader_);
printf(" audio_dec: >>%s<<\n", opt->audio_dec_);
- printf(" audio_sink: >>%s<<\n", opt->audio_sink_);
printf(" rtp_host: >>%s<<\n", opt->rtp_host_);
printf(" rtp_port_base: %d\n", opt->rtp_port_base_);
printf(" rtp_addr_local: >>%s<<\n", opt->rtp_addr_local_);