Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: chromecast/media/cma/pipeline/audio_pipeline_impl.h

Issue 1372393007: [Chromecast] Upgrade to new CMA backend API (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Remove unnecessary abstract base classes. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_AUDIO_PIPELINE_IMPL_H_ 5 #ifndef CHROMECAST_MEDIA_CMA_BASE_AUDIO_PIPELINE_IMPL_H_
6 #define CHROMECAST_MEDIA_CMA_BASE_AUDIO_PIPELINE_IMPL_H_ 6 #define CHROMECAST_MEDIA_CMA_BASE_AUDIO_PIPELINE_IMPL_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/threading/thread_checker.h" 12 #include "base/threading/thread_checker.h"
13 #include "chromecast/media/cma/pipeline/audio_pipeline.h"
14 #include "chromecast/media/cma/pipeline/av_pipeline_client.h" 13 #include "chromecast/media/cma/pipeline/av_pipeline_client.h"
14 #include "chromecast/public/media/media_pipeline_backend.h"
15 #include "chromecast/public/media/stream_id.h" 15 #include "chromecast/public/media/stream_id.h"
16 16
17 namespace media { 17 namespace media {
18 class AudioDecoderConfig; 18 class AudioDecoderConfig;
19 class VideoDecoderConfig; 19 class VideoDecoderConfig;
20 } 20 }
21 21
22 namespace chromecast { 22 namespace chromecast {
23 namespace media { 23 namespace media {
24 class AudioPipelineDevice;
25 class AvPipelineImpl; 24 class AvPipelineImpl;
26 class BrowserCdmCast; 25 class BrowserCdmCast;
27 class BufferingState; 26 class BufferingState;
28 class CodedFrameProvider; 27 class CodedFrameProvider;
29 28
30 class AudioPipelineImpl : public AudioPipeline { 29 class AudioPipelineImpl {
slan 2015/10/07 20:56:16 Can this just be called AudioPipeline now that it
kmackay 2015/10/09 20:35:40 I will rename things in a separate CL.
31 public: 30 public:
32 // |buffering_controller| can be NULL. 31 AudioPipelineImpl(MediaPipelineBackend::AudioDecoder* decoder,
33 explicit AudioPipelineImpl(AudioPipelineDevice* audio_device); 32 const AvPipelineClient& client);
34 ~AudioPipelineImpl() override; 33 ~AudioPipelineImpl();
35 34
36 // Input port of the pipeline. 35 // Input port of the pipeline.
37 void SetCodedFrameProvider(scoped_ptr<CodedFrameProvider> frame_provider); 36 void SetCodedFrameProvider(scoped_ptr<CodedFrameProvider> frame_provider);
38 37
39 // Provide the CDM to use to decrypt samples. 38 // Provide the CDM to use to decrypt samples.
40 void SetCdm(BrowserCdmCast* media_keys); 39 void SetCdm(BrowserCdmCast* media_keys);
41 40
42 // Functions to control the state of the audio pipeline. 41 // Functions to control the state of the audio pipeline.
43 void Initialize( 42 void Initialize(
44 const ::media::AudioDecoderConfig& config, 43 const ::media::AudioDecoderConfig& config,
45 scoped_ptr<CodedFrameProvider> frame_provider, 44 scoped_ptr<CodedFrameProvider> frame_provider,
46 const ::media::PipelineStatusCB& status_cb); 45 const ::media::PipelineStatusCB& status_cb);
47 bool StartPlayingFrom(base::TimeDelta time, 46 bool StartPlayingFrom(base::TimeDelta time,
48 const scoped_refptr<BufferingState>& buffering_state); 47 const scoped_refptr<BufferingState>& buffering_state);
49 void Flush(const ::media::PipelineStatusCB& status_cb); 48 void Flush(const ::media::PipelineStatusCB& status_cb);
50 void Stop(); 49 void Stop();
51 50
52 // Update the playback statistics for this audio stream. 51 // Update the playback statistics for this audio stream.
53 void UpdateStatistics(); 52 void UpdateStatistics();
54 53
55 // AudioPipeline implementation. 54 void SetVolume(float volume);
56 void SetClient(const AvPipelineClient& client) override; 55
57 void SetVolume(float volume) override; 56 void OnBufferPushed(MediaPipelineBackend::BufferStatus status);
57 void OnEndOfStream();
58 void OnError();
58 59
59 private: 60 private:
60 void OnFlushDone(const ::media::PipelineStatusCB& status_cb); 61 void OnFlushDone(const ::media::PipelineStatusCB& status_cb);
61 void OnUpdateConfig(StreamId id, 62 void OnUpdateConfig(StreamId id,
62 const ::media::AudioDecoderConfig& audio_config, 63 const ::media::AudioDecoderConfig& audio_config,
63 const ::media::VideoDecoderConfig& video_config); 64 const ::media::VideoDecoderConfig& video_config);
64 65
65 AudioPipelineDevice* audio_device_; 66 MediaPipelineBackend::AudioDecoder* decoder_;
66 67
67 scoped_ptr<AvPipelineImpl> av_pipeline_impl_; 68 scoped_ptr<AvPipelineImpl> av_pipeline_impl_;
68 AvPipelineClient audio_client_; 69 AvPipelineClient audio_client_;
69 70
70 ::media::PipelineStatistics previous_stats_; 71 ::media::PipelineStatistics previous_stats_;
71 72
72 base::WeakPtr<AudioPipelineImpl> weak_this_; 73 base::WeakPtr<AudioPipelineImpl> weak_this_;
73 base::WeakPtrFactory<AudioPipelineImpl> weak_factory_; 74 base::WeakPtrFactory<AudioPipelineImpl> weak_factory_;
74 75
75 DISALLOW_COPY_AND_ASSIGN(AudioPipelineImpl); 76 DISALLOW_COPY_AND_ASSIGN(AudioPipelineImpl);
76 }; 77 };
77 78
78 } // namespace media 79 } // namespace media
79 } // namespace chromecast 80 } // namespace chromecast
80 81
81 #endif // CHROMECAST_MEDIA_CMA_BASE_AUDIO_PIPELINE_IMPL_H_ 82 #endif // CHROMECAST_MEDIA_CMA_BASE_AUDIO_PIPELINE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698