[input/xcode] Write to input buffer with the sources native sample rate/format

Still WIP at this point since the player and output can't use the use improved
quality yet, and because rtptimes etc. are likely incorrect
This commit is contained in:
ejurgensen
2019-01-11 19:34:36 +01:00
parent 84e813038b
commit 9182597605
8 changed files with 146 additions and 61 deletions

View File

@@ -140,18 +140,20 @@ struct input_definition
int input_loop_break;
/*
* Transfer stream data to the player's input buffer. The input evbuf will be
* drained on succesful write. This is to avoid copying memory. If the player's
* input buffer is full the function will block until the write can be made
* (unless INPUT_FILE_NONBLOCK is set).
* Transfer stream data to the player's input buffer. Data must be PCM-LE
* samples. The input evbuf will be drained on succesful write. This is to avoid
* copying memory. If the player's input buffer is full the function will block
* until the write can be made (unless INPUT_FILE_NONBLOCK is set).
*
* @in evbuf Raw audio data to write
* @in evbuf Raw PCM_LE audio data to write
* @in evbuf Sample rate of the data
* @in evbuf Bits per sample (typically 16 or 24)
* @in flags One or more INPUT_FLAG_*
* @return 0 on success, EAGAIN if buffer was full (and _NONBLOCK is set),
* -1 on error
*/
int
input_write(struct evbuffer *evbuf, short flags);
input_write(struct evbuffer *evbuf, int sample_rate, int bits_per_sample, short flags);
/*
* Input modules can use this to wait in the playback loop (like input_write()