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

Side by Side Diff: media/mojo/services/demuxer_stream_provider_shim.h

Issue 684963003: Add support for external video renderers in mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo_config
Patch Set: More MSVC... Created 6 years, 1 month 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
« no previous file with comments | « media/mojo/services/BUILD.gn ('k') | media/mojo/services/demuxer_stream_provider_shim.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_MOJO_SERVICES_DEMUXER_STREAM_PROVIDER_SHIM_H_
6 #define MEDIA_MOJO_SERVICES_DEMUXER_STREAM_PROVIDER_SHIM_H_
7
8 #include "base/callback.h"
9 #include "base/memory/scoped_vector.h"
10 #include "base/memory/weak_ptr.h"
11 #include "media/base/demuxer_stream_provider.h"
12 #include "media/mojo/services/mojo_demuxer_stream_adapter.h"
13
14 namespace media {
15
16 // DemuxerStreamProvider shim for mojo::DemuxerStreams.
17 class DemuxerStreamProviderShim : public DemuxerStreamProvider {
18 public:
19 // Constructs the shim; at least a single audio or video stream must be
20 // provided. |demuxer_ready_cb| will be called once the streams have been
21 // initialized. Calling any method before then is an error.
22 DemuxerStreamProviderShim(mojo::DemuxerStreamPtr audio,
23 mojo::DemuxerStreamPtr video,
24 const base::Closure& demuxer_ready_cb);
25 ~DemuxerStreamProviderShim() override;
26
27 // DemuxerStreamProvider interface.
28 DemuxerStream* GetStream(DemuxerStream::Type type) override;
29 Liveness GetLiveness() const override;
30
31 private:
32 // Called as each mojo::DemuxerStream becomes ready. Once all streams are
33 // ready it will fire the |demuxer_ready_cb_| provided during construction.
34 void OnStreamReady();
35
36 // Stored copy the ready callback provided during construction; cleared once
37 // all streams are ready.
38 base::Closure demuxer_ready_cb_;
39
40 // Scoped container for demuxer stream adapters which interface with the
41 // mojo level demuxer streams. |streams_ready_| tracks how many streams are
42 // ready and is used by OnStreamReady() to know when |demuxer_ready_cb_|
43 // should be fired.
44 ScopedVector<MojoDemuxerStreamAdapter> streams_;
45 size_t streams_ready_;
46
47 // WeakPtrFactorys must always be the last member variable.
48 base::WeakPtrFactory<DemuxerStreamProviderShim> weak_factory_;
49
50 DISALLOW_COPY_AND_ASSIGN(DemuxerStreamProviderShim);
51 };
52
53 } // namespace media
54
55 #endif // MEDIA_MOJO_SERVICES_DEMUXER_STREAM_PROVIDER_SHIM_H_
OLDNEW
« no previous file with comments | « media/mojo/services/BUILD.gn ('k') | media/mojo/services/demuxer_stream_provider_shim.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698