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/frame_status_cb_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 FrameStatusCBImpl::FrameStatusCBImpl(const CallbackType
& cb
)
16 : cb_(cb
), task_runner_(base::ThreadTaskRunnerHandle::Get()) {}
18 FrameStatusCBImpl::~FrameStatusCBImpl() {}
20 void FrameStatusCBImpl::Run(MediaComponentDevice::FrameStatus status
) {
21 if (task_runner_
->BelongsToCurrentThread()) {
25 task_runner_
->PostTask(FROM_HERE
, base::Bind(cb_
, status
));
30 } // namespace chromecast