OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BACKEND_VIDEO_DECODER_DEFAULT_H_ | 5 #ifndef CHROMECAST_MEDIA_CMA_BACKEND_VIDEO_DECODER_DEFAULT_H_ |
6 #define CHROMECAST_MEDIA_CMA_BACKEND_VIDEO_DECODER_DEFAULT_H_ | 6 #define CHROMECAST_MEDIA_CMA_BACKEND_VIDEO_DECODER_DEFAULT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/time/time.h" |
12 #include "chromecast/public/media/media_pipeline_backend.h" | 12 #include "chromecast/public/media/media_pipeline_backend.h" |
13 | 13 |
14 namespace chromecast { | 14 namespace chromecast { |
15 namespace media { | 15 namespace media { |
16 | 16 |
| 17 class MediaSinkDefault; |
| 18 |
17 class VideoDecoderDefault : public MediaPipelineBackend::VideoDecoder { | 19 class VideoDecoderDefault : public MediaPipelineBackend::VideoDecoder { |
18 public: | 20 public: |
19 VideoDecoderDefault(); | 21 VideoDecoderDefault(); |
20 ~VideoDecoderDefault() override; | 22 ~VideoDecoderDefault() override; |
21 | 23 |
22 int64_t last_push_pts() const { return last_push_pts_; } | 24 void Start(base::TimeDelta start_pts); |
| 25 void Stop(); |
| 26 void SetPlaybackRate(float rate); |
| 27 base::TimeDelta GetCurrentPts(); |
23 | 28 |
24 // MediaPipelineBackend::VideoDecoder implementation: | 29 // MediaPipelineBackend::VideoDecoder implementation: |
25 void SetDelegate(Delegate* delegate) override; | 30 void SetDelegate(Delegate* delegate) override; |
26 MediaPipelineBackend::BufferStatus PushBuffer( | 31 MediaPipelineBackend::BufferStatus PushBuffer( |
27 CastDecoderBuffer* buffer) override; | 32 CastDecoderBuffer* buffer) override; |
28 void GetStatistics(Statistics* statistics) override; | 33 void GetStatistics(Statistics* statistics) override; |
29 bool SetConfig(const VideoConfig& config) override; | 34 bool SetConfig(const VideoConfig& config) override; |
30 | 35 |
31 private: | 36 private: |
32 void OnEndOfStream(); | |
33 | |
34 Delegate* delegate_; | 37 Delegate* delegate_; |
35 int64_t last_push_pts_; | 38 std::unique_ptr<MediaSinkDefault> sink_; |
36 base::WeakPtrFactory<VideoDecoderDefault> weak_factory_; | |
37 | |
38 DISALLOW_COPY_AND_ASSIGN(VideoDecoderDefault); | 39 DISALLOW_COPY_AND_ASSIGN(VideoDecoderDefault); |
39 }; | 40 }; |
40 | 41 |
41 } // namespace media | 42 } // namespace media |
42 } // namespace chromecast | 43 } // namespace chromecast |
43 | 44 |
44 #endif // CHROMECAST_MEDIA_CMA_BACKEND_VIDEO_DECODER_DEFAULT_H_ | 45 #endif // CHROMECAST_MEDIA_CMA_BACKEND_VIDEO_DECODER_DEFAULT_H_ |
OLD | NEW |