CRAS: input_data - Adds input_data struct

Transfer input data from iodev to stream is more complicated
than the output path because samples are not guaranteed to be
interleaved and in later commits we'll add processing module
for input stream.

This is a refactor commit to pull out some input specific variable
from cras_iodev to the new struct input_data, which will hold the
logic of data transfer between iodev and rstream, in order to make
cras_iodev clean while we add more logic for stream level processing.

The new API calls will look like below:

/* Gets buffer from hw into input_data's audio area. */

/* Gets X frames of processed data to stream. */
input_data_get_for_stream( stream A )
input_data_get_for_stream( stream B )
...

/* Marks Y frames of data as used by stream. */
input_data_put_for_stream( stream A )
input_data_put_for_stream( stream B )

/* Mark Z frames of buffer as read by all client streams. */
input_data_set_all_streams_read( input_data, Z )

BUG=chromium:710465
TEST=unittest pass

Change-Id: I347d7735a787a15cc9bd8e314e7cf1ccc1d1fa59
Reviewed-on: https://chromium-review.googlesource.com/1018750
Commit-Ready: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
11 files changed