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

Unified Diff: chromecast/media/cma/pipeline/audio_pipeline_impl.h

Issue 741863002: Chromecast: adds a media pipeline feeding data to CMA device backends. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cma-cdm
Patch Set: address nits, merge Pause/Flush Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chromecast/media/cma/pipeline/audio_pipeline_impl.h
diff --git a/chromecast/media/cma/pipeline/audio_pipeline_impl.h b/chromecast/media/cma/pipeline/audio_pipeline_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..275ef0c64ece34bbaf53092391bd72ce6e778a47
--- /dev/null
+++ b/chromecast/media/cma/pipeline/audio_pipeline_impl.h
@@ -0,0 +1,79 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMECAST_MEDIA_CMA_BASE_AUDIO_PIPELINE_IMPL_H_
+#define CHROMECAST_MEDIA_CMA_BASE_AUDIO_PIPELINE_IMPL_H_
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "base/threading/thread_checker.h"
+#include "chromecast/media/cma/pipeline/audio_pipeline.h"
+#include "chromecast/media/cma/pipeline/av_pipeline_client.h"
+
+namespace media {
+class AudioDecoderConfig;
+class VideoDecoderConfig;
+}
+
+namespace chromecast {
+namespace media {
+class AudioPipelineDevice;
+class AvPipelineImpl;
+class BrowserCdmCast;
+class BufferingState;
+class CodedFrameProvider;
+
+class AudioPipelineImpl : public AudioPipeline {
+ public:
+ // |buffering_controller| can be NULL.
+ explicit AudioPipelineImpl(AudioPipelineDevice* audio_device);
+ ~AudioPipelineImpl() override;
+
+ // Input port of the pipeline.
+ void SetCodedFrameProvider(scoped_ptr<CodedFrameProvider> frame_provider);
+
+ // Provide the CDM to use to decrypt samples.
+ void SetCdm(BrowserCdmCast* media_keys);
+
+ // Functions to control the state of the audio pipeline.
+ void Initialize(
+ const ::media::AudioDecoderConfig& config,
+ scoped_ptr<CodedFrameProvider> frame_provider,
+ const ::media::PipelineStatusCB& status_cb);
+ bool StartPlayingFrom(base::TimeDelta time,
+ const scoped_refptr<BufferingState>& buffering_state);
+ void Flush(const ::media::PipelineStatusCB& status_cb);
+ void Stop();
+
+ // Update the playback statistics for this audio stream.
+ void UpdateStatistics();
+
+ // AudioPipeline implementation.
+ void SetClient(const AvPipelineClient& client) override;
+ void SetVolume(float volume) override;
+
+ private:
+ void OnFlushDone(const ::media::PipelineStatusCB& status_cb);
+ void OnUpdateConfig(const ::media::AudioDecoderConfig& audio_config,
+ const ::media::VideoDecoderConfig& video_config);
+
+ AudioPipelineDevice* audio_device_;
+
+ scoped_ptr<AvPipelineImpl> av_pipeline_impl_;
+ AvPipelineClient audio_client_;
+
+ ::media::PipelineStatistics previous_stats_;
+
+ base::WeakPtrFactory<AudioPipelineImpl> weak_factory_;
+ base::WeakPtr<AudioPipelineImpl> weak_this_;
+
+ DISALLOW_COPY_AND_ASSIGN(AudioPipelineImpl);
+};
+
+} // namespace media
+} // namespace chromecast
+
+#endif // CHROMECAST_MEDIA_CMA_BASE_AUDIO_PIPELINE_IMPL_H_
« no previous file with comments | « chromecast/media/cma/pipeline/audio_pipeline.cc ('k') | chromecast/media/cma/pipeline/audio_pipeline_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698