OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMECAST_MEDIA_CMA_BASE_BUFFERING_FRAME_PROVIDER_H_ | 5 #ifndef CHROMECAST_MEDIA_CMA_BASE_BUFFERING_FRAME_PROVIDER_H_ |
6 #define CHROMECAST_MEDIA_CMA_BASE_BUFFERING_FRAME_PROVIDER_H_ | 6 #define CHROMECAST_MEDIA_CMA_BASE_BUFFERING_FRAME_PROVIDER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 // last frame buffered. The second parameter of the callback indicates | 33 // last frame buffered. The second parameter of the callback indicates |
34 // whether the maximum capacity has been reached, i.e. whether the next frame | 34 // whether the maximum capacity has been reached, i.e. whether the next frame |
35 // size might overflow the buffer: |total_buffer_size_| + next_frame_size | 35 // size might overflow the buffer: |total_buffer_size_| + next_frame_size |
36 // might be greater than |max_buffer_size|. | 36 // might be greater than |max_buffer_size|. |
37 // Note: takes ownership of |coded_frame_provider|. | 37 // Note: takes ownership of |coded_frame_provider|. |
38 BufferingFrameProvider( | 38 BufferingFrameProvider( |
39 scoped_ptr<CodedFrameProvider> coded_frame_provider, | 39 scoped_ptr<CodedFrameProvider> coded_frame_provider, |
40 size_t max_buffer_size, | 40 size_t max_buffer_size, |
41 size_t max_frame_size, | 41 size_t max_frame_size, |
42 const FrameBufferedCB& frame_buffered_cb); | 42 const FrameBufferedCB& frame_buffered_cb); |
43 virtual ~BufferingFrameProvider(); | 43 ~BufferingFrameProvider() override; |
44 | 44 |
45 // CodedFrameProvider implementation. | 45 // CodedFrameProvider implementation. |
46 virtual void Read(const ReadCB& read_cb) override; | 46 void Read(const ReadCB& read_cb) override; |
47 virtual void Flush(const base::Closure& flush_cb) override; | 47 void Flush(const base::Closure& flush_cb) override; |
48 | 48 |
49 private: | 49 private: |
50 class BufferWithConfig { | 50 class BufferWithConfig { |
51 public: | 51 public: |
52 BufferWithConfig( | 52 BufferWithConfig( |
53 const scoped_refptr<DecoderBufferBase>& buffer, | 53 const scoped_refptr<DecoderBufferBase>& buffer, |
54 const ::media::AudioDecoderConfig& audio_config, | 54 const ::media::AudioDecoderConfig& audio_config, |
55 const ::media::VideoDecoderConfig& video_config); | 55 const ::media::VideoDecoderConfig& video_config); |
56 ~BufferWithConfig(); | 56 ~BufferWithConfig(); |
57 | 57 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 base::WeakPtr<BufferingFrameProvider> weak_this_; | 108 base::WeakPtr<BufferingFrameProvider> weak_this_; |
109 base::WeakPtrFactory<BufferingFrameProvider> weak_factory_; | 109 base::WeakPtrFactory<BufferingFrameProvider> weak_factory_; |
110 | 110 |
111 DISALLOW_COPY_AND_ASSIGN(BufferingFrameProvider); | 111 DISALLOW_COPY_AND_ASSIGN(BufferingFrameProvider); |
112 }; | 112 }; |
113 | 113 |
114 } // namespace media | 114 } // namespace media |
115 } // namespace chromecast | 115 } // namespace chromecast |
116 | 116 |
117 #endif // CHROMECAST_MEDIA_CMA_BASE_BUFFERING_FRAME_PROVIDER_H_ | 117 #endif // CHROMECAST_MEDIA_CMA_BASE_BUFFERING_FRAME_PROVIDER_H_ |
OLD | NEW |