Chromium Code Reviews| OLD | NEW |
|---|---|
| (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/browser/media/cma_media_pipeline_client.h" | |
| 6 #include "chromecast/public/cast_media_shlib.h" | |
| 7 | |
| 8 namespace chromecast { | |
| 9 namespace media { | |
| 10 | |
| 11 CmaMediaPipelineClient::CmaMediaPipelineClient() : client_(nullptr) {} | |
| 12 | |
| 13 CmaMediaPipelineClient::~CmaMediaPipelineClient() {} | |
| 14 | |
| 15 scoped_ptr<MediaPipelineBackend> | |
| 16 CmaMediaPipelineClient::CreateMediaPipelineBackend( | |
| 17 const media::MediaPipelineDeviceParams& params) { | |
| 18 return make_scoped_ptr(CastMediaShlib::CreateMediaPipelineBackend(params)); | |
| 19 } | |
| 20 | |
| 21 void CmaMediaPipelineClient::OnMediaPipelineBackendCreated() { | |
| 22 if (client_) | |
| 23 client_->OnResourceAcquired(this); | |
| 24 } | |
| 25 | |
| 26 void CmaMediaPipelineClient::OnMediaPipelineBackendDestroyed() { | |
| 27 if (client_) | |
| 28 client_->OnResourceReleased(this, cast::CastResource::kResourceNone); | |
| 29 } | |
| 30 | |
| 31 void CmaMediaPipelineClient::ReleaseResource( | |
| 32 cast::CastResource::Resource resource) { | |
| 33 if (!(resource & cast::CastResource::kResourceScreenPrimary)) { | |
|
gunsch
2015/09/01 22:56:08
What threads are these called on?
Should OnResour
yucliu1
2015/09/01 23:42:13
Yes, OnResourceReleased can be called from any thr
| |
| 34 if (client_) | |
| 35 client_->OnResourceReleased(this, | |
| 36 cast::CastResource::kResourceScreenPrimary); | |
|
halliwell
2015/09/01 19:42:23
I actually think this is incorrect and we need to
| |
| 37 } | |
| 38 } | |
| 39 | |
| 40 void CmaMediaPipelineClient::SetCastResourceClient( | |
| 41 cast::CastResource::Client* client) { | |
| 42 client_ = client; | |
| 43 } | |
| 44 | |
| 45 } // namespace media | |
| 46 } // namespace chromecast | |
| OLD | NEW |