1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chromecast/media/cma/base/decoder_buffer_adapter.h"
7 #include "media/base/decoder_buffer.h"
12 DecoderBufferAdapter::DecoderBufferAdapter(
13 const scoped_refptr
<::media::DecoderBuffer
>& buffer
)
14 : DecoderBufferAdapter(kPrimary
, buffer
) {
17 DecoderBufferAdapter::DecoderBufferAdapter(
18 StreamId stream_id
, const scoped_refptr
<::media::DecoderBuffer
>& buffer
)
19 : stream_id_(stream_id
),
23 DecoderBufferAdapter::~DecoderBufferAdapter() {
26 StreamId
DecoderBufferAdapter::stream_id() const {
30 base::TimeDelta
DecoderBufferAdapter::timestamp() const {
31 return buffer_
->timestamp();
34 void DecoderBufferAdapter::set_timestamp(const base::TimeDelta
& timestamp
) {
35 buffer_
->set_timestamp(timestamp
);
38 const uint8
* DecoderBufferAdapter::data() const {
39 return buffer_
->data();
42 uint8
* DecoderBufferAdapter::writable_data() const {
43 return buffer_
->writable_data();
46 size_t DecoderBufferAdapter::data_size() const {
47 return buffer_
->data_size();
50 const ::media::DecryptConfig
* DecoderBufferAdapter::decrypt_config() const {
51 return buffer_
->decrypt_config();
54 bool DecoderBufferAdapter::end_of_stream() const {
55 return buffer_
->end_of_stream();
59 } // namespace chromecast