| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 InitBuffers(); | 383 InitBuffers(); |
| 384 } | 384 } |
| 385 | 385 |
| 386 int32_t index = buffer_manager()->DequeueBuffer(); | 386 int32_t index = buffer_manager()->DequeueBuffer(); |
| 387 // Drop frames if the underlying buffer is full. | 387 // Drop frames if the underlying buffer is full. |
| 388 if (index < 0) { | 388 if (index < 0) { |
| 389 DVLOG(1) << "A frame is dropped."; | 389 DVLOG(1) << "A frame is dropped."; |
| 390 return; | 390 return; |
| 391 } | 391 } |
| 392 | 392 |
| 393 CHECK_EQ(ppformat, source_frame_format_) << "Frame format is changed."; | 393 // Frame format is changed. |
| 394 CHECK_EQ(ppformat, source_frame_format_); |
| 394 | 395 |
| 395 gfx::Size size = GetTargetSize(source_frame_size_, plugin_frame_size_); | 396 gfx::Size size = GetTargetSize(source_frame_size_, plugin_frame_size_); |
| 396 ppformat = | 397 ppformat = |
| 397 GetTargetFormat(source_frame_format_, plugin_frame_format_); | 398 GetTargetFormat(source_frame_format_, plugin_frame_format_); |
| 398 ppapi::MediaStreamBuffer::Video* buffer = | 399 ppapi::MediaStreamBuffer::Video* buffer = |
| 399 &(buffer_manager()->GetBufferPointer(index)->video); | 400 &(buffer_manager()->GetBufferPointer(index)->video); |
| 400 buffer->header.size = buffer_manager()->buffer_size(); | 401 buffer->header.size = buffer_manager()->buffer_size(); |
| 401 buffer->header.type = ppapi::MediaStreamBuffer::TYPE_VIDEO; | 402 buffer->header.type = ppapi::MediaStreamBuffer::TYPE_VIDEO; |
| 402 buffer->timestamp = frame->timestamp().InSecondsF(); | 403 buffer->timestamp = frame->timestamp().InSecondsF(); |
| 403 buffer->format = ppformat; | 404 buffer->format = ppformat; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 } | 540 } |
| 540 | 541 |
| 541 void PepperMediaStreamVideoTrackHost::OnTrackStarted( | 542 void PepperMediaStreamVideoTrackHost::OnTrackStarted( |
| 542 MediaStreamSource* source, | 543 MediaStreamSource* source, |
| 543 MediaStreamRequestResult result, | 544 MediaStreamRequestResult result, |
| 544 const blink::WebString& result_name) { | 545 const blink::WebString& result_name) { |
| 545 DVLOG(3) << "OnTrackStarted result: " << result; | 546 DVLOG(3) << "OnTrackStarted result: " << result; |
| 546 } | 547 } |
| 547 | 548 |
| 548 } // namespace content | 549 } // namespace content |
| OLD | NEW |