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/video_decoder_shim.h" | 5 #include "content/renderer/pepper/video_decoder_shim.h" |
6 | 6 |
7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
8 #include <GLES2/gl2ext.h> | 8 #include <GLES2/gl2ext.h> |
9 #include <GLES2/gl2extchromium.h> | 9 #include <GLES2/gl2extchromium.h> |
10 | 10 |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 &VideoDecoderShim::OnDecodeComplete, shim_, result, decode_id)); | 249 &VideoDecoderShim::OnDecodeComplete, shim_, result, decode_id)); |
250 | 250 |
251 DoDecode(); | 251 DoDecode(); |
252 } | 252 } |
253 | 253 |
254 void VideoDecoderShim::DecoderImpl::OnOutputComplete( | 254 void VideoDecoderShim::DecoderImpl::OnOutputComplete( |
255 const scoped_refptr<media::VideoFrame>& frame) { | 255 const scoped_refptr<media::VideoFrame>& frame) { |
256 scoped_ptr<PendingFrame> pending_frame; | 256 scoped_ptr<PendingFrame> pending_frame; |
257 if (!frame->end_of_stream()) { | 257 if (!frame->end_of_stream()) { |
258 pending_frame.reset(new PendingFrame(decode_id_, frame->coded_size())); | 258 pending_frame.reset(new PendingFrame(decode_id_, frame->coded_size())); |
259 // Convert the VideoFrame pixels to ARGB. | 259 // Convert the VideoFrame pixels to ABGR to match VideoDecodeAccelerator. |
260 libyuv::I420ToARGB(frame->data(media::VideoFrame::kYPlane), | 260 libyuv::I420ToABGR(frame->data(media::VideoFrame::kYPlane), |
261 frame->stride(media::VideoFrame::kYPlane), | 261 frame->stride(media::VideoFrame::kYPlane), |
262 frame->data(media::VideoFrame::kUPlane), | 262 frame->data(media::VideoFrame::kUPlane), |
263 frame->stride(media::VideoFrame::kUPlane), | 263 frame->stride(media::VideoFrame::kUPlane), |
264 frame->data(media::VideoFrame::kVPlane), | 264 frame->data(media::VideoFrame::kVPlane), |
265 frame->stride(media::VideoFrame::kVPlane), | 265 frame->stride(media::VideoFrame::kVPlane), |
266 &pending_frame->argb_pixels.front(), | 266 &pending_frame->argb_pixels.front(), |
267 frame->coded_size().width() * 4, | 267 frame->coded_size().width() * 4, |
268 frame->coded_size().width(), | 268 frame->coded_size().width(), |
269 frame->coded_size().height()); | 269 frame->coded_size().height()); |
270 } else { | 270 } else { |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) { | 586 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) { |
587 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); | 587 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); |
588 gles2->DeleteTextures(1, &texture_id); | 588 gles2->DeleteTextures(1, &texture_id); |
589 } | 589 } |
590 | 590 |
591 void VideoDecoderShim::FlushCommandBuffer() { | 591 void VideoDecoderShim::FlushCommandBuffer() { |
592 context_provider_->ContextGL()->Flush(); | 592 context_provider_->ContextGL()->Flush(); |
593 } | 593 } |
594 | 594 |
595 } // namespace content | 595 } // namespace content |
OLD | NEW |