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_DECODER_H_ | 5 #ifndef SERVICES_MEDIA_FRAMEWORK_PARTS_DECODER_H_ |
6 #define SERVICES_MEDIA_FRAMEWORK_PARTS_DECODER_H_ | 6 #define SERVICES_MEDIA_FRAMEWORK_PARTS_DECODER_H_ |
7 | 7 |
8 #include "services/media/framework/allocator.h" | 8 #include "services/media/framework/models/transform.h" |
9 #include "services/media/framework/models/packet_transform.h" | |
10 #include "services/media/framework/packet.h" | 9 #include "services/media/framework/packet.h" |
| 10 #include "services/media/framework/payload_allocator.h" |
11 #include "services/media/framework/result.h" | 11 #include "services/media/framework/result.h" |
12 #include "services/media/framework/stream_type.h" | 12 #include "services/media/framework/stream_type.h" |
13 | 13 |
14 namespace mojo { | 14 namespace mojo { |
15 namespace media { | 15 namespace media { |
16 | 16 |
17 class Decoder; | |
18 | |
19 typedef SharedPtr<Decoder, PacketTransform> DecoderPtr; | |
20 | |
21 // Abstract base class for transforms that decode compressed media. | 17 // Abstract base class for transforms that decode compressed media. |
22 class Decoder : public PacketTransform { | 18 class Decoder : public Transform { |
23 public: | 19 public: |
24 // Creates a Decoder object for a given stream type. | 20 // Creates a Decoder object for a given stream type. |
25 static Result Create( | 21 static Result Create( |
26 const StreamTypePtr& stream_type, | 22 const std::unique_ptr<StreamType>& stream_type, |
27 DecoderPtr* decoder_out); | 23 std::shared_ptr<Decoder>* decoder_out); |
28 | 24 |
29 ~Decoder() override {} | 25 ~Decoder() override {} |
30 | 26 |
31 // Returns the type of the stream the decoder will produce. | 27 // Returns the type of the stream the decoder will produce. |
32 virtual StreamTypePtr output_stream_type() = 0; | 28 virtual std::unique_ptr<StreamType> output_stream_type() = 0; |
33 | 29 |
34 protected: | 30 protected: |
35 // Initializes the decoder. Called by Decoder::Create. | 31 // Initializes the decoder. Called by Decoder::Create. |
36 virtual Result Init(const StreamTypePtr& stream_type) = 0; | 32 virtual Result Init(const std::unique_ptr<StreamType>& stream_type) = 0; |
37 }; | 33 }; |
38 | 34 |
39 } // namespace media | 35 } // namespace media |
40 } // namespace mojo | 36 } // namespace mojo |
41 | 37 |
42 #endif // SERVICES_MEDIA_FRAMEWORK_PARTS_DECODER_H_ | 38 #endif // SERVICES_MEDIA_FRAMEWORK_PARTS_DECODER_H_ |
OLD | NEW |