OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/remote_media_stream_impl.h" | 5 #include "content/renderer/media/remote_media_stream_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 virtual ~RemoteMediaStreamTrackAdapter() { | 95 virtual ~RemoteMediaStreamTrackAdapter() { |
96 DCHECK(main_thread_->BelongsToCurrentThread()); | 96 DCHECK(main_thread_->BelongsToCurrentThread()); |
97 } | 97 } |
98 | 98 |
99 void InitializeWebkitTrack(blink::WebMediaStreamSource::Type type) { | 99 void InitializeWebkitTrack(blink::WebMediaStreamSource::Type type) { |
100 DCHECK(main_thread_->BelongsToCurrentThread()); | 100 DCHECK(main_thread_->BelongsToCurrentThread()); |
101 DCHECK(webkit_track_.isNull()); | 101 DCHECK(webkit_track_.isNull()); |
102 | 102 |
103 blink::WebString webkit_track_id(blink::WebString::fromUTF8(id_)); | 103 blink::WebString webkit_track_id(blink::WebString::fromUTF8(id_)); |
104 blink::WebMediaStreamSource webkit_source; | 104 blink::WebMediaStreamSource webkit_source; |
105 webkit_source.initialize(webkit_track_id, type, webkit_track_id); | 105 webkit_source.initialize(webkit_track_id, type, webkit_track_id, |
| 106 true /* remote */); |
106 webkit_track_.initialize(webkit_track_id, webkit_source); | 107 webkit_track_.initialize(webkit_track_id, webkit_source); |
107 DCHECK(!webkit_track_.isNull()); | 108 DCHECK(!webkit_track_.isNull()); |
108 } | 109 } |
109 | 110 |
110 const scoped_refptr<base::SingleThreadTaskRunner> main_thread_; | 111 const scoped_refptr<base::SingleThreadTaskRunner> main_thread_; |
111 // This callback will be run when Initialize() is called and then freed. | 112 // This callback will be run when Initialize() is called and then freed. |
112 // The callback is used by derived classes to bind objects that need to be | 113 // The callback is used by derived classes to bind objects that need to be |
113 // instantiated and initialized on the signaling thread but then moved to | 114 // instantiated and initialized on the signaling thread but then moved to |
114 // and used on the main thread when initializing the webkit object(s). | 115 // and used on the main thread when initializing the webkit object(s). |
115 base::Callback<void()> webkit_initialize_; | 116 base::Callback<void()> webkit_initialize_; |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 // Unregister all the audio track observers that were not used. | 423 // Unregister all the audio track observers that were not used. |
423 // We need to do this before destruction since the observers can't unregister | 424 // We need to do this before destruction since the observers can't unregister |
424 // from within the dtor due to a race. | 425 // from within the dtor due to a race. |
425 for (auto& track : *audio_tracks.get()) { | 426 for (auto& track : *audio_tracks.get()) { |
426 if (track.get()) | 427 if (track.get()) |
427 track->Unregister(); | 428 track->Unregister(); |
428 } | 429 } |
429 } | 430 } |
430 | 431 |
431 } // namespace content | 432 } // namespace content |
OLD | NEW |