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

Side by Side Diff: chromecast/media/cma/backend/media_clock_device.cc

Issue 1257013003: Load CMA backend from shared library (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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
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 "chromecast/media/cma/backend/media_clock_device.h"
6
7 #include "base/logging.h"
8
9 namespace chromecast {
10 namespace media {
11
12 MediaClockDevice::MediaClockDevice() {
13 }
14
15 MediaClockDevice::~MediaClockDevice() {
16 }
17
18 // static
19 bool MediaClockDevice::IsValidStateTransition(State state1, State state2) {
20 if (state2 == state1)
21 return true;
22
23 // All states can transition to |kStateError|.
24 bool is_transition_valid = (state2 == kStateError);
25
26 // All the other valid FSM transitions.
27 is_transition_valid = is_transition_valid ||
28 (state1 == kStateUninitialized && (state2 == kStateIdle)) ||
29 (state1 == kStateIdle && (state2 == kStateRunning ||
30 state2 == kStateUninitialized)) ||
31 (state1 == kStateRunning && (state2 == kStateIdle)) ||
32 (state1 == kStateError && (state2 == kStateUninitialized));
33
34 return is_transition_valid;
35 }
36
37 // static
38 std::string MediaClockDevice::StateToString(const State& state) {
39 switch (state) {
40 case kStateUninitialized:
41 return "Uninitialized";
42 case kStateIdle:
43 return "Idle";
44 case kStateRunning:
45 return "Running";
46 case kStateError:
47 return "Error";
48 default:
49 NOTREACHED() << "Unknown MediaClockDevice::State: " << state;
50 return "";
51 }
52 }
53
54 } // namespace media
55 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698