| 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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 void WebMediaPlayerMS::OnVolumeMultiplierUpdate(double multiplier) { | 570 void WebMediaPlayerMS::OnVolumeMultiplierUpdate(double multiplier) { |
| 571 // TODO(perkj, magjed): See TODO in OnPlay(). | 571 // TODO(perkj, magjed): See TODO in OnPlay(). |
| 572 } | 572 } |
| 573 | 573 |
| 574 void WebMediaPlayerMS::OnBecamePersistentVideo(bool value) { | 574 void WebMediaPlayerMS::OnBecamePersistentVideo(bool value) { |
| 575 get_client()->OnBecamePersistentVideo(value); | 575 get_client()->OnBecamePersistentVideo(value); |
| 576 } | 576 } |
| 577 | 577 |
| 578 bool WebMediaPlayerMS::CopyVideoTextureToPlatformTexture( | 578 bool WebMediaPlayerMS::CopyVideoTextureToPlatformTexture( |
| 579 gpu::gles2::GLES2Interface* gl, | 579 gpu::gles2::GLES2Interface* gl, |
| 580 unsigned target, |
| 580 unsigned int texture, | 581 unsigned int texture, |
| 581 unsigned internal_format, | 582 unsigned internal_format, |
| 582 unsigned format, | 583 unsigned format, |
| 583 unsigned type, | 584 unsigned type, |
| 585 int level, |
| 584 bool premultiply_alpha, | 586 bool premultiply_alpha, |
| 585 bool flip_y) { | 587 bool flip_y) { |
| 586 TRACE_EVENT0("media", "WebMediaPlayerMS:copyVideoTextureToPlatformTexture"); | 588 TRACE_EVENT0("media", "WebMediaPlayerMS:copyVideoTextureToPlatformTexture"); |
| 587 DCHECK(thread_checker_.CalledOnValidThread()); | 589 DCHECK(thread_checker_.CalledOnValidThread()); |
| 588 | 590 |
| 589 scoped_refptr<media::VideoFrame> video_frame = | 591 scoped_refptr<media::VideoFrame> video_frame = |
| 590 compositor_->GetCurrentFrameWithoutUpdatingStatistics(); | 592 compositor_->GetCurrentFrameWithoutUpdatingStatistics(); |
| 591 | 593 |
| 592 if (!video_frame.get() || !video_frame->HasTextures()) | 594 if (!video_frame.get() || !video_frame->HasTextures()) |
| 593 return false; | 595 return false; |
| 594 | 596 |
| 595 media::Context3D context_3d; | 597 media::Context3D context_3d; |
| 596 auto* provider = | 598 auto* provider = |
| 597 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 599 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
| 598 // GPU Process crashed. | 600 // GPU Process crashed. |
| 599 if (!provider) | 601 if (!provider) |
| 600 return false; | 602 return false; |
| 601 context_3d = media::Context3D(provider->ContextGL(), provider->GrContext()); | 603 context_3d = media::Context3D(provider->ContextGL(), provider->GrContext()); |
| 602 DCHECK(context_3d.gl); | 604 DCHECK(context_3d.gl); |
| 603 return video_renderer_.CopyVideoFrameTexturesToGLTexture( | 605 return video_renderer_.CopyVideoFrameTexturesToGLTexture( |
| 604 context_3d, gl, video_frame.get(), texture, internal_format, format, type, | 606 context_3d, gl, video_frame.get(), target, texture, internal_format, |
| 605 premultiply_alpha, flip_y); | 607 format, type, level, premultiply_alpha, flip_y); |
| 606 } | 608 } |
| 607 | 609 |
| 608 bool WebMediaPlayerMS::TexImageImpl(TexImageFunctionID functionID, | 610 bool WebMediaPlayerMS::TexImageImpl(TexImageFunctionID functionID, |
| 609 unsigned target, | 611 unsigned target, |
| 610 gpu::gles2::GLES2Interface* gl, | 612 gpu::gles2::GLES2Interface* gl, |
| 611 unsigned int texture, | 613 unsigned int texture, |
| 612 int level, | 614 int level, |
| 613 int internalformat, | 615 int internalformat, |
| 614 unsigned format, | 616 unsigned format, |
| 615 unsigned type, | 617 unsigned type, |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 void WebMediaPlayerMS::ResetCanvasCache() { | 715 void WebMediaPlayerMS::ResetCanvasCache() { |
| 714 DCHECK(thread_checker_.CalledOnValidThread()); | 716 DCHECK(thread_checker_.CalledOnValidThread()); |
| 715 video_renderer_.ResetCache(); | 717 video_renderer_.ResetCache(); |
| 716 } | 718 } |
| 717 | 719 |
| 718 void WebMediaPlayerMS::TriggerResize() { | 720 void WebMediaPlayerMS::TriggerResize() { |
| 719 get_client()->SizeChanged(); | 721 get_client()->SizeChanged(); |
| 720 } | 722 } |
| 721 | 723 |
| 722 } // namespace content | 724 } // namespace content |
| OLD | NEW |