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

Unified Diff: media/mojo/services/mojo_demuxer_stream_adapter.cc

Issue 1935873002: Implement disabling and enabling media tracks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-control2
Patch Set: Updated comments + dchecks in ffmpeg demux stream 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
Index: media/mojo/services/mojo_demuxer_stream_adapter.cc
diff --git a/media/mojo/services/mojo_demuxer_stream_adapter.cc b/media/mojo/services/mojo_demuxer_stream_adapter.cc
index 9d540c60a3e5590c0fcd4afd75edf04f024e45dd..82c9f781a593e5fa0bb370ee8a691a88d9512498 100644
--- a/media/mojo/services/mojo_demuxer_stream_adapter.cc
+++ b/media/mojo/services/mojo_demuxer_stream_adapter.cc
@@ -70,6 +70,29 @@ VideoRotation MojoDemuxerStreamAdapter::video_rotation() {
return VIDEO_ROTATION_0;
}
+#if DCHECK_IS_ON()
+void DcheckRemoteEnabledValue(bool local_enabled_value,
+ bool remote_enabled_value) {
+ DCHECK_EQ(local_enabled_value, remote_enabled_value);
+}
+#endif
+
+bool MojoDemuxerStreamAdapter::enabled() const {
+#if DCHECK_IS_ON()
+ // TODO(servolk): Is it worth waiting for the IPC call roundtrip, when we can
+ // just maintain the current |enabled_| status in here. Would this cause any
+ // problems?
+ demuxer_stream_->enabled(base::Bind(&DcheckRemoteEnabledValue, enabled_));
+#endif
+ return enabled_;
+}
+
+void MojoDemuxerStreamAdapter::set_enabled(bool enabled,
+ base::TimeDelta timestamp) {
+ demuxer_stream_->set_enabled(enabled, timestamp.InMicroseconds());
+ enabled_ = enabled;
+}
+
// TODO(xhwang): Pass liveness here.
void MojoDemuxerStreamAdapter::OnStreamReady(
mojom::DemuxerStream::Type type,

Powered by Google App Engine
This is Rietveld 408576698