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

Unified Diff: services/media/framework/models/lpcm_frames.h

Issue 1577953002: Motown in-proc streaming framework used to implement media services. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: removed build/util/LASTCHANGE Created 4 years, 11 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/models/lpcm_frames.h
diff --git a/services/media/framework/models/lpcm_frames.h b/services/media/framework/models/lpcm_frames.h
new file mode 100644
index 0000000000000000000000000000000000000000..3a67040883258c524c3264d4eeb24f15e777bf9c
--- /dev/null
+++ b/services/media/framework/models/lpcm_frames.h
@@ -0,0 +1,36 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_MEDIA_MODELS_LPCM_FRAMES_H_
+#define MOJO_MEDIA_MODELS_LPCM_FRAMES_H_
+
+#include <cstdint>
+
+#include "base/logging.h"
+
+namespace mojo {
+namespace media {
+
+// References LPCM frames.
+struct LpcmFrames {
+ LpcmFrames() :
+ buffer_(nullptr),
+ frame_count_(0),
+ bytes_per_frame_(0) {}
+
+ void advance(uint64_t frames) {
+ DCHECK(frames <= frame_count_);
+ buffer_ = reinterpret_cast<uint8_t*>(buffer_) + (frames * bytes_per_frame_);
+ frame_count_ -= frames;
+ }
+
+ void* buffer_;
+ uint64_t frame_count_;
+ uint32_t bytes_per_frame_;
+};
+
+} // namespace media
+} // namespace mojo
+
+#endif // MOJO_MEDIA_MODELS_LPCM_FRAMES_H_

Powered by Google App Engine
This is Rietveld 408576698