| 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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 InitBuffers(); | 397 InitBuffers(); |
| 398 } | 398 } |
| 399 | 399 |
| 400 int32_t index = buffer_manager()->DequeueBuffer(); | 400 int32_t index = buffer_manager()->DequeueBuffer(); |
| 401 // Drop frames if the underlying buffer is full. | 401 // Drop frames if the underlying buffer is full. |
| 402 if (index < 0) { | 402 if (index < 0) { |
| 403 DVLOG(1) << "A frame is dropped."; | 403 DVLOG(1) << "A frame is dropped."; |
| 404 return; | 404 return; |
| 405 } | 405 } |
| 406 | 406 |
| 407 CHECK(frame->coded_size() == source_frame_size_) << "Frame size is changed"; | |
| 408 CHECK_EQ(ppformat, source_frame_format_) << "Frame format is changed."; | 407 CHECK_EQ(ppformat, source_frame_format_) << "Frame format is changed."; |
| 409 | 408 |
| 410 gfx::Size size = GetTargetSize(source_frame_size_, plugin_frame_size_); | 409 gfx::Size size = GetTargetSize(source_frame_size_, plugin_frame_size_); |
| 411 ppformat = | 410 ppformat = |
| 412 GetTargetFormat(source_frame_format_, plugin_frame_format_); | 411 GetTargetFormat(source_frame_format_, plugin_frame_format_); |
| 413 ppapi::MediaStreamBuffer::Video* buffer = | 412 ppapi::MediaStreamBuffer::Video* buffer = |
| 414 &(buffer_manager()->GetBufferPointer(index)->video); | 413 &(buffer_manager()->GetBufferPointer(index)->video); |
| 415 buffer->header.size = buffer_manager()->buffer_size(); | 414 buffer->header.size = buffer_manager()->buffer_size(); |
| 416 buffer->header.type = ppapi::MediaStreamBuffer::TYPE_VIDEO; | 415 buffer->header.type = ppapi::MediaStreamBuffer::TYPE_VIDEO; |
| 417 buffer->timestamp = frame->timestamp().InSecondsF(); | 416 buffer->timestamp = frame->timestamp().InSecondsF(); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 } | 538 } |
| 540 | 539 |
| 541 void PepperMediaStreamVideoTrackHost::OnTrackStarted( | 540 void PepperMediaStreamVideoTrackHost::OnTrackStarted( |
| 542 MediaStreamSource* source, | 541 MediaStreamSource* source, |
| 543 MediaStreamRequestResult result, | 542 MediaStreamRequestResult result, |
| 544 const blink::WebString& result_name) { | 543 const blink::WebString& result_name) { |
| 545 DVLOG(3) << "OnTrackStarted result: " << result; | 544 DVLOG(3) << "OnTrackStarted result: " << result; |
| 546 } | 545 } |
| 547 | 546 |
| 548 } // namespace content | 547 } // namespace content |
| OLD | NEW |