| 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_
|
|
|