Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Unified Diff: services/media/framework/stream_type.h

Issue 1814553002: Motown: Improvements to packet definition (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/media/framework/stream_type.h
diff --git a/services/media/framework/stream_type.h b/services/media/framework/stream_type.h
index aaa313602e41db5f1afe49e006799f1cc7febccc..d13e00450f245be05c560dfc2952f41d667cd671 100644
--- a/services/media/framework/stream_type.h
+++ b/services/media/framework/stream_type.h
@@ -271,7 +271,13 @@ class LpcmStreamType : public StreamType {
}
uint64_t min_buffer_size(uint64_t frame_count) const {
- return frame_count * sample_size_ * channels_;
+ return frame_count * bytes_per_frame();
+ }
+
+ uint64_t frame_count(uint64_t size) const {
+ DCHECK(size % bytes_per_frame() == 0);
+ DCHECK(bytes_per_frame() != 0);
johngro 2016/03/21 19:47:56 the DCHECK which checks bytes_per_frame should com
dalesat 2016/03/21 22:30:58 Done.
+ return size / bytes_per_frame();
}
static uint32_t SampleSizeFromFormat(SampleFormat sample_format);

Powered by Google App Engine
This is Rietveld 408576698