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 */); | |
107 webkit_track_.initialize(webkit_track_id, webkit_source); | 106 webkit_track_.initialize(webkit_track_id, webkit_source); |
108 DCHECK(!webkit_track_.isNull()); | 107 DCHECK(!webkit_track_.isNull()); |
109 } | 108 } |
110 | 109 |
111 const scoped_refptr<base::SingleThreadTaskRunner> main_thread_; | 110 const scoped_refptr<base::SingleThreadTaskRunner> main_thread_; |
112 // This callback will be run when Initialize() is called and then freed. | 111 // This callback will be run when Initialize() is called and then freed. |
113 // The callback is used by derived classes to bind objects that need to be | 112 // The callback is used by derived classes to bind objects that need to be |
114 // instantiated and initialized on the signaling thread but then moved to | 113 // instantiated and initialized on the signaling thread but then moved to |
115 // and used on the main thread when initializing the webkit object(s). | 114 // and used on the main thread when initializing the webkit object(s). |
116 base::Callback<void()> webkit_initialize_; | 115 base::Callback<void()> webkit_initialize_; |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 // Unregister all the audio track observers that were not used. | 422 // Unregister all the audio track observers that were not used. |
424 // We need to do this before destruction since the observers can't unregister | 423 // We need to do this before destruction since the observers can't unregister |
425 // from within the dtor due to a race. | 424 // from within the dtor due to a race. |
426 for (auto& track : *audio_tracks.get()) { | 425 for (auto& track : *audio_tracks.get()) { |
427 if (track.get()) | 426 if (track.get()) |
428 track->Unregister(); | 427 track->Unregister(); |
429 } | 428 } |
430 } | 429 } |
431 | 430 |
432 } // namespace content | 431 } // namespace content |
OLD | NEW |