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

Side by Side Diff: services/media/factory_service/media_decoder_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_DECODER_IMPL_H_ 5 #ifndef MOJO_SERVICES_MEDIA_FACTORY_MEDIA_DECODER_IMPL_H_
6 #define MOJO_SERVICES_MEDIA_FACTORY_MEDIA_DECODER_IMPL_H_ 6 #define MOJO_SERVICES_MEDIA_FACTORY_MEDIA_DECODER_IMPL_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "mojo/public/cpp/bindings/binding.h" 10 #include "mojo/public/cpp/bindings/binding.h"
11 #include "mojo/services/media/core/interfaces/media_type_converter.mojom.h" 11 #include "mojo/services/media/core/interfaces/media_type_converter.mojom.h"
12 #include "services/media/factory_service/factory_service.h" 12 #include "services/media/factory_service/factory_service.h"
13 #include "services/media/framework/graph.h" 13 #include "services/media/framework/graph.h"
14 #include "services/media/framework/parts/decoder.h" 14 #include "services/media/framework/parts/decoder.h"
15 #include "services/media/framework_mojo/mojo_consumer.h" 15 #include "services/media/framework_mojo/mojo_consumer.h"
16 #include "services/media/framework_mojo/mojo_producer.h" 16 #include "services/media/framework_mojo/mojo_producer.h"
17 17
18 namespace mojo { 18 namespace mojo {
19 namespace media { 19 namespace media {
20 20
21 // Mojo agent that decodes a stream. 21 // Mojo agent that decodes a stream.
22 class MediaDecoderImpl : public MediaFactoryService::Product, 22 class MediaDecoderImpl
23 public MediaTypeConverter { 23 : public MediaFactoryService::Product<MediaTypeConverter>,
24 public MediaTypeConverter {
24 public: 25 public:
25 static std::shared_ptr<MediaDecoderImpl> Create( 26 static std::shared_ptr<MediaDecoderImpl> Create(
26 MediaTypePtr input_media_type, 27 MediaTypePtr input_media_type,
27 InterfaceRequest<MediaTypeConverter> request, 28 InterfaceRequest<MediaTypeConverter> request,
28 MediaFactoryService* owner); 29 MediaFactoryService* owner);
29 30
30 ~MediaDecoderImpl() override; 31 ~MediaDecoderImpl() override;
31 32
32 // MediaTypeConverter implementation. 33 // MediaTypeConverter implementation.
33 void GetOutputType(const GetOutputTypeCallback& callback) override; 34 void GetOutputType(const GetOutputTypeCallback& callback) override;
34 35
35 void GetConsumer(InterfaceRequest<MediaConsumer> consumer) override; 36 void GetConsumer(InterfaceRequest<MediaConsumer> consumer) override;
36 37
37 void GetProducer(InterfaceRequest<MediaProducer> producer) override; 38 void GetProducer(InterfaceRequest<MediaProducer> producer) override;
38 39
39 private: 40 private:
40 MediaDecoderImpl(MediaTypePtr input_media_type, 41 MediaDecoderImpl(MediaTypePtr input_media_type,
41 InterfaceRequest<MediaTypeConverter> request, 42 InterfaceRequest<MediaTypeConverter> request,
42 MediaFactoryService* owner); 43 MediaFactoryService* owner);
43 44
44 Binding<MediaTypeConverter> binding_;
45 Graph graph_; 45 Graph graph_;
46 std::shared_ptr<MojoConsumer> consumer_; 46 std::shared_ptr<MojoConsumer> consumer_;
47 std::shared_ptr<Decoder> decoder_; 47 std::shared_ptr<Decoder> decoder_;
48 std::shared_ptr<MojoProducer> producer_; 48 std::shared_ptr<MojoProducer> producer_;
49 }; 49 };
50 50
51 } // namespace media 51 } // namespace media
52 } // namespace mojo 52 } // namespace mojo
53 53
54 #endif // MOJO_SERVICES_MEDIA_FACTORY_MEDIA_DECODER_IMPL_H_ 54 #endif // MOJO_SERVICES_MEDIA_FACTORY_MEDIA_DECODER_IMPL_H_
OLDNEW
« no previous file with comments | « services/media/factory_service/factory_service.cc ('k') | services/media/factory_service/media_decoder_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698