| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "media/filters/skcanvas_video_renderer.h" | 5 #include "media/filters/skcanvas_video_renderer.h" |
| 6 | 6 |
| 7 #include "gpu/GLES2/gl2extchromium.h" | 7 #include "gpu/GLES2/gl2extchromium.h" |
| 8 #include "gpu/command_buffer/client/gles2_interface.h" | 8 #include "gpu/command_buffer/client/gles2_interface.h" |
| 9 #include "gpu/command_buffer/common/mailbox_holder.h" | 9 #include "gpu/command_buffer/common/mailbox_holder.h" |
| 10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 ConvertVideoFrameToRGBPixels(frame_, pixels, row_bytes); | 347 ConvertVideoFrameToRGBPixels(frame_, pixels, row_bytes); |
| 348 return true; | 348 return true; |
| 349 } | 349 } |
| 350 | 350 |
| 351 bool onGetYUV8Planes(SkISize sizes[3], | 351 bool onGetYUV8Planes(SkISize sizes[3], |
| 352 void* planes[3], | 352 void* planes[3], |
| 353 size_t row_bytes[3], | 353 size_t row_bytes[3], |
| 354 SkYUVColorSpace* color_space) override { | 354 SkYUVColorSpace* color_space) override { |
| 355 if (!frame_.get() || !IsYUV(frame_->format()) || | 355 if (!frame_.get() || !IsYUV(frame_->format()) || |
| 356 // TODO(rileya): Skia currently doesn't support Rec709 YUV conversion, | 356 // TODO(rileya): Skia currently doesn't support Rec709 YUV conversion, |
| 357 // Remove this case once it does. As-is we will fall back on the | 357 // or YUVA conversion. Remove this case once it does. As-is we will |
| 358 // pure-software path in this case. | 358 // fall back on the pure-software path in this case. |
| 359 frame_->format() == VideoFrame::YV12HD) { | 359 frame_->format() == VideoFrame::YV12HD || |
| 360 frame_->format() == VideoFrame::YV12A) { |
| 360 return false; | 361 return false; |
| 361 } | 362 } |
| 362 | 363 |
| 363 if (color_space) { | 364 if (color_space) { |
| 364 if (IsJPEGColorSpace(frame_->format())) | 365 if (IsJPEGColorSpace(frame_->format())) |
| 365 *color_space = kJPEG_SkYUVColorSpace; | 366 *color_space = kJPEG_SkYUVColorSpace; |
| 366 else | 367 else |
| 367 *color_space = kRec601_SkYUVColorSpace; | 368 *color_space = kRec601_SkYUVColorSpace; |
| 368 } | 369 } |
| 369 | 370 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 last_frame_timestamp_ = media::kNoTimestamp(); | 617 last_frame_timestamp_ = media::kNoTimestamp(); |
| 617 } | 618 } |
| 618 | 619 |
| 619 void SkCanvasVideoRenderer::ResetAcceleratedLastFrame() { | 620 void SkCanvasVideoRenderer::ResetAcceleratedLastFrame() { |
| 620 accelerated_last_frame_.reset(); | 621 accelerated_last_frame_.reset(); |
| 621 accelerated_generator_ = nullptr; | 622 accelerated_generator_ = nullptr; |
| 622 accelerated_last_frame_timestamp_ = media::kNoTimestamp(); | 623 accelerated_last_frame_timestamp_ = media::kNoTimestamp(); |
| 623 } | 624 } |
| 624 | 625 |
| 625 } // namespace media | 626 } // namespace media |
| OLD | NEW |