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