diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-12-02 07:14:19 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-12-02 07:29:33 +0100 |
commit | 98e61b8f765314e5132da97797590703eb6484ea (patch) | |
tree | 8f638c2ebd754aa97e9f0ce7b39366b64e80c4d8 | |
parent | a910b890b5ce386edd42516c454a85e8d3616c0f (diff) | |
download | ODR-AudioEnc-98e61b8f765314e5132da97797590703eb6484ea.tar.gz ODR-AudioEnc-98e61b8f765314e5132da97797590703eb6484ea.tar.bz2 ODR-AudioEnc-98e61b8f765314e5132da97797590703eb6484ea.zip |
Merge patch from Francesco for VLC input
Adds cache control and compressor
-rw-r--r-- | src/VLCInput.cpp | 5 | ||||
-rw-r--r-- | src/VLCInput.h | 13 | ||||
-rw-r--r-- | src/dabplus-enc.cpp | 16 |
3 files changed, 29 insertions, 5 deletions
diff --git a/src/VLCInput.cpp b/src/VLCInput.cpp index 3a2e9ec..00d5fa4 100644 --- a/src/VLCInput.cpp +++ b/src/VLCInput.cpp @@ -138,7 +138,7 @@ int VLCInput::prepare() // VLC options char smem_options[512]; snprintf(smem_options, sizeof(smem_options), - "#transcode{acodec=s16l,samplerate=%d}:" + "#transcode{acodec=s16l,samplerate=%d,afilter=compressor}:" // We are using transcode because smem only support raw audio and // video formats "smem{" @@ -153,7 +153,8 @@ int VLCInput::prepare() char verb_options[512]; snprintf(verb_options, sizeof(verb_options), - "--verbose=%d", m_verbosity); + "--verbose=%d --network-caching %s --compressor-makeup-gain=%s ", + m_verbosity,(char *)m_cache.c_str(),(char *)m_gain.c_str()); const char * const vlc_args[] = { verb_options, diff --git a/src/VLCInput.h b/src/VLCInput.h index 6b0a0f4..326c6cd 100644 --- a/src/VLCInput.h +++ b/src/VLCInput.h @@ -44,11 +44,15 @@ class VLCInput VLCInput(const std::string& uri, int rate, unsigned channels, - unsigned verbosity) : + unsigned verbosity, + std::string& gain, + std::string& cache) : m_uri(uri), m_verbosity(verbosity), m_channels(channels), m_rate(rate), + m_cache(cache), + m_gain(gain), m_vlc(NULL) { } ~VLCInput() { cleanup(); } @@ -103,6 +107,13 @@ class VLCInput unsigned m_channels; int m_rate; + // Whether to enable network caching in VLC or not + std::string m_cache; + + // value for the VLC compressor filter + std::string m_gain; + + std::future<bool> icy_text_written; std::string m_nowplaying; std::string m_nowplaying_previous; diff --git a/src/dabplus-enc.cpp b/src/dabplus-enc.cpp index 76d61fc..0664937 100644 --- a/src/dabplus-enc.cpp +++ b/src/dabplus-enc.cpp @@ -98,6 +98,8 @@ void usage(const char* name) { " For the VLC input:\n" #if HAVE_VLC " -v, --vlc-uri=uri Enable VLC input and use the URI given as source\n" + " -C, --vlc-cache=ms Enable VLC gain control, default 0\n" + " -g, --vlc-gain=db Enable VLC network cache\n" " -V Increase the VLC verbosity by one (can be given \n" " multiple times)\n" " -w, --write-icy-text=filename Write the ICY Text into the file, so that mot-encoder can read it.\n" @@ -252,6 +254,8 @@ int main(int argc, char *argv[]) // For the VLC input std::string vlc_uri = ""; std::string vlc_icytext_file = ""; + std::string vlc_gain = ""; + std::string vlc_cache = ""; unsigned verbosity = 0; // For the file output @@ -318,6 +322,8 @@ int main(int argc, char *argv[]) {"sbr", no_argument, 0, 1 }, {"ps", no_argument, 0, 2 }, {"fifo-silence", no_argument, 0, 3 }, + {"vlc_gain", required_argument, 0, 'g' }, + {"vlc_cache", required_argument, 0, 'C' }, {0, 0, 0, 0}, }; @@ -341,7 +347,7 @@ int main(int argc, char *argv[]) int index; while(ch != -1) { - ch = getopt_long(argc, argv, "aAhDlVb:c:f:i:j:k:o:r:d:p:P:s:v:w:", longopts, &index); + ch = getopt_long(argc, argv, "aAhDlVb:c:f:i:j:k:o:r:d:p:P:s:v:w:g:C:", longopts, &index); switch (ch) { case 0: // AAC-LC aot = AOT_DABPLUS_AAC_LC; @@ -426,6 +432,12 @@ int main(int argc, char *argv[]) case 'w': vlc_icytext_file = optarg; break; + case 'g': + vlc_gain = optarg; + break; + case 'C': + vlc_cache = optarg; + break; #else case 'v': case 'w': @@ -597,7 +609,7 @@ int main(int argc, char *argv[]) JackInput jack_in(jack_name, channels, sample_rate, queue); #endif #if HAVE_VLC - VLCInput vlc_in(vlc_uri, sample_rate, channels, verbosity); + VLCInput vlc_in(vlc_uri, sample_rate, channels, verbosity, vlc_gain, vlc_cache); #endif if (infile) { |