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

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: Added a comment. 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
« no previous file with comments | « services/media/framework/stages/output.cc ('k') | services/media/framework_ffmpeg/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..31021e286443235f48fb5309b83f022938324199 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(bytes_per_frame() != 0);
+ DCHECK(size % bytes_per_frame() == 0);
+ return size / bytes_per_frame();
}
static uint32_t SampleSizeFromFormat(SampleFormat sample_format);
« no previous file with comments | « services/media/framework/stages/output.cc ('k') | services/media/framework_ffmpeg/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698