| OLD | NEW |
| 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_SINK_IMPL_H_ | 5 #ifndef MOJO_SERVICES_MEDIA_FACTORY_MEDIA_SINK_IMPL_H_ |
| 6 #define MOJO_SERVICES_MEDIA_FACTORY_MEDIA_SINK_IMPL_H_ | 6 #define MOJO_SERVICES_MEDIA_FACTORY_MEDIA_SINK_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" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 ~MediaSinkImpl() override; | 34 ~MediaSinkImpl() override; |
| 35 | 35 |
| 36 // MediaSink implementation. | 36 // MediaSink implementation. |
| 37 void GetConsumer(InterfaceRequest<MediaConsumer> consumer) override; | 37 void GetConsumer(InterfaceRequest<MediaConsumer> consumer) override; |
| 38 | 38 |
| 39 void GetTimelineControlSite( | 39 void GetTimelineControlSite( |
| 40 InterfaceRequest<MediaTimelineControlSite> req) override; | 40 InterfaceRequest<MediaTimelineControlSite> req) override; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 class NullTimelineControlSite : public MediaTimelineControlSite, | |
| 44 public TimelineConsumer { | |
| 45 public: | |
| 46 NullTimelineControlSite( | |
| 47 InterfaceRequest<MediaTimelineControlSite> control_site_request); | |
| 48 | |
| 49 ~NullTimelineControlSite() override; | |
| 50 | |
| 51 // MediaTimelineControlSite implementation. | |
| 52 void GetStatus(uint64_t version_last_seen, | |
| 53 const GetStatusCallback& callback) override; | |
| 54 | |
| 55 void GetTimelineConsumer( | |
| 56 InterfaceRequest<TimelineConsumer> timeline_consumer) override; | |
| 57 | |
| 58 // TimelineConsumer implementation. | |
| 59 void SetTimelineTransform( | |
| 60 int64_t subject_time, | |
| 61 uint32_t reference_delta, | |
| 62 uint32_t subject_delta, | |
| 63 int64_t effective_reference_time, | |
| 64 int64_t effective_subject_time, | |
| 65 const SetTimelineTransformCallback& callback) override; | |
| 66 | |
| 67 private: | |
| 68 Binding<MediaTimelineControlSite> control_site_binding_; | |
| 69 Binding<TimelineConsumer> consumer_binding_; | |
| 70 GetStatusCallback get_status_callback_; | |
| 71 }; | |
| 72 | |
| 73 MediaSinkImpl(InterfaceHandle<MediaRenderer> renderer, | 43 MediaSinkImpl(InterfaceHandle<MediaRenderer> renderer, |
| 74 MediaTypePtr media_type, | 44 MediaTypePtr media_type, |
| 75 InterfaceRequest<MediaSink> request, | 45 InterfaceRequest<MediaSink> request, |
| 76 MediaFactoryService* owner); | 46 MediaFactoryService* owner); |
| 77 | 47 |
| 78 Incident ready_; | 48 Incident ready_; |
| 79 Graph graph_; | 49 Graph graph_; |
| 80 std::shared_ptr<MojoConsumer> consumer_; | 50 std::shared_ptr<MojoConsumer> consumer_; |
| 81 std::shared_ptr<MojoProducer> producer_; | 51 std::shared_ptr<MojoProducer> producer_; |
| 82 MediaRendererPtr renderer_; | 52 MediaRendererPtr renderer_; |
| 83 // The following fields are just temporaries used to solve lambda capture | 53 // The following fields are just temporaries used to solve lambda capture |
| 84 // problems. | 54 // problems. |
| 85 std::unique_ptr<StreamType> input_stream_type_; | 55 std::unique_ptr<StreamType> input_stream_type_; |
| 86 }; | 56 }; |
| 87 | 57 |
| 88 } // namespace media | 58 } // namespace media |
| 89 } // namespace mojo | 59 } // namespace mojo |
| 90 | 60 |
| 91 #endif // MOJO_SERVICES_MEDIA_FACTORY_MEDIA_SINK_IMPL_H_ | 61 #endif // MOJO_SERVICES_MEDIA_FACTORY_MEDIA_SINK_IMPL_H_ |
| OLD | NEW |