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

Side by Side Diff: media/base/fake_audio_renderer_sink.cc

Issue 2684103005: Allow media track switching. (Closed)
Patch Set: Fixed comments Created 3 years, 8 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
« no previous file with comments | « media/base/audio_renderer.h ('k') | media/base/video_renderer.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "media/base/fake_audio_renderer_sink.h" 5 #include "media/base/fake_audio_renderer_sink.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
(...skipping 14 matching lines...) Expand all
25 output_device_info_(std::string(), 25 output_device_info_(std::string(),
26 OUTPUT_DEVICE_STATUS_OK, 26 OUTPUT_DEVICE_STATUS_OK,
27 hardware_params) {} 27 hardware_params) {}
28 28
29 FakeAudioRendererSink::~FakeAudioRendererSink() { 29 FakeAudioRendererSink::~FakeAudioRendererSink() {
30 DCHECK(!callback_); 30 DCHECK(!callback_);
31 } 31 }
32 32
33 void FakeAudioRendererSink::Initialize(const AudioParameters& params, 33 void FakeAudioRendererSink::Initialize(const AudioParameters& params,
34 RenderCallback* callback) { 34 RenderCallback* callback) {
35 DCHECK_EQ(state_, kUninitialized); 35 DCHECK(state_ == kUninitialized || state_ == kStopped);
36 DCHECK(!callback_); 36 DCHECK(!callback_);
37 DCHECK(callback); 37 DCHECK(callback);
38 38
39 callback_ = callback; 39 callback_ = callback;
40 ChangeState(kInitialized); 40 ChangeState(kInitialized);
41 } 41 }
42 42
43 void FakeAudioRendererSink::Start() { 43 void FakeAudioRendererSink::Start() {
44 DCHECK_EQ(state_, kInitialized); 44 DCHECK_EQ(state_, kInitialized);
45 ChangeState(kStarted); 45 ChangeState(kStarted);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 "kPlaying", 100 "kPlaying",
101 "kStopped" 101 "kStopped"
102 }; 102 };
103 103
104 DVLOG(1) << __func__ << " : " << kStateNames[state_] << " -> " 104 DVLOG(1) << __func__ << " : " << kStateNames[state_] << " -> "
105 << kStateNames[new_state]; 105 << kStateNames[new_state];
106 state_ = new_state; 106 state_ = new_state;
107 } 107 }
108 108
109 } // namespace media 109 } // namespace media
OLDNEW
« no previous file with comments | « media/base/audio_renderer.h ('k') | media/base/video_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698