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

Side by Side Diff: media/tools/player_x11/player_x11.cc

Issue 11492003: Encrypted Media: Support Audio Decrypt-Only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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
« no previous file with comments | « media/media.gyp ('k') | webkit/media/crypto/key_systems.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <signal.h> 5 #include <signal.h>
6 6
7 #include <iostream> // NOLINT 7 #include <iostream> // NOLINT
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/file_path.h" 12 #include "base/file_path.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/threading/platform_thread.h" 14 #include "base/threading/platform_thread.h"
15 #include "base/threading/thread.h" 15 #include "base/threading/thread.h"
16 #include "media/audio/audio_manager.h" 16 #include "media/audio/audio_manager.h"
17 #include "media/audio/null_audio_sink.h" 17 #include "media/audio/null_audio_sink.h"
18 #include "media/base/decryptor.h"
18 #include "media/base/filter_collection.h" 19 #include "media/base/filter_collection.h"
19 #include "media/base/media.h" 20 #include "media/base/media.h"
20 #include "media/base/media_log.h" 21 #include "media/base/media_log.h"
21 #include "media/base/media_switches.h" 22 #include "media/base/media_switches.h"
22 #include "media/base/message_loop_factory.h" 23 #include "media/base/message_loop_factory.h"
23 #include "media/base/pipeline.h" 24 #include "media/base/pipeline.h"
24 #include "media/base/video_frame.h" 25 #include "media/base/video_frame.h"
25 #include "media/filters/audio_renderer_impl.h" 26 #include "media/filters/audio_renderer_impl.h"
26 #include "media/filters/ffmpeg_audio_decoder.h" 27 #include "media/filters/ffmpeg_audio_decoder.h"
27 #include "media/filters/ffmpeg_demuxer.h" 28 #include "media/filters/ffmpeg_demuxer.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 119
119 // Create our video renderer and save a reference to it for painting. 120 // Create our video renderer and save a reference to it for painting.
120 g_video_renderer = new media::VideoRendererBase( 121 g_video_renderer = new media::VideoRendererBase(
121 message_loop, 122 message_loop,
122 base::Bind(&Paint, paint_message_loop, paint_cb), 123 base::Bind(&Paint, paint_message_loop, paint_cb),
123 base::Bind(&SetOpaque), 124 base::Bind(&SetOpaque),
124 true); 125 true);
125 collection->AddVideoRenderer(g_video_renderer); 126 collection->AddVideoRenderer(g_video_renderer);
126 127
127 collection->AddAudioRenderer( 128 collection->AddAudioRenderer(
128 new media::AudioRendererImpl(new media::NullAudioSink())); 129 new media::AudioRendererImpl(new media::NullAudioSink(),
130 media::SetDecryptorReadyCB()));
129 131
130 // Create the pipeline and start it. 132 // Create the pipeline and start it.
131 *pipeline = new media::Pipeline(message_loop, new media::MediaLog()); 133 *pipeline = new media::Pipeline(message_loop, new media::MediaLog());
132 media::PipelineStatusNotification note; 134 media::PipelineStatusNotification note;
133 (*pipeline)->Start( 135 (*pipeline)->Start(
134 collection.Pass(), media::PipelineStatusCB(), media::PipelineStatusCB(), 136 collection.Pass(), media::PipelineStatusCB(), media::PipelineStatusCB(),
135 note.Callback(), base::Bind(&OnBufferingState)); 137 note.Callback(), base::Bind(&OnBufferingState));
136 138
137 // Wait until the pipeline is fully initialized. 139 // Wait until the pipeline is fully initialized.
138 note.Wait(); 140 note.Wait();
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 // Release callback which releases video renderer. Do this before cleaning up 300 // Release callback which releases video renderer. Do this before cleaning up
299 // X below since the video renderer has some X cleanup duties as well. 301 // X below since the video renderer has some X cleanup duties as well.
300 paint_cb.Reset(); 302 paint_cb.Reset();
301 303
302 XDestroyWindow(g_display, g_window); 304 XDestroyWindow(g_display, g_window);
303 XCloseDisplay(g_display); 305 XCloseDisplay(g_display);
304 g_audio_manager = NULL; 306 g_audio_manager = NULL;
305 307
306 return 0; 308 return 0;
307 } 309 }
OLDNEW
« no previous file with comments | « media/media.gyp ('k') | webkit/media/crypto/key_systems.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698