summaryrefslogtreecommitdiff
path: root/cras/src/server/dev_stream.h
diff options
context:
space:
mode:
Diffstat (limited to 'cras/src/server/dev_stream.h')
-rw-r--r--cras/src/server/dev_stream.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/cras/src/server/dev_stream.h b/cras/src/server/dev_stream.h
index c39a8017..6b34d5d7 100644
--- a/cras/src/server/dev_stream.h
+++ b/cras/src/server/dev_stream.h
@@ -46,30 +46,47 @@ struct dev_stream {
int is_running;
};
+/*
+ * Creates a dev_stream.
+ *
+ * Args:
+ * stream - The associated rstream.
+ * dev_id - Index of the device.
+ * dev_fmt - The format of the device.
+ * dev_ptr - A pointer to the device
+ * cb_ts - A pointer to the initial callback time.
+ * sleep_interval_ts - A pointer to the initial sleep interval.
+ * Set to null to calculate the value from device rate and block size.
+ * Note that we need this argument so that output device sleep interval
+ * can use input device sleep interval in the beginning to have perfect
+ * alignment in WebRTC use case.
+ * Returns the pointer to the created dev_stream.
+ */
struct dev_stream *dev_stream_create(struct cras_rstream *stream,
unsigned int dev_id,
const struct cras_audio_format *dev_fmt,
- void *dev_ptr, struct timespec *cb_ts);
+ void *dev_ptr, struct timespec *cb_ts,
+ const struct timespec *sleep_interval_ts);
void dev_stream_destroy(struct dev_stream *dev_stream);
/*
* Update the estimated sample rate of the device. For multiple active
* devices case, the linear resampler will be configured by the estimated
- * rate ration of the master device and the current active device the
+ * rate ration of the main device and the current active device the
* rstream attaches to.
*
* Args:
* dev_stream - The structure holding the stream.
* dev_rate - The sample rate device is using.
* dev_rate_ratio - The ratio of estimated rate and used rate.
- * master_rate_ratio - The ratio of estimated rate and used rate of
- * master device.
+ * main_rate_ratio - The ratio of estimated rate and used rate of
+ * main device.
* coarse_rate_adjust - The flag to indicate the direction device
* sample rate should adjust to.
*/
void dev_stream_set_dev_rate(struct dev_stream *dev_stream,
unsigned int dev_rate, double dev_rate_ratio,
- double master_rate_ratio, int coarse_rate_adjust);
+ double main_rate_ratio, int coarse_rate_adjust);
/*
* Renders count frames from shm into dst. Updates count if anything is