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

Side by Side Diff: media/mojo/services/media_resource_shim.cc

Issue 2643743002: Mojify demuxers and allow running {Chunk/FFmpeg}Demuxer in a Utility Process (Closed)
Patch Set: Rebase and make sure to unbind mojom::DemuxerPtr on the bound thread during termination Created 3 years, 10 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/mojo/services/media_resource_shim.h" 5 #include "media/mojo/services/media_resource_shim.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
11 #include "base/callback_helpers.h" 11 #include "base/callback_helpers.h"
12 #include "media/base/bind_to_current_loop.h"
13 #include "media/base/media_log.h"
14 #include "media/base/media_tracks.h"
15 #include "media/mojo/common/media_type_converters.h"
12 16
13 namespace media { 17 namespace media {
14 18
15 MediaResourceShim::MediaResourceShim( 19 MediaResourceShim::MediaResourceShim(
16 std::vector<mojom::DemuxerStreamPtr> streams, 20 std::vector<mojom::DemuxerStreamPtr> streams,
17 const base::Closure& demuxer_ready_cb) 21 const base::Closure& demuxer_ready_cb)
18 : demuxer_ready_cb_(demuxer_ready_cb), 22 : demuxer_ready_cb_(demuxer_ready_cb),
19 streams_ready_(0), 23 streams_ready_(0),
20 weak_factory_(this) { 24 weak_factory_(this) {
21 DCHECK(!streams.empty()); 25 DCHECK(!streams.empty());
(...skipping 19 matching lines...) Expand all
41 45
42 return nullptr; 46 return nullptr;
43 } 47 }
44 48
45 void MediaResourceShim::OnStreamReady() { 49 void MediaResourceShim::OnStreamReady() {
46 if (++streams_ready_ == streams_.size()) 50 if (++streams_ready_ == streams_.size())
47 base::ResetAndReturn(&demuxer_ready_cb_).Run(); 51 base::ResetAndReturn(&demuxer_ready_cb_).Run();
48 } 52 }
49 53
50 } // namespace media 54 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/interface_factory_impl.cc ('k') | media/mojo/services/media_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698