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

Side by Side Diff: media/renderers/renderer_impl.h

Issue 1812543003: Allow muting/unmuting audio through media track API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blink-sb-tracks6
Patch Set: Avoid ChunkDemuxer/PipelineImpl deadlock Created 4 years, 8 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
« no previous file with comments | « media/filters/media_source_state.cc ('k') | media/renderers/renderer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 MEDIA_RENDERERS_RENDERER_IMPL_H_ 5 #ifndef MEDIA_RENDERERS_RENDERER_IMPL_H_
6 #define MEDIA_RENDERERS_RENDERER_IMPL_H_ 6 #define MEDIA_RENDERERS_RENDERER_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/cancelable_callback.h" 10 #include "base/cancelable_callback.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 const base::Closure& waiting_for_decryption_key_cb) final; 56 const base::Closure& waiting_for_decryption_key_cb) final;
57 void SetCdm(CdmContext* cdm_context, 57 void SetCdm(CdmContext* cdm_context,
58 const CdmAttachedCB& cdm_attached_cb) final; 58 const CdmAttachedCB& cdm_attached_cb) final;
59 void Flush(const base::Closure& flush_cb) final; 59 void Flush(const base::Closure& flush_cb) final;
60 void StartPlayingFrom(base::TimeDelta time) final; 60 void StartPlayingFrom(base::TimeDelta time) final;
61 void SetPlaybackRate(double playback_rate) final; 61 void SetPlaybackRate(double playback_rate) final;
62 void SetVolume(float volume) final; 62 void SetVolume(float volume) final;
63 base::TimeDelta GetMediaTime() final; 63 base::TimeDelta GetMediaTime() final;
64 bool HasAudio() final; 64 bool HasAudio() final;
65 bool HasVideo() final; 65 bool HasVideo() final;
66 void OnEnabledAudioStreamsChanged(
67 const std::vector<const DemuxerStream*>& enabledAudioStreams) final;
68 void OnSelectedVideoStreamChanged(
69 const DemuxerStream* selectedVideoStream) final;
66 70
67 // Helper functions for testing purposes. Must be called before Initialize(). 71 // Helper functions for testing purposes. Must be called before Initialize().
68 void DisableUnderflowForTesting(); 72 void DisableUnderflowForTesting();
69 void EnableClocklessVideoPlaybackForTesting(); 73 void EnableClocklessVideoPlaybackForTesting();
70 void set_time_source_for_testing(TimeSource* time_source) { 74 void set_time_source_for_testing(TimeSource* time_source) {
71 time_source_ = time_source; 75 time_source_ = time_source;
72 } 76 }
73 void set_video_underflow_threshold_for_testing(base::TimeDelta threshold) { 77 void set_video_underflow_threshold_for_testing(base::TimeDelta threshold) {
74 video_underflow_threshold_ = threshold; 78 video_underflow_threshold_ = threshold;
75 } 79 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 BufferingStateCB buffering_state_cb_; 148 BufferingStateCB buffering_state_cb_;
145 base::Closure waiting_for_decryption_key_cb_; 149 base::Closure waiting_for_decryption_key_cb_;
146 150
147 // Temporary callback used for Initialize() and Flush(). 151 // Temporary callback used for Initialize() and Flush().
148 PipelineStatusCB init_cb_; 152 PipelineStatusCB init_cb_;
149 base::Closure flush_cb_; 153 base::Closure flush_cb_;
150 154
151 scoped_ptr<AudioRenderer> audio_renderer_; 155 scoped_ptr<AudioRenderer> audio_renderer_;
152 scoped_ptr<VideoRenderer> video_renderer_; 156 scoped_ptr<VideoRenderer> video_renderer_;
153 157
158 bool audio_stream_currently_disabled_ = false;
159 float audio_volume_ = 1.0f;
160
154 // Renderer-provided time source used to control playback. 161 // Renderer-provided time source used to control playback.
155 TimeSource* time_source_; 162 TimeSource* time_source_;
156 scoped_ptr<WallClockTimeSource> wall_clock_time_source_; 163 scoped_ptr<WallClockTimeSource> wall_clock_time_source_;
157 bool time_ticking_; 164 bool time_ticking_;
158 double playback_rate_; 165 double playback_rate_;
159 166
160 // The time to start playback from after starting/seeking has completed. 167 // The time to start playback from after starting/seeking has completed.
161 base::TimeDelta start_time_; 168 base::TimeDelta start_time_;
162 169
163 BufferingState audio_buffering_state_; 170 BufferingState audio_buffering_state_;
(...skipping 18 matching lines...) Expand all
182 189
183 base::WeakPtr<RendererImpl> weak_this_; 190 base::WeakPtr<RendererImpl> weak_this_;
184 base::WeakPtrFactory<RendererImpl> weak_factory_; 191 base::WeakPtrFactory<RendererImpl> weak_factory_;
185 192
186 DISALLOW_COPY_AND_ASSIGN(RendererImpl); 193 DISALLOW_COPY_AND_ASSIGN(RendererImpl);
187 }; 194 };
188 195
189 } // namespace media 196 } // namespace media
190 197
191 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_ 198 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_
OLDNEW
« no previous file with comments | « media/filters/media_source_state.cc ('k') | media/renderers/renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698