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: chromecast/media/cma/backend/audio_pipeline_device_default.cc

Issue 1372393007: [Chromecast] Upgrade to new CMA backend API (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Address alokp@ comments Created 5 years, 2 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 2015 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/audio_pipeline_device_default.h"
6
7 #include "chromecast/media/cma/backend/media_component_device_default.h"
8
9 namespace chromecast {
10 namespace media {
11
12 AudioPipelineDeviceDefault::AudioPipelineDeviceDefault(
13 const MediaPipelineDeviceParams& params,
14 MediaClockDevice* media_clock_device)
15 : pipeline_(new MediaComponentDeviceDefault(params, media_clock_device)) {
16 thread_checker_.DetachFromThread();
17 }
18
19 AudioPipelineDeviceDefault::~AudioPipelineDeviceDefault() {
20 }
21
22 void AudioPipelineDeviceDefault::SetClient(Client* client) {
23 pipeline_->SetClient(client);
24 }
25
26 MediaComponentDevice::State AudioPipelineDeviceDefault::GetState() const {
27 return pipeline_->GetState();
28 }
29
30 bool AudioPipelineDeviceDefault::SetState(State new_state) {
31 bool success = pipeline_->SetState(new_state);
32 if (!success)
33 return false;
34
35 if (new_state == kStateIdle) {
36 DCHECK(IsValidConfig(config_));
37 }
38 if (new_state == kStateUninitialized) {
39 config_ = AudioConfig();
40 }
41 return true;
42 }
43
44 bool AudioPipelineDeviceDefault::SetStartPts(int64_t time_microseconds) {
45 return pipeline_->SetStartPts(time_microseconds);
46 }
47
48 MediaComponentDevice::FrameStatus AudioPipelineDeviceDefault::PushFrame(
49 DecryptContext* decrypt_context,
50 CastDecoderBuffer* buffer,
51 FrameStatusCB* completion_cb) {
52 return pipeline_->PushFrame(decrypt_context, buffer, completion_cb);
53 }
54
55 AudioPipelineDeviceDefault::RenderingDelay
56 AudioPipelineDeviceDefault::GetRenderingDelay() const {
57 return pipeline_->GetRenderingDelay();
58 }
59
60 bool AudioPipelineDeviceDefault::SetConfig(const AudioConfig& config) {
61 DCHECK(thread_checker_.CalledOnValidThread());
62 if (!IsValidConfig(config))
63 return false;
64 config_ = config;
65 if (config.extra_data_size > 0)
66 config_extra_data_.assign(config.extra_data,
67 config.extra_data + config.extra_data_size);
68 else
69 config_extra_data_.clear();
70 return true;
71 }
72
73 void AudioPipelineDeviceDefault::SetStreamVolumeMultiplier(float multiplier) {
74 DCHECK(thread_checker_.CalledOnValidThread());
75 }
76
77 bool AudioPipelineDeviceDefault::GetStatistics(Statistics* stats) const {
78 return pipeline_->GetStatistics(stats);
79 }
80
81 } // namespace media
82 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698