Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: chromecast/media/cma/pipeline/frame_status_cb_impl.cc

Issue 1257013003: Load CMA backend from shared library (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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/pipeline/frame_status_cb_impl.h"
6
7 #include "base/bind.h"
8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h"
10 #include "base/thread_task_runner_handle.h"
11
12 namespace chromecast {
13 namespace media {
14
15 FrameStatusCBImpl::FrameStatusCBImpl(const CallbackType& cb)
16 : cb_(cb), task_runner_(base::ThreadTaskRunnerHandle::Get()) {}
17
18 FrameStatusCBImpl::~FrameStatusCBImpl() {}
19
20 void FrameStatusCBImpl::Run(MediaComponentDevice::FrameStatus status) {
21 if (task_runner_->BelongsToCurrentThread()) {
22 if (!cb_.is_null())
23 cb_.Run(status);
24 } else {
25 task_runner_->PostTask(FROM_HERE, base::Bind(cb_, status));
26 }
27 }
28
29 } // namespace media
30 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698