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

Unified Diff: chromecast/browser/media/cast_renderer.h

Issue 1955843002: Move Renderer permanent callbacks into RendererClient interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chromecast/browser/media/cast_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/browser/media/cast_renderer.h
diff --git a/chromecast/browser/media/cast_renderer.h b/chromecast/browser/media/cast_renderer.h
index 5866e94d4ee52641271370379c94ed22949c2e51..bd572364bf69cb4d9c80250624e50c9c006e28d1 100644
--- a/chromecast/browser/media/cast_renderer.h
+++ b/chromecast/browser/media/cast_renderer.h
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/memory/weak_ptr.h"
#include "chromecast/browser/media/media_pipeline_backend_factory.h"
#include "media/base/renderer.h"
@@ -28,12 +29,8 @@ class CastRenderer : public ::media::Renderer {
// ::media::Renderer implementation.
void Initialize(::media::DemuxerStreamProvider* demuxer_stream_provider,
- const ::media::PipelineStatusCB& init_cb,
- const ::media::StatisticsCB& statistics_cb,
- const ::media::BufferingStateCB& buffering_state_cb,
- const base::Closure& ended_cb,
- const ::media::PipelineStatusCB& error_cb,
- const base::Closure& waiting_for_decryption_key_cb) final;
+ ::media::RendererClient* client,
+ const ::media::PipelineStatusCB& init_cb) final;
void SetCdm(::media::CdmContext* cdm_context,
const ::media::CdmAttachedCB& cdm_attached_cb) final;
void Flush(const base::Closure& flush_cb) final;
@@ -46,15 +43,21 @@ class CastRenderer : public ::media::Renderer {
private:
enum Stream { STREAM_AUDIO, STREAM_VIDEO };
- void OnEos(Stream stream);
+ void OnError(::media::PipelineStatus status);
+ void OnEnded(Stream stream);
+ void OnStatisticsUpdate(const ::media::PipelineStatistics& stats);
+ void OnBufferingStateChange(::media::BufferingState state);
+ void OnWaitingForDecryptionKey();
const CreateMediaPipelineBackendCB create_backend_cb_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+ ::media::RendererClient* client_;
scoped_refptr<BalancedMediaTaskRunnerFactory> media_task_runner_factory_;
std::unique_ptr<TaskRunnerImpl> backend_task_runner_;
std::unique_ptr<MediaPipelineImpl> pipeline_;
bool eos_[2];
- base::Closure ended_cb_;
+ base::WeakPtrFactory<CastRenderer> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(CastRenderer);
};
« no previous file with comments | « no previous file | chromecast/browser/media/cast_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698