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

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

Issue 7631033: Very early implementation for HTMLMediaElement / Web Audio API integration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months 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.h" 5 #include "content/renderer/render_view.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>
11 11
12 #include "base/bind.h"
12 #include "base/callback.h" 13 #include "base/callback.h"
13 #include "base/command_line.h" 14 #include "base/command_line.h"
14 #include "base/compiler_specific.h" 15 #include "base/compiler_specific.h"
15 #include "base/json/json_writer.h" 16 #include "base/json/json_writer.h"
16 #include "base/lazy_instance.h" 17 #include "base/lazy_instance.h"
17 #include "base/metrics/histogram.h" 18 #include "base/metrics/histogram.h"
18 #include "base/path_service.h" 19 #include "base/path_service.h"
19 #include "base/process_util.h" 20 #include "base/process_util.h"
20 #include "base/string_piece.h" 21 #include "base/string_piece.h"
21 #include "base/string_split.h" 22 #include "base/string_split.h"
(...skipping 1986 matching lines...) Expand 10 before | Expand all | Expand 10 after
2008 FOR_EACH_OBSERVER( 2009 FOR_EACH_OBSERVER(
2009 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); 2010 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client));
2010 2011
2011 scoped_ptr<media::MessageLoopFactory> message_loop_factory( 2012 scoped_ptr<media::MessageLoopFactory> message_loop_factory(
2012 new media::MessageLoopFactoryImpl()); 2013 new media::MessageLoopFactoryImpl());
2013 scoped_ptr<media::FilterCollection> collection( 2014 scoped_ptr<media::FilterCollection> collection(
2014 new media::FilterCollection()); 2015 new media::FilterCollection());
2015 2016
2016 // Add in any custom filter factories first. 2017 // Add in any custom filter factories first.
2017 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 2018 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
2019 AudioRendererImpl* audio_renderer = NULL;
2018 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { 2020 if (!cmd_line->HasSwitch(switches::kDisableAudio)) {
2019 // Add the chrome specific audio renderer. 2021 // Add the chrome specific audio renderer.
2020 collection->AddAudioRenderer(new AudioRendererImpl()); 2022 audio_renderer = new AudioRendererImpl(MessageLoop::current());
2023 collection->AddAudioRenderer(audio_renderer);
2021 } 2024 }
2022 2025
2023 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer; 2026 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer;
2024 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); 2027 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging);
2025 scoped_refptr<webkit_glue::VideoRendererImpl> renderer( 2028 scoped_refptr<webkit_glue::VideoRendererImpl> renderer(
2026 new webkit_glue::VideoRendererImpl(pts_logging)); 2029 new webkit_glue::VideoRendererImpl(pts_logging));
2027 collection->AddVideoRenderer(renderer); 2030 collection->AddVideoRenderer(renderer);
2028 video_renderer = renderer; 2031 video_renderer = renderer;
2029 2032
2030 scoped_ptr<webkit_glue::WebMediaPlayerImpl> result( 2033 scoped_ptr<webkit_glue::WebMediaPlayerImpl> result(
2031 new webkit_glue::WebMediaPlayerImpl(client, 2034 new webkit_glue::WebMediaPlayerImpl(client,
2032 collection.release(), 2035 collection.release(),
2036 audio_renderer,
2033 message_loop_factory.release(), 2037 message_loop_factory.release(),
2034 media_stream_impl_.get(), 2038 media_stream_impl_.get(),
2035 new RenderMediaLog())); 2039 new RenderMediaLog()));
2036 if (!result->Initialize(frame, 2040 if (!result->Initialize(frame,
2037 cmd_line->HasSwitch(switches::kSimpleDataSource), 2041 cmd_line->HasSwitch(switches::kSimpleDataSource),
2038 video_renderer)) { 2042 video_renderer)) {
2039 return NULL; 2043 return NULL;
2040 } 2044 }
2041 return result.release(); 2045 return result.release();
2042 } 2046 }
(...skipping 2486 matching lines...) Expand 10 before | Expand all | Expand 10 after
4529 } 4533 }
4530 #endif 4534 #endif
4531 4535
4532 void RenderView::OnContextMenuClosed( 4536 void RenderView::OnContextMenuClosed(
4533 const webkit_glue::CustomContextMenuContext& custom_context) { 4537 const webkit_glue::CustomContextMenuContext& custom_context) {
4534 if (custom_context.is_pepper_menu) 4538 if (custom_context.is_pepper_menu)
4535 pepper_delegate_.OnContextMenuClosed(custom_context); 4539 pepper_delegate_.OnContextMenuClosed(custom_context);
4536 else 4540 else
4537 context_menu_node_.reset(); 4541 context_menu_node_.reset();
4538 } 4542 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698