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/pipeline/media_component_device_client_impl.h"
8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h"
10 #include "base/thread_task_runner_handle.h"
12 namespace chromecast
{
15 MediaComponentDeviceClientImpl::MediaComponentDeviceClientImpl(
16 const base::Closure
& eos_cb
)
17 : eos_cb_(eos_cb
), task_runner_(base::ThreadTaskRunnerHandle::Get()) {}
19 MediaComponentDeviceClientImpl::~MediaComponentDeviceClientImpl() {}
21 void MediaComponentDeviceClientImpl::OnEndOfStream() {
22 if (task_runner_
->BelongsToCurrentThread()) {
23 if (!eos_cb_
.is_null())
26 task_runner_
->PostTask(FROM_HERE
, eos_cb_
);
31 } // namespace chromecast