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

Side by Side Diff: content/renderer/media/media_stream_audio_track.cc

Issue 2501623003: Implement MediaStreamTrack contentHint skeleton. (Closed)
Patch Set: ContentHint -> ContentHintType Created 4 years 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 #include "content/renderer/media/media_stream_audio_track.h" 5 #include "content/renderer/media/media_stream_audio_track.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "content/public/renderer/media_stream_audio_sink.h" 9 #include "content/public/renderer/media_stream_audio_sink.h"
10 #include "media/base/audio_bus.h" 10 #include "media/base/audio_bus.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 !!base::subtle::NoBarrier_AtomicExchange(&is_enabled_, enabled ? 1 : 0); 71 !!base::subtle::NoBarrier_AtomicExchange(&is_enabled_, enabled ? 1 : 0);
72 if (enabled == previously_enabled) 72 if (enabled == previously_enabled)
73 return; 73 return;
74 74
75 std::vector<MediaStreamAudioSink*> sinks_to_notify; 75 std::vector<MediaStreamAudioSink*> sinks_to_notify;
76 deliverer_.GetConsumerList(&sinks_to_notify); 76 deliverer_.GetConsumerList(&sinks_to_notify);
77 for (MediaStreamAudioSink* sink : sinks_to_notify) 77 for (MediaStreamAudioSink* sink : sinks_to_notify)
78 sink->OnEnabledChanged(enabled); 78 sink->OnEnabledChanged(enabled);
79 } 79 }
80 80
81 void MediaStreamAudioTrack::SetContentHint(
82 blink::WebMediaStreamTrack::ContentHintType content_hint) {
83 DCHECK(thread_checker_.CalledOnValidThread());
84
85 std::vector<MediaStreamAudioSink*> sinks_to_notify;
86 deliverer_.GetConsumerList(&sinks_to_notify);
87 for (MediaStreamAudioSink* sink : sinks_to_notify)
88 sink->OnContentHintChanged(content_hint);
89 }
90
81 void* MediaStreamAudioTrack::GetClassIdentifier() const { 91 void* MediaStreamAudioTrack::GetClassIdentifier() const {
82 return nullptr; 92 return nullptr;
83 } 93 }
84 94
85 void MediaStreamAudioTrack::Start(const base::Closure& stop_callback) { 95 void MediaStreamAudioTrack::Start(const base::Closure& stop_callback) {
86 DCHECK(thread_checker_.CalledOnValidThread()); 96 DCHECK(thread_checker_.CalledOnValidThread());
87 DCHECK(!stop_callback.is_null()); 97 DCHECK(!stop_callback.is_null());
88 DCHECK(stop_callback_.is_null()); 98 DCHECK(stop_callback_.is_null());
89 DVLOG(1) << "Starting MediaStreamAudioTrack@" << this << '.'; 99 DVLOG(1) << "Starting MediaStreamAudioTrack@" << this << '.';
90 stop_callback_ = stop_callback; 100 stop_callback_ = stop_callback;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 141 }
132 } 142 }
133 143
134 void MediaStreamAudioTrack::getSettings( 144 void MediaStreamAudioTrack::getSettings(
135 blink::WebMediaStreamTrack::Settings& settings) { 145 blink::WebMediaStreamTrack::Settings& settings) {
136 // TODO(hta): Extract the real value. 146 // TODO(hta): Extract the real value.
137 settings.deviceId = blink::WebString("audio device ID"); 147 settings.deviceId = blink::WebString("audio device ID");
138 } 148 }
139 149
140 } // namespace content 150 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698