OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/canvas_capture_handler.h" | 5 #include "content/renderer/media/canvas_capture_handler.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 std::unique_ptr<media::VideoCapturerSource> source, | 256 std::unique_ptr<media::VideoCapturerSource> source, |
257 blink::WebMediaStreamTrack* web_track) { | 257 blink::WebMediaStreamTrack* web_track) { |
258 std::string str_track_id; | 258 std::string str_track_id; |
259 base::Base64Encode(base::RandBytesAsString(64), &str_track_id); | 259 base::Base64Encode(base::RandBytesAsString(64), &str_track_id); |
260 const blink::WebString track_id = base::UTF8ToUTF16(str_track_id); | 260 const blink::WebString track_id = base::UTF8ToUTF16(str_track_id); |
261 blink::WebMediaStreamSource webkit_source; | 261 blink::WebMediaStreamSource webkit_source; |
262 std::unique_ptr<MediaStreamVideoSource> media_stream_source( | 262 std::unique_ptr<MediaStreamVideoSource> media_stream_source( |
263 new MediaStreamVideoCapturerSource( | 263 new MediaStreamVideoCapturerSource( |
264 MediaStreamSource::SourceStoppedCallback(), std::move(source))); | 264 MediaStreamSource::SourceStoppedCallback(), std::move(source))); |
265 webkit_source.initialize(track_id, blink::WebMediaStreamSource::TypeVideo, | 265 webkit_source.initialize(track_id, blink::WebMediaStreamSource::TypeVideo, |
266 track_id, false); | 266 track_id); |
267 webkit_source.setExtraData(media_stream_source.get()); | 267 webkit_source.setExtraData(media_stream_source.get()); |
268 | 268 |
269 web_track->initialize(webkit_source); | 269 web_track->initialize(webkit_source); |
270 blink::WebMediaConstraints constraints; | 270 blink::WebMediaConstraints constraints; |
271 constraints.initialize(); | 271 constraints.initialize(); |
272 web_track->setTrackData(new MediaStreamVideoTrack( | 272 web_track->setTrackData(new MediaStreamVideoTrack( |
273 media_stream_source.release(), constraints, | 273 media_stream_source.release(), constraints, |
274 MediaStreamVideoSource::ConstraintsCallback(), true)); | 274 MediaStreamVideoSource::ConstraintsCallback(), true)); |
275 } | 275 } |
276 | 276 |
277 } // namespace content | 277 } // namespace content |
OLD | NEW |