decoder/Client: add Submit methods

Replaces decoder_data() and others.
This commit is contained in:
Max Kellermann
2016-11-18 08:27:30 +01:00
parent 47a0f46ce8
commit a88040e4d5
29 changed files with 214 additions and 228 deletions

View File

@@ -127,16 +127,14 @@ decoder_skip(DecoderClient *client, InputStream &is, size_t size)
}
void
decoder_timestamp(gcc_unused DecoderClient &client,
gcc_unused double t)
FakeDecoder::SubmitTimestamp(gcc_unused double t)
{
}
DecoderCommand
decoder_data(gcc_unused DecoderClient &client,
gcc_unused InputStream *is,
const void *data, size_t datalen,
gcc_unused uint16_t kbit_rate)
FakeDecoder::SubmitData(gcc_unused InputStream *is,
const void *data, size_t datalen,
gcc_unused uint16_t kbit_rate)
{
static uint16_t prev_kbit_rate;
if (kbit_rate != prev_kbit_rate) {
@@ -149,9 +147,8 @@ decoder_data(gcc_unused DecoderClient &client,
}
DecoderCommand
decoder_tag(gcc_unused DecoderClient &client,
gcc_unused InputStream *is,
Tag &&tag)
FakeDecoder::SubmitTag(gcc_unused InputStream *is,
Tag &&tag)
{
fprintf(stderr, "TAG: duration=%f\n", tag.duration.ToDoubleS());
@@ -162,8 +159,7 @@ decoder_tag(gcc_unused DecoderClient &client,
}
void
decoder_replay_gain(gcc_unused DecoderClient &client,
const ReplayGainInfo *rgi)
FakeDecoder::SubmitReplayGain(const ReplayGainInfo *rgi)
{
const ReplayGainTuple *tuple = &rgi->tuples[REPLAY_GAIN_ALBUM];
if (tuple->IsDefined())
@@ -177,7 +173,7 @@ decoder_replay_gain(gcc_unused DecoderClient &client,
}
void
decoder_mixramp(gcc_unused DecoderClient &client, gcc_unused MixRampInfo &&mix_ramp)
FakeDecoder::SubmitMixRamp(gcc_unused MixRampInfo &&mix_ramp)
{
fprintf(stderr, "MixRamp: start='%s' end='%s'\n",
mix_ramp.GetStart(), mix_ramp.GetEnd());

View File

@@ -39,6 +39,13 @@ struct FakeDecoder final : DecoderClient {
SongTime GetSeekTime() override;
uint64_t GetSeekFrame() override;
void SeekError() override;
void SubmitTimestamp(double t) override;
DecoderCommand SubmitData(InputStream *is,
const void *data, size_t length,
uint16_t kbit_rate) override;
DecoderCommand SubmitTag(InputStream *is, Tag &&tag) override ;
void SubmitReplayGain(const ReplayGainInfo *replay_gain_info) override;
void SubmitMixRamp(MixRampInfo &&mix_ramp) override;
};
#endif