| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 std::unique_ptr<media::VideoCapturerSource> source, | 273 std::unique_ptr<media::VideoCapturerSource> source, |
| 274 blink::WebMediaStreamTrack* web_track) { | 274 blink::WebMediaStreamTrack* web_track) { |
| 275 std::string str_track_id; | 275 std::string str_track_id; |
| 276 base::Base64Encode(base::RandBytesAsString(64), &str_track_id); | 276 base::Base64Encode(base::RandBytesAsString(64), &str_track_id); |
| 277 const blink::WebString track_id = base::UTF8ToUTF16(str_track_id); | 277 const blink::WebString track_id = base::UTF8ToUTF16(str_track_id); |
| 278 blink::WebMediaStreamSource webkit_source; | 278 blink::WebMediaStreamSource webkit_source; |
| 279 std::unique_ptr<MediaStreamVideoSource> media_stream_source( | 279 std::unique_ptr<MediaStreamVideoSource> media_stream_source( |
| 280 new MediaStreamVideoCapturerSource( | 280 new MediaStreamVideoCapturerSource( |
| 281 MediaStreamSource::SourceStoppedCallback(), std::move(source))); | 281 MediaStreamSource::SourceStoppedCallback(), std::move(source))); |
| 282 webkit_source.initialize(track_id, blink::WebMediaStreamSource::TypeVideo, | 282 webkit_source.initialize(track_id, blink::WebMediaStreamSource::TypeVideo, |
| 283 track_id, false, true); | 283 track_id, false); |
| 284 webkit_source.setExtraData(media_stream_source.get()); | 284 webkit_source.setExtraData(media_stream_source.get()); |
| 285 | 285 |
| 286 web_track->initialize(webkit_source); | 286 web_track->initialize(webkit_source); |
| 287 blink::WebMediaConstraints constraints; | 287 blink::WebMediaConstraints constraints; |
| 288 constraints.initialize(); | 288 constraints.initialize(); |
| 289 web_track->setExtraData(new MediaStreamVideoTrack( | 289 web_track->setExtraData(new MediaStreamVideoTrack( |
| 290 media_stream_source.release(), constraints, | 290 media_stream_source.release(), constraints, |
| 291 MediaStreamVideoSource::ConstraintsCallback(), true)); | 291 MediaStreamVideoSource::ConstraintsCallback(), true)); |
| 292 } | 292 } |
| 293 | 293 |
| 294 } // namespace content | 294 } // namespace content |
| OLD | NEW |