OLD | NEW |
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/pepper/pepper_media_stream_video_track_host.h" | 5 #include "content/renderer/pepper/pepper_media_stream_video_track_host.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 | 378 |
379 // Makes the frame available again for plugin. | 379 // Makes the frame available again for plugin. |
380 SendEnqueueBufferMessageToPlugin(index); | 380 SendEnqueueBufferMessageToPlugin(index); |
381 return PP_OK; | 381 return PP_OK; |
382 } | 382 } |
383 | 383 |
384 void PepperMediaStreamVideoTrackHost::OnVideoFrame( | 384 void PepperMediaStreamVideoTrackHost::OnVideoFrame( |
385 const scoped_refptr<VideoFrame>& frame, | 385 const scoped_refptr<VideoFrame>& frame, |
386 const media::VideoCaptureFormat& format, | 386 const media::VideoCaptureFormat& format, |
387 const base::TimeTicks& estimated_capture_time) { | 387 const base::TimeTicks& estimated_capture_time) { |
388 DCHECK(frame); | 388 DCHECK(frame.get()); |
389 // TODO(penghuang): Check |frame->end_of_stream()| and close the track. | 389 // TODO(penghuang): Check |frame->end_of_stream()| and close the track. |
390 PP_VideoFrame_Format ppformat = ToPpapiFormat(frame->format()); | 390 PP_VideoFrame_Format ppformat = ToPpapiFormat(frame->format()); |
391 if (ppformat == PP_VIDEOFRAME_FORMAT_UNKNOWN) | 391 if (ppformat == PP_VIDEOFRAME_FORMAT_UNKNOWN) |
392 return; | 392 return; |
393 | 393 |
394 if (source_frame_size_.IsEmpty()) { | 394 if (source_frame_size_.IsEmpty()) { |
395 source_frame_size_ = frame->coded_size(); | 395 source_frame_size_ = frame->coded_size(); |
396 source_frame_format_ = ppformat; | 396 source_frame_format_ = ppformat; |
397 InitBuffers(); | 397 InitBuffers(); |
398 } | 398 } |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 } | 538 } |
539 | 539 |
540 void PepperMediaStreamVideoTrackHost::OnTrackStarted( | 540 void PepperMediaStreamVideoTrackHost::OnTrackStarted( |
541 MediaStreamSource* source, | 541 MediaStreamSource* source, |
542 MediaStreamRequestResult result, | 542 MediaStreamRequestResult result, |
543 const blink::WebString& result_name) { | 543 const blink::WebString& result_name) { |
544 DVLOG(3) << "OnTrackStarted result: " << result; | 544 DVLOG(3) << "OnTrackStarted result: " << result; |
545 } | 545 } |
546 | 546 |
547 } // namespace content | 547 } // namespace content |
OLD | NEW |