Update broken references to image assets
[chromium-blink-merge.git] / chromecast / media / cma / backend / video_pipeline_device_default.cc
blobdd305170e1b1a1bac650db74349bee3c1bde6f7b
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.
5 #include "chromecast/media/cma/backend/video_pipeline_device_default.h"
7 #include "chromecast/media/cma/backend/media_component_device_default.h"
9 namespace chromecast {
10 namespace media {
12 VideoPipelineDeviceDefault::VideoPipelineDeviceDefault(
13 const MediaPipelineDeviceParams& params,
14 MediaClockDevice* media_clock_device)
15 : pipeline_(new MediaComponentDeviceDefault(params, media_clock_device)) {
16 thread_checker_.DetachFromThread();
19 VideoPipelineDeviceDefault::~VideoPipelineDeviceDefault() {
22 void VideoPipelineDeviceDefault::SetClient(Client* client) {
23 pipeline_->SetClient(client);
26 MediaComponentDevice::State VideoPipelineDeviceDefault::GetState() const {
27 return pipeline_->GetState();
30 bool VideoPipelineDeviceDefault::SetState(State new_state) {
31 bool success = pipeline_->SetState(new_state);
32 if (!success)
33 return false;
35 if (new_state == kStateIdle) {
36 DCHECK(IsValidConfig(config_));
38 if (new_state == kStateUninitialized) {
39 config_ = VideoConfig();
41 return true;
44 bool VideoPipelineDeviceDefault::SetStartPts(int64_t time_microseconds) {
45 return pipeline_->SetStartPts(time_microseconds);
48 MediaComponentDevice::FrameStatus VideoPipelineDeviceDefault::PushFrame(
49 DecryptContext* decrypt_context,
50 CastDecoderBuffer* buffer,
51 FrameStatusCB* completion_cb) {
52 return pipeline_->PushFrame(decrypt_context, buffer, completion_cb);
55 VideoPipelineDeviceDefault::RenderingDelay
56 VideoPipelineDeviceDefault::GetRenderingDelay() const {
57 return pipeline_->GetRenderingDelay();
60 void VideoPipelineDeviceDefault::SetVideoClient(VideoClient* client) {
61 delete client;
64 bool VideoPipelineDeviceDefault::SetConfig(const VideoConfig& config) {
65 DCHECK(thread_checker_.CalledOnValidThread());
66 if (!IsValidConfig(config))
67 return false;
68 config_ = config;
69 if (config.extra_data_size > 0)
70 config_extra_data_.assign(config.extra_data,
71 config.extra_data + config.extra_data_size);
72 else
73 config_extra_data_.clear();
74 return true;
77 bool VideoPipelineDeviceDefault::GetStatistics(Statistics* stats) const {
78 return pipeline_->GetStatistics(stats);
81 } // namespace media
82 } // namespace chromecast