11#include <promeki/config.h>
12#if PROMEKI_ENABLE_PROAV
19#include <vtc/ltc_audio.h>
21PROMEKI_NAMESPACE_BEGIN
55 using UPtr = UniquePtr<LtcDecoder>;
67 struct DecodedTimecode {
74 using DecodedList = ::promeki::List<DecodedTimecode>;
80 LtcDecoder(
int sampleRate);
83 ~LtcDecoder() =
default;
85 LtcDecoder(
const LtcDecoder &) =
delete;
86 LtcDecoder &operator=(
const LtcDecoder &) =
delete;
87 LtcDecoder(LtcDecoder &&) =
default;
88 LtcDecoder &operator=(LtcDecoder &&) =
default;
94 int sampleRate()
const {
return _decoder.sample_rate; }
101 void setThresholds(int8_t lower, int8_t upper);
107 void setFuzz(
int fuzz);
115 DecodedList decode(
const int8_t *samples,
size_t count);
140 DecodedList decode(
const PcmAudioPayload &audio,
int channelIndex = 0);
150 VtcLTCDecoder _decoder;
151 DecodedList _results;
156 List<float> _floatScratch;
157 List<int8_t> _int8Scratch;
164 DecodedList decodeInterleaved(
const AudioDesc &desc,
const uint8_t *data,
size_t samples,
167 static void decoderCallback(
const VtcTimecode *tc, int64_t sampleStart, int64_t sampleLength,