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

Side by Side Diff: media/cast/test/utility/standalone_cast_environment.cc

Issue 184813009: Cast Streaming API end-to-end browser_test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix LoggingImplTest + REBASE Created 6 years, 9 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
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "media/cast/test/utility/standalone_cast_environment.h"
6
7 #include "base/time/default_tick_clock.h"
8
9 namespace media {
10 namespace cast {
11
12 StandaloneCastEnvironment::StandaloneCastEnvironment(
13 const CastLoggingConfig& logging_config)
14 : CastEnvironment(
15 make_scoped_ptr<base::TickClock>(new base::DefaultTickClock()),
16 NULL,
17 NULL,
18 NULL,
19 NULL,
20 NULL,
21 NULL,
22 logging_config),
23 main_thread_("StandaloneCastEnvironment Main"),
24 audio_encode_thread_("StandaloneCastEnvironment Audio Encode"),
25 audio_decode_thread_("StandaloneCastEnvironment Audio Decode"),
26 video_encode_thread_("StandaloneCastEnvironment Video Encode"),
27 video_decode_thread_("StandaloneCastEnvironment Video Decode"),
28 transport_thread_("StandaloneCastEnvironment Transport") {
29 #define CREATE_TASK_RUNNER(name, options) \
30 name##_thread_.StartWithOptions(options); \
31 CastEnvironment::name##_thread_proxy_ = name##_thread_.message_loop_proxy()
32
33 CREATE_TASK_RUNNER(main,
34 base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
35 CREATE_TASK_RUNNER(audio_encode, base::Thread::Options());
36 CREATE_TASK_RUNNER(audio_decode, base::Thread::Options());
37 CREATE_TASK_RUNNER(video_encode, base::Thread::Options());
38 CREATE_TASK_RUNNER(video_decode, base::Thread::Options());
39 CREATE_TASK_RUNNER(transport, base::Thread::Options());
40
41 #undef CREATE_TASK_RUNNER
42 }
43
44 StandaloneCastEnvironment::~StandaloneCastEnvironment() {
45 DCHECK(CalledOnValidThread());
46 }
47
48 void StandaloneCastEnvironment::Shutdown() {
49 DCHECK(CalledOnValidThread());
50 main_thread_.Stop();
51 audio_encode_thread_.Stop();
52 audio_decode_thread_.Stop();
53 video_encode_thread_.Stop();
54 video_decode_thread_.Stop();
55 transport_thread_.Stop();
56 }
57
58 } // namespace cast
59 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/test/utility/standalone_cast_environment.h ('k') | media/cast/test/utility/utility.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698