| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/media/webmediaplayer_ms.h" | 5 #include "content/renderer/media/webmediaplayer_ms.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 // TODO(perkj, magjed): See TODO in OnPlay(). | 572 // TODO(perkj, magjed): See TODO in OnPlay(). |
| 573 } | 573 } |
| 574 | 574 |
| 575 void WebMediaPlayerMS::OnVolumeMultiplierUpdate(double multiplier) { | 575 void WebMediaPlayerMS::OnVolumeMultiplierUpdate(double multiplier) { |
| 576 // TODO(perkj, magjed): See TODO in OnPlay(). | 576 // TODO(perkj, magjed): See TODO in OnPlay(). |
| 577 } | 577 } |
| 578 | 578 |
| 579 bool WebMediaPlayerMS::copyVideoTextureToPlatformTexture( | 579 bool WebMediaPlayerMS::copyVideoTextureToPlatformTexture( |
| 580 gpu::gles2::GLES2Interface* gl, | 580 gpu::gles2::GLES2Interface* gl, |
| 581 unsigned int texture, | 581 unsigned int texture, |
| 582 unsigned int internal_format, | |
| 583 unsigned int type, | |
| 584 bool premultiply_alpha, | 582 bool premultiply_alpha, |
| 585 bool flip_y) { | 583 bool flip_y) { |
| 586 TRACE_EVENT0("media", "WebMediaPlayerMS:copyVideoTextureToPlatformTexture"); | 584 TRACE_EVENT0("media", "WebMediaPlayerMS:copyVideoTextureToPlatformTexture"); |
| 587 DCHECK(thread_checker_.CalledOnValidThread()); | 585 DCHECK(thread_checker_.CalledOnValidThread()); |
| 588 | 586 |
| 589 scoped_refptr<media::VideoFrame> video_frame = | 587 scoped_refptr<media::VideoFrame> video_frame = |
| 590 compositor_->GetCurrentFrameWithoutUpdatingStatistics(); | 588 compositor_->GetCurrentFrameWithoutUpdatingStatistics(); |
| 591 | 589 |
| 592 if (!video_frame.get() || !video_frame->HasTextures()) | 590 if (!video_frame.get() || !video_frame->HasTextures()) |
| 593 return false; | 591 return false; |
| 594 | 592 |
| 595 media::Context3D context_3d; | 593 media::Context3D context_3d; |
| 596 auto* provider = | 594 auto* provider = |
| 597 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 595 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
| 598 // GPU Process crashed. | 596 // GPU Process crashed. |
| 599 if (!provider) | 597 if (!provider) |
| 600 return false; | 598 return false; |
| 601 context_3d = media::Context3D(provider->ContextGL(), provider->GrContext()); | 599 context_3d = media::Context3D(provider->ContextGL(), provider->GrContext()); |
| 602 DCHECK(context_3d.gl); | 600 DCHECK(context_3d.gl); |
| 603 return video_renderer_.CopyVideoFrameTexturesToGLTexture( | 601 return video_renderer_.CopyVideoFrameTexturesToGLTexture( |
| 604 context_3d, gl, video_frame.get(), texture, internal_format, type, | 602 context_3d, gl, video_frame.get(), texture, premultiply_alpha, flip_y); |
| 605 premultiply_alpha, flip_y); | |
| 606 } | 603 } |
| 607 | 604 |
| 608 bool WebMediaPlayerMS::texImageImpl(TexImageFunctionID functionID, | 605 bool WebMediaPlayerMS::texImageImpl(TexImageFunctionID functionID, |
| 609 unsigned target, | 606 unsigned target, |
| 610 gpu::gles2::GLES2Interface* gl, | 607 gpu::gles2::GLES2Interface* gl, |
| 611 int level, | 608 int level, |
| 612 int internalformat, | 609 int internalformat, |
| 613 unsigned format, | 610 unsigned format, |
| 614 unsigned type, | 611 unsigned type, |
| 615 int xoffset, | 612 int xoffset, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 void WebMediaPlayerMS::ResetCanvasCache() { | 702 void WebMediaPlayerMS::ResetCanvasCache() { |
| 706 DCHECK(thread_checker_.CalledOnValidThread()); | 703 DCHECK(thread_checker_.CalledOnValidThread()); |
| 707 video_renderer_.ResetCache(); | 704 video_renderer_.ResetCache(); |
| 708 } | 705 } |
| 709 | 706 |
| 710 void WebMediaPlayerMS::TriggerResize() { | 707 void WebMediaPlayerMS::TriggerResize() { |
| 711 get_client()->sizeChanged(); | 708 get_client()->sizeChanged(); |
| 712 } | 709 } |
| 713 | 710 |
| 714 } // namespace content | 711 } // namespace content |
| OLD | NEW |