| 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 SERVICES_MEDIA_FRAMEWORK_PARTS_NULL_SINK_H_ | 5 #ifndef SERVICES_MEDIA_FRAMEWORK_PARTS_NULL_SINK_H_ |
| 6 #define SERVICES_MEDIA_FRAMEWORK_PARTS_NULL_SINK_H_ | 6 #define SERVICES_MEDIA_FRAMEWORK_PARTS_NULL_SINK_H_ |
| 7 | 7 |
| 8 #include "services/media/framework/models/active_sink.h" | 8 #include "services/media/framework/models/active_sink.h" |
| 9 | 9 |
| 10 namespace mojo { | 10 namespace mojo { |
| 11 namespace media { | 11 namespace media { |
| 12 | 12 |
| 13 // Sink that throws packets away. | 13 // Sink that throws packets away. |
| 14 class NullSink : public ActiveSink { | 14 class NullSink : public ActiveSink { |
| 15 public: | 15 public: |
| 16 static std::shared_ptr<NullSink> Create() { | 16 static std::shared_ptr<NullSink> Create() { |
| 17 return std::shared_ptr<NullSink>(new NullSink()); | 17 return std::shared_ptr<NullSink>(new NullSink()); |
| 18 } | 18 } |
| 19 | 19 |
| 20 ~NullSink() override; | 20 ~NullSink() override; |
| 21 | 21 |
| 22 // ActiveSink implementation. | 22 // ActiveSink implementation. |
| 23 PayloadAllocator* allocator() override; | 23 PayloadAllocator* allocator() override; |
| 24 | 24 |
| 25 void SetDemandCallback(const DemandCallback& demand_callback) override; | 25 void SetDemandCallback(const DemandCallback& demand_callback) override; |
| 26 | 26 |
| 27 Demand SupplyPacket(PacketPtr packet) override; | 27 Demand SupplyPacket(PacketPtr packet) override; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 NullSink(); | 30 NullSink(); |
| 31 | 31 |
| 32 DemandCallback demand_callback_; | 32 DemandCallback demand_callback_; |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 } // namespace media | 35 } // namespace media |
| 36 } // namespace mojo | 36 } // namespace mojo |
| 37 | 37 |
| 38 #endif // SERVICES_MEDIA_FRAMEWORK_PARTS_NULL_SINK_H_ | 38 #endif // SERVICES_MEDIA_FRAMEWORK_PARTS_NULL_SINK_H_ |
| OLD | NEW |