OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 MEDIA_VIDEO_VIDEO_DECODE_ENGINE_H_ | 5 #ifndef MEDIA_VIDEO_VIDEO_DECODE_ENGINE_H_ |
6 #define MEDIA_VIDEO_VIDEO_DECODE_ENGINE_H_ | 6 #define MEDIA_VIDEO_VIDEO_DECODE_ENGINE_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "media/base/media_export.h" |
10 #include "media/base/video_decoder_config.h" | 11 #include "media/base/video_decoder_config.h" |
11 #include "media/base/video_frame.h" | 12 #include "media/base/video_frame.h" |
12 | 13 |
13 class MessageLoop; | 14 class MessageLoop; |
14 | 15 |
15 namespace media { | 16 namespace media { |
16 | 17 |
17 class Buffer; | 18 class Buffer; |
18 class VideoDecodeContext; | 19 class VideoDecodeContext; |
19 | 20 |
20 struct PipelineStatistics; | 21 struct PipelineStatistics; |
21 | 22 |
22 struct VideoCodecInfo { | 23 struct VideoCodecInfo { |
23 // Other parameter is only meaningful when this is true. | 24 // Other parameter is only meaningful when this is true. |
24 bool success; | 25 bool success; |
25 | 26 |
26 // Can be different with container's value. | 27 // Can be different with container's value. |
27 uint32 surface_width; | 28 uint32 surface_width; |
28 | 29 |
29 // Can be different with container's value. | 30 // Can be different with container's value. |
30 uint32 surface_height; | 31 uint32 surface_height; |
31 }; | 32 }; |
32 | 33 |
33 class VideoDecodeEngine { | 34 class MEDIA_EXPORT VideoDecodeEngine { |
34 public: | 35 public: |
35 struct EventHandler { | 36 struct MEDIA_EXPORT EventHandler { |
36 public: | 37 public: |
37 virtual ~EventHandler() {} | 38 virtual ~EventHandler() {} |
38 virtual void OnInitializeComplete(const VideoCodecInfo& info) = 0; | 39 virtual void OnInitializeComplete(const VideoCodecInfo& info) = 0; |
39 virtual void OnUninitializeComplete() = 0; | 40 virtual void OnUninitializeComplete() = 0; |
40 virtual void OnFlushComplete() = 0; | 41 virtual void OnFlushComplete() = 0; |
41 virtual void OnSeekComplete() = 0; | 42 virtual void OnSeekComplete() = 0; |
42 virtual void OnError() = 0; | 43 virtual void OnError() = 0; |
43 | 44 |
44 // TODO(hclam): The following two methods shouldn't belong to this class | 45 // TODO(hclam): The following two methods shouldn't belong to this class |
45 // because they are not video decode events but used to send decoded | 46 // because they are not video decode events but used to send decoded |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // is called by the user to return the video frame object. | 121 // is called by the user to return the video frame object. |
121 // | 122 // |
122 // In response to this method call, ConsumeVideoFrame() is called with a | 123 // In response to this method call, ConsumeVideoFrame() is called with a |
123 // video frame object containing decoded video content. | 124 // video frame object containing decoded video content. |
124 virtual void ProduceVideoFrame(scoped_refptr<VideoFrame> frame) = 0; | 125 virtual void ProduceVideoFrame(scoped_refptr<VideoFrame> frame) = 0; |
125 }; | 126 }; |
126 | 127 |
127 } // namespace media | 128 } // namespace media |
128 | 129 |
129 #endif // MEDIA_VIDEO_VIDEO_DECODE_ENGINE_H_ | 130 #endif // MEDIA_VIDEO_VIDEO_DECODE_ENGINE_H_ |
OLD | NEW |