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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 2755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2766 sink = device; | 2766 sink = device; |
2767 DVLOG(1) << "Using AudioDeviceFactory-provided sink: " << sink; | 2767 DVLOG(1) << "Using AudioDeviceFactory-provided sink: " << sink; |
2768 } | 2768 } |
2769 } | 2769 } |
2770 | 2770 |
2771 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories; | 2771 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories; |
2772 WebGraphicsContext3DCommandBufferImpl* context3d = NULL; | 2772 WebGraphicsContext3DCommandBufferImpl* context3d = NULL; |
2773 if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) | 2773 if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) |
2774 context3d = RenderThreadImpl::current()->GetGpuVDAContext3D(); | 2774 context3d = RenderThreadImpl::current()->GetGpuVDAContext3D(); |
2775 if (context3d) { | 2775 if (context3d) { |
2776 scoped_refptr<base::MessageLoopProxy> factories_loop = | 2776 scoped_refptr<base::MessageLoopProxy> factories_loop; |
2777 RenderThreadImpl::current()->compositor_thread() ? | 2777 CompositorThread* compositor_thread = |
2778 RenderThreadImpl::current()->compositor_thread()->GetWebThread() | 2778 RenderThreadImpl::current()->compositor_thread(); |
2779 ->message_loop()->message_loop_proxy() : | 2779 if (compositor_thread) |
2780 base::MessageLoopProxy::current(); | 2780 factories_loop = compositor_thread->message_loop_proxy(); |
| 2781 else |
| 2782 factories_loop = base::MessageLoopProxy::current(); |
2781 GpuChannelHost* gpu_channel_host = | 2783 GpuChannelHost* gpu_channel_host = |
2782 RenderThreadImpl::current()->EstablishGpuChannelSync( | 2784 RenderThreadImpl::current()->EstablishGpuChannelSync( |
2783 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); | 2785 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); |
2784 gpu_factories = new RendererGpuVideoDecoderFactories( | 2786 gpu_factories = new RendererGpuVideoDecoderFactories( |
2785 gpu_channel_host, factories_loop, context3d); | 2787 gpu_channel_host, factories_loop, context3d); |
2786 } | 2788 } |
2787 | 2789 |
2788 webkit_media::WebMediaPlayerParams params( | 2790 webkit_media::WebMediaPlayerParams params( |
2789 sink, gpu_factories, new RenderMediaLog()); | 2791 sink, gpu_factories, new RenderMediaLog()); |
2790 WebMediaPlayer* media_player = | 2792 WebMediaPlayer* media_player = |
(...skipping 3929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6720 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6722 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
6721 RenderProcess::current()->ReleaseTransportDIB(dib); | 6723 RenderProcess::current()->ReleaseTransportDIB(dib); |
6722 } | 6724 } |
6723 | 6725 |
6724 void RenderViewImpl::DidCommitCompositorFrame() { | 6726 void RenderViewImpl::DidCommitCompositorFrame() { |
6725 RenderWidget::DidCommitCompositorFrame(); | 6727 RenderWidget::DidCommitCompositorFrame(); |
6726 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); | 6728 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); |
6727 } | 6729 } |
6728 | 6730 |
6729 } // namespace content | 6731 } // namespace content |
OLD | NEW |