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_BROWSER_MEDIA_MEDIA_PIPELINE_HOST_H_ | 5 #ifndef CHROMECAST_BROWSER_MEDIA_MEDIA_PIPELINE_HOST_H_ |
6 #define CHROMECAST_BROWSER_MEDIA_MEDIA_PIPELINE_HOST_H_ | 6 #define CHROMECAST_BROWSER_MEDIA_MEDIA_PIPELINE_HOST_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
| 9 #include <memory> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/callback.h" | 12 #include "base/callback.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | |
15 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
17 #include "chromecast/browser/media/media_pipeline_backend_factory.h" | 17 #include "chromecast/browser/media/media_pipeline_backend_factory.h" |
18 #include "chromecast/common/media/cma_ipc_common.h" | 18 #include "chromecast/common/media/cma_ipc_common.h" |
19 #include "chromecast/media/cma/pipeline/load_type.h" | 19 #include "chromecast/media/cma/pipeline/load_type.h" |
20 #include "media/base/pipeline_status.h" | 20 #include "media/base/pipeline_status.h" |
21 | 21 |
22 namespace base { | 22 namespace base { |
23 class SharedMemory; | 23 class SharedMemory; |
24 } | 24 } |
(...skipping 17 matching lines...) Expand all Loading... |
42 class MediaPipelineHost { | 42 class MediaPipelineHost { |
43 public: | 43 public: |
44 MediaPipelineHost(); | 44 MediaPipelineHost(); |
45 ~MediaPipelineHost(); | 45 ~MediaPipelineHost(); |
46 | 46 |
47 void Initialize(LoadType load_type, | 47 void Initialize(LoadType load_type, |
48 const MediaPipelineClient& client, | 48 const MediaPipelineClient& client, |
49 const CreateMediaPipelineBackendCB& create_backend_cb); | 49 const CreateMediaPipelineBackendCB& create_backend_cb); |
50 | 50 |
51 void SetAvPipe(TrackId track_id, | 51 void SetAvPipe(TrackId track_id, |
52 scoped_ptr<base::SharedMemory> shared_mem, | 52 std::unique_ptr<base::SharedMemory> shared_mem, |
53 const base::Closure& pipe_read_activity_cb, | 53 const base::Closure& pipe_read_activity_cb, |
54 const base::Closure& av_pipe_set_cb); | 54 const base::Closure& av_pipe_set_cb); |
55 void AudioInitialize(TrackId track_id, | 55 void AudioInitialize(TrackId track_id, |
56 const AvPipelineClient& client, | 56 const AvPipelineClient& client, |
57 const ::media::AudioDecoderConfig& config, | 57 const ::media::AudioDecoderConfig& config, |
58 const ::media::PipelineStatusCB& status_cb); | 58 const ::media::PipelineStatusCB& status_cb); |
59 void VideoInitialize(TrackId track_id, | 59 void VideoInitialize(TrackId track_id, |
60 const VideoPipelineClient& client, | 60 const VideoPipelineClient& client, |
61 const std::vector< ::media::VideoDecoderConfig>& configs, | 61 const std::vector< ::media::VideoDecoderConfig>& configs, |
62 const ::media::PipelineStatusCB& status_cb); | 62 const ::media::PipelineStatusCB& status_cb); |
63 void StartPlayingFrom(base::TimeDelta time); | 63 void StartPlayingFrom(base::TimeDelta time); |
64 void Flush(const base::Closure& flush_cb); | 64 void Flush(const base::Closure& flush_cb); |
65 void Stop(); | 65 void Stop(); |
66 | 66 |
67 void SetPlaybackRate(double playback_rate); | 67 void SetPlaybackRate(double playback_rate); |
68 void SetVolume(TrackId track_id, float playback_rate); | 68 void SetVolume(TrackId track_id, float playback_rate); |
69 void SetCdm(BrowserCdmCast* cdm); | 69 void SetCdm(BrowserCdmCast* cdm); |
70 | 70 |
71 void NotifyPipeWrite(TrackId track_id); | 71 void NotifyPipeWrite(TrackId track_id); |
72 | 72 |
73 private: | 73 private: |
74 base::ThreadChecker thread_checker_; | 74 base::ThreadChecker thread_checker_; |
75 | 75 |
76 scoped_ptr<TaskRunnerImpl> task_runner_; | 76 std::unique_ptr<TaskRunnerImpl> task_runner_; |
77 scoped_ptr<MediaPipelineImpl> media_pipeline_; | 77 std::unique_ptr<MediaPipelineImpl> media_pipeline_; |
78 | 78 |
79 scoped_ptr<CodedFrameProvider> audio_frame_provider_; | 79 std::unique_ptr<CodedFrameProvider> audio_frame_provider_; |
80 scoped_ptr<CodedFrameProvider> video_frame_provider_; | 80 std::unique_ptr<CodedFrameProvider> video_frame_provider_; |
81 | 81 |
82 // The shared memory for a track id must be valid until Stop is invoked on | 82 // The shared memory for a track id must be valid until Stop is invoked on |
83 // that track id. | 83 // that track id. |
84 struct MediaTrackHost; | 84 struct MediaTrackHost; |
85 typedef std::map<TrackId, MediaTrackHost*> MediaTrackMap; | 85 typedef std::map<TrackId, MediaTrackHost*> MediaTrackMap; |
86 MediaTrackMap media_track_map_; | 86 MediaTrackMap media_track_map_; |
87 | 87 |
88 DISALLOW_COPY_AND_ASSIGN(MediaPipelineHost); | 88 DISALLOW_COPY_AND_ASSIGN(MediaPipelineHost); |
89 }; | 89 }; |
90 | 90 |
91 } // namespace media | 91 } // namespace media |
92 } // namespace chromecast | 92 } // namespace chromecast |
93 | 93 |
94 #endif // CHROMECAST_BROWSER_MEDIA_MEDIA_PIPELINE_HOST_H_ | 94 #endif // CHROMECAST_BROWSER_MEDIA_MEDIA_PIPELINE_HOST_H_ |
OLD | NEW |