From 9f62da63eb7577d30dc67fc2823201b4f2598ffa Mon Sep 17 00:00:00 2001 From: Stefan Pöschel Date: Thu, 24 Aug 2017 13:37:42 +0200 Subject: 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. --- src/odr-padenc.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/odr-padenc.h') 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); +}; -- cgit v1.2.3