Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 8980008: Integrate HTMLMediaElement with Web Audio API's MediaElementAudioSourceNode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 1921 matching lines...) Expand 10 before | Expand all | Expand 10 after
1932 FOR_EACH_OBSERVER( 1932 FOR_EACH_OBSERVER(
1933 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); 1933 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client));
1934 1934
1935 media::MessageLoopFactory* message_loop_factory = 1935 media::MessageLoopFactory* message_loop_factory =
1936 new media::MessageLoopFactoryImpl(); 1936 new media::MessageLoopFactoryImpl();
1937 media::FilterCollection* collection = new media::FilterCollection(); 1937 media::FilterCollection* collection = new media::FilterCollection();
1938 RenderMediaLog* render_media_log = new RenderMediaLog(); 1938 RenderMediaLog* render_media_log = new RenderMediaLog();
1939 1939
1940 // Add in any custom filter factories first. 1940 // Add in any custom filter factories first.
1941 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 1941 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
1942
1943 AudioRendererImpl* audio_renderer = NULL;
1942 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { 1944 if (!cmd_line->HasSwitch(switches::kDisableAudio)) {
1943 // Add the chrome specific audio renderer. 1945 // Add the chrome specific audio renderer.
1944 collection->AddAudioRenderer(new AudioRendererImpl()); 1946 audio_renderer = new AudioRendererImpl();
1947 collection->AddAudioRenderer(audio_renderer);
1945 } 1948 }
1946 1949
1947 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) 1950 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
1948 // Currently only cros/arm has any HW video decode support in 1951 // Currently only cros/arm has any HW video decode support in
1949 // GpuVideoDecodeAccelerator so we don't even try to use it on other 1952 // GpuVideoDecodeAccelerator so we don't even try to use it on other
1950 // platforms. This is a startup-time optimization. When new VDA 1953 // platforms. This is a startup-time optimization. When new VDA
1951 // implementations are added, relax the #if above. 1954 // implementations are added, relax the #if above.
1952 WebKit::WebGraphicsContext3D* wk_context3d = webview()->graphicsContext3D(); 1955 WebKit::WebGraphicsContext3D* wk_context3d = webview()->graphicsContext3D();
1953 if (wk_context3d) { 1956 if (wk_context3d) {
1954 WebGraphicsContext3DCommandBufferImpl* context3d = 1957 WebGraphicsContext3DCommandBufferImpl* context3d =
1955 static_cast<WebGraphicsContext3DCommandBufferImpl*>(wk_context3d); 1958 static_cast<WebGraphicsContext3DCommandBufferImpl*>(wk_context3d);
1956 GpuChannelHost* gpu_channel_host = 1959 GpuChannelHost* gpu_channel_host =
1957 RenderThreadImpl::current()->EstablishGpuChannelSync( 1960 RenderThreadImpl::current()->EstablishGpuChannelSync(
1958 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); 1961 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE);
1959 collection->AddVideoDecoder(new media::GpuVideoDecoder( 1962 collection->AddVideoDecoder(new media::GpuVideoDecoder(
1960 MessageLoop::current(), 1963 MessageLoop::current(),
1961 new RendererGpuVideoDecoderFactories( 1964 new RendererGpuVideoDecoderFactories(
1962 gpu_channel_host, context3d->context()->AsWeakPtr()))); 1965 gpu_channel_host, context3d->context()->AsWeakPtr())));
1963 } 1966 }
1964 #endif 1967 #endif
1965 1968
1966 webkit_media::WebMediaPlayerImpl* result_ptr; 1969 webkit_media::WebMediaPlayerImpl* result_ptr;
1967 if (!content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( 1970 if (!content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer(
1968 this, client, AsWeakPtr(), collection, message_loop_factory, 1971 this, client, AsWeakPtr(), collection, message_loop_factory,
1969 media_stream_impl_.get(), render_media_log, &result_ptr)) { 1972 media_stream_impl_.get(), render_media_log, &result_ptr)) {
1970 result_ptr = new webkit_media::WebMediaPlayerImpl( 1973 result_ptr = new webkit_media::WebMediaPlayerImpl(
1971 client, AsWeakPtr(), collection, message_loop_factory, 1974 client, AsWeakPtr(), collection, audio_renderer, message_loop_factory,
1972 media_stream_impl_.get(), render_media_log); 1975 media_stream_impl_.get(), render_media_log);
1973 } 1976 }
1974 1977
1975 DCHECK(result_ptr); 1978 DCHECK(result_ptr);
1976 scoped_ptr<webkit_media::WebMediaPlayerImpl> result; 1979 scoped_ptr<webkit_media::WebMediaPlayerImpl> result;
1977 result.reset(result_ptr); 1980 result.reset(result_ptr);
1978 1981
1979 if (!result->Initialize(frame, 1982 if (!result->Initialize(frame,
1980 cmd_line->HasSwitch(switches::kSimpleDataSource))) { 1983 cmd_line->HasSwitch(switches::kSimpleDataSource))) {
1981 return NULL; 1984 return NULL;
(...skipping 2821 matching lines...) Expand 10 before | Expand all | Expand 10 after
4803 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 4806 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
4804 return !!RenderThreadImpl::current()->compositor_thread(); 4807 return !!RenderThreadImpl::current()->compositor_thread();
4805 } 4808 }
4806 4809
4807 void RenderViewImpl::OnJavaBridgeInit() { 4810 void RenderViewImpl::OnJavaBridgeInit() {
4808 DCHECK(!java_bridge_dispatcher_.get()); 4811 DCHECK(!java_bridge_dispatcher_.get());
4809 #if defined(ENABLE_JAVA_BRIDGE) 4812 #if defined(ENABLE_JAVA_BRIDGE)
4810 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); 4813 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this));
4811 #endif 4814 #endif
4812 } 4815 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698