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 #ifndef CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_ADAPTER_H_
6 #define CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_ADAPTER_H_
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "chromecast/media/cma/base/decoder_buffer_base.h"
16 namespace chromecast
{
19 // DecoderBufferAdapter wraps a ::media::DecoderBuffer
20 // into a DecoderBufferBase.
21 class DecoderBufferAdapter
: public DecoderBufferBase
{
23 explicit DecoderBufferAdapter(
24 const scoped_refptr
< ::media::DecoderBuffer
>& buffer
);
26 // DecoderBufferBase implementation.
27 base::TimeDelta
timestamp() const override
;
28 const uint8
* data() const override
;
29 uint8
* writable_data() const override
;
30 int data_size() const override
;
31 const ::media::DecryptConfig
* decrypt_config() const override
;
32 bool end_of_stream() const override
;
35 ~DecoderBufferAdapter() override
;
37 scoped_refptr
< ::media::DecoderBuffer
> const buffer_
;
39 DISALLOW_COPY_AND_ASSIGN(DecoderBufferAdapter
);
43 } // namespace chromecast
45 #endif // CHROMECAST_MEDIA_CMA_BASE_DECODER_BUFFER_ADAPTER_H_