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

@@ -104,73 +104,4 @@ decoder_read_full(DecoderClient *decoder, InputStream &is,
bool
decoder_skip(DecoderClient *decoder, InputStream &is, size_t size);
/**
* Sets the time stamp for the next data chunk [seconds]. The MPD
* core automatically counts it up, and a decoder plugin only needs to
* use this function if it thinks that adding to the time stamp based
* on the buffer size won't work.
*/
void
decoder_timestamp(DecoderClient &decoder, double t);
/**
* This function is called by the decoder plugin when it has
* successfully decoded block of input data.
*
* @param decoder the decoder object
* @param is an input stream which is buffering while we are waiting
* for the player
* @param data the source buffer
* @param length the number of bytes in the buffer
* @return the current command, or DecoderCommand::NONE if there is no
* command pending
*/
DecoderCommand
decoder_data(DecoderClient &decoder, InputStream *is,
const void *data, size_t length,
uint16_t kbit_rate);
static inline DecoderCommand
decoder_data(DecoderClient &decoder, InputStream &is,
const void *data, size_t length,
uint16_t kbit_rate)
{
return decoder_data(decoder, &is, data, length, kbit_rate);
}
/**
* This function is called by the decoder plugin when it has
* successfully decoded a tag.
*
* @param is an input stream which is buffering while we are waiting
* for the player
* @param tag the tag to send
* @return the current command, or DecoderCommand::NONE if there is no
* command pending
*/
DecoderCommand
decoder_tag(DecoderClient &decoder, InputStream *is, Tag &&tag);
static inline DecoderCommand
decoder_tag(DecoderClient &decoder, InputStream &is, Tag &&tag)
{
return decoder_tag(decoder, &is, std::move(tag));
}
/**
* Set replay gain values for the following chunks.
*
* @param replay_gain_info the replay_gain_info object; may be nullptr
* to invalidate the previous replay gain values
*/
void
decoder_replay_gain(DecoderClient &decoder,
const ReplayGainInfo *replay_gain_info);
/**
* Store MixRamp tags.
*/
void
decoder_mixramp(DecoderClient &decoder, MixRampInfo &&mix_ramp);
#endif