OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 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 MEDIA_VIDEO_VIDEO_DECODE_ENGINE_H_ | |
6 #define MEDIA_VIDEO_VIDEO_DECODE_ENGINE_H_ | |
7 | |
8 #include "base/memory/ref_counted.h" | |
9 #include "media/base/media_export.h" | |
10 | |
11 namespace media { | |
12 | |
13 class Buffer; | |
14 class VideoDecoderConfig; | |
15 class VideoFrame; | |
16 | |
17 class MEDIA_EXPORT VideoDecodeEngine { | |
18 public: | |
19 virtual ~VideoDecodeEngine() {} | |
20 | |
21 // Initialize the engine with specified configuration, returning true if | |
22 // successful. | |
23 virtual bool Initialize(const VideoDecoderConfig& config) = 0; | |
24 | |
25 // Uninitialize the engine, freeing all resources. Calls to Flush() or | |
26 // Decode() will have no effect afterwards. | |
27 virtual void Uninitialize() = 0; | |
28 | |
29 // Decode the encoded video data and store the result (if any) into | |
30 // |video_frame|. Note that a frame may not always be produced if the | |
31 // decode engine has insufficient encoded data. In such circumstances, | |
32 // additional calls to Decode() may be required. | |
33 // | |
34 // Returns true if decoding was successful (includes zero length input and end | |
35 // of stream), false if a decoding error occurred. | |
36 virtual bool Decode(const scoped_refptr<Buffer>& buffer, | |
37 scoped_refptr<VideoFrame>* video_frame) = 0; | |
38 | |
39 // Discard all pending data that has yet to be returned via Decode(). | |
40 virtual void Flush() = 0; | |
41 }; | |
42 | |
43 } // namespace media | |
44 | |
45 #endif // MEDIA_VIDEO_VIDEO_DECODE_ENGINE_H_ | |
OLD | NEW |