diff options
author | Stefan Pöschel <github@basicmaster.de> | 2017-08-24 13:37:42 +0200 |
---|---|---|
committer | Stefan Pöschel <github@basicmaster.de> | 2017-08-24 13:37:42 +0200 |
commit | 9f62da63eb7577d30dc67fc2823201b4f2598ffa (patch) | |
tree | 85e123da8382690ae9df283835d81d7aa65f465d /src/odr-padenc.h | |
parent | b709a05a1873cfdff864866d71733ca8290e7f0a (diff) | |
download | ODR-PadEnc-9f62da63eb7577d30dc67fc2823201b4f2598ffa.tar.gz ODR-PadEnc-9f62da63eb7577d30dc67fc2823201b4f2598ffa.tar.bz2 ODR-PadEnc-9f62da63eb7577d30dc67fc2823201b4f2598ffa.zip |
Add uniform PAD encoder
The uniform PAD encoder encodes every PAD on demand and is kind of
synchronized to the audio encoder by means of the frame duration.
Insertion intervals for slides and labels can be set indepentent from
each other. It is also possible to specify how often the label is
inserted.
If the slides interval "0" is used, the next slide is inserted just
after the previous one has been transmitted. This is useful e.g. for
stations that transmit just a logo slide.
An initial burst count can be set to ensure that an audio encoder has
enough PADs available e.g. in case the audio encoder encodes DAB+
Superframes at once and hence needs all related PADs.
If a slide/label is still in transmission when the transmission of the
next one is scheduled, the new transmission is skipped and a warning is
shown. In this case it makes sense to increase the PAD length or to
instead decrease the slide size or label insertion interval (`-L`).
This new PAD encoder does not require any changes on the audio encoder
side. Only in case of MP2, a recent revision of ODR-AudioEnc has to be
used (commit ce25f2c or later), as it fixes a problem with PADs that
solely consist of the F-PAD.
Diffstat (limited to 'src/odr-padenc.h')
-rw-r--r-- | src/odr-padenc.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/odr-padenc.h b/src/odr-padenc.h index 7bdb057..fe5d375 100644 --- a/src/odr-padenc.h +++ b/src/odr-padenc.h @@ -51,6 +51,10 @@ struct PadEncoderOptions { size_t padlen; bool erase_after_tx; int slide_interval; + int frame_dur; // uniform PAD encoder only + int label_interval; // uniform PAD encoder only + int label_insertion; // uniform PAD encoder only + int init_burst; // uniform PAD encoder only bool raw_slides; DL_PARAMS dl_params; @@ -62,6 +66,10 @@ struct PadEncoderOptions { padlen(58), erase_after_tx(false), slide_interval(10), + frame_dur(0), + label_interval(12), + label_insertion(1200), + init_burst(12), raw_slides(false), sls_dir(NULL), output("/tmp/pad.fifo") @@ -118,3 +126,17 @@ private: public: BurstPadEncoder(PadEncoderOptions options) : PadEncoder(options) {} }; + + +// --- UniformPadEncoder ----------------------------------------------------------------- +class UniformPadEncoder : public PadEncoder { +private: + steady_clock::time_point pad_timeline; + steady_clock::time_point next_slide; + steady_clock::time_point next_label; + steady_clock::time_point next_label_insertion; + + int Encode(); +public: + UniformPadEncoder(PadEncoderOptions options); +}; |