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

Side by Side Diff: services/media/factory_service/media_demux_impl.h

Issue 1945903006: Motown: Move responsibility for binding to MediaFactoryService::Product (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Change per feedback - rename Abort to UnbindAndReleaseFromOwner Created 4 years, 7 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef MOJO_SERVICES_MEDIA_FACTORY_MEDIA_DEMUX_IMPL_H_ 5 #ifndef MOJO_SERVICES_MEDIA_FACTORY_MEDIA_DEMUX_IMPL_H_
6 #define MOJO_SERVICES_MEDIA_FACTORY_MEDIA_DEMUX_IMPL_H_ 6 #define MOJO_SERVICES_MEDIA_FACTORY_MEDIA_DEMUX_IMPL_H_
7 7
8 #include <cstdint> 8 #include <cstdint>
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
13 #include "mojo/public/cpp/bindings/binding.h" 13 #include "mojo/public/cpp/bindings/binding.h"
14 #include "mojo/services/media/core/interfaces/media_demux.mojom.h" 14 #include "mojo/services/media/core/interfaces/media_demux.mojom.h"
15 #include "mojo/services/media/core/interfaces/seeking_reader.mojom.h" 15 #include "mojo/services/media/core/interfaces/seeking_reader.mojom.h"
16 #include "services/media/factory_service/factory_service.h" 16 #include "services/media/factory_service/factory_service.h"
17 #include "services/media/factory_service/mojo_publisher.h" 17 #include "services/media/factory_service/mojo_publisher.h"
18 #include "services/media/framework/graph.h" 18 #include "services/media/framework/graph.h"
19 #include "services/media/framework/parts/demux.h" 19 #include "services/media/framework/parts/demux.h"
20 #include "services/media/framework/util/incident.h" 20 #include "services/media/framework/util/incident.h"
21 #include "services/media/framework_mojo/mojo_producer.h" 21 #include "services/media/framework_mojo/mojo_producer.h"
22 22
23 namespace mojo { 23 namespace mojo {
24 namespace media { 24 namespace media {
25 25
26 // Mojo agent that decodes a stream. 26 // Mojo agent that decodes a stream.
27 class MediaDemuxImpl : public MediaFactoryService::Product, public MediaDemux { 27 class MediaDemuxImpl : public MediaFactoryService::Product<MediaDemux>,
28 public MediaDemux {
28 public: 29 public:
29 static std::shared_ptr<MediaDemuxImpl> Create( 30 static std::shared_ptr<MediaDemuxImpl> Create(
30 InterfaceHandle<SeekingReader> reader, 31 InterfaceHandle<SeekingReader> reader,
31 InterfaceRequest<MediaDemux> request, 32 InterfaceRequest<MediaDemux> request,
32 MediaFactoryService* owner); 33 MediaFactoryService* owner);
33 34
34 ~MediaDemuxImpl() override; 35 ~MediaDemuxImpl() override;
35 36
36 // MediaDemux implementation. 37 // MediaDemux implementation.
37 void Describe(const DescribeCallback& callback) override; 38 void Describe(const DescribeCallback& callback) override;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 OutputRef output_; 80 OutputRef output_;
80 std::shared_ptr<MojoProducer> producer_; 81 std::shared_ptr<MojoProducer> producer_;
81 }; 82 };
82 83
83 // Handles the completion of demux initialization. 84 // Handles the completion of demux initialization.
84 void OnDemuxInitialized(Result result); 85 void OnDemuxInitialized(Result result);
85 86
86 static void RunSeekCallback(const SeekCallback& callback); 87 static void RunSeekCallback(const SeekCallback& callback);
87 88
88 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 89 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
89 Binding<MediaDemux> binding_;
90 Graph graph_; 90 Graph graph_;
91 PartRef demux_part_; 91 PartRef demux_part_;
92 std::shared_ptr<Demux> demux_; 92 std::shared_ptr<Demux> demux_;
93 Incident init_complete_; 93 Incident init_complete_;
94 std::vector<std::unique_ptr<Stream>> streams_; 94 std::vector<std::unique_ptr<Stream>> streams_;
95 MojoPublisher<GetMetadataCallback> metadata_publisher_; 95 MojoPublisher<GetMetadataCallback> metadata_publisher_;
96 }; 96 };
97 97
98 } // namespace media 98 } // namespace media
99 } // namespace mojo 99 } // namespace mojo
100 100
101 #endif // MOJO_SERVICES_MEDIA_FACTORY_MEDIA_DEMUX_IMPL_H_ 101 #endif // MOJO_SERVICES_MEDIA_FACTORY_MEDIA_DEMUX_IMPL_H_
OLDNEW
« no previous file with comments | « services/media/factory_service/media_decoder_impl.cc ('k') | services/media/factory_service/media_demux_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698