Chromium Code Reviews| 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/media_export.h" |
| 11 #include "media/base/video_decoder_config.h" | 11 #include "media/base/video_decoder_config.h" |
| 12 #include "media/base/video_frame.h" | 12 #include "media/base/video_frame.h" |
| 13 #include "ui/gfx/size.h" | 13 #include "ui/gfx/size.h" |
| 14 | 14 |
| 15 class MessageLoop; | |
| 16 | |
| 17 namespace media { | 15 namespace media { |
| 18 | 16 |
| 19 class Buffer; | 17 class Buffer; |
| 20 class VideoDecodeContext; | |
| 21 | |
| 22 struct PipelineStatistics; | 18 struct PipelineStatistics; |
| 23 | 19 |
| 24 class MEDIA_EXPORT VideoDecodeEngine { | 20 class MEDIA_EXPORT VideoDecodeEngine { |
| 25 public: | 21 public: |
| 26 struct MEDIA_EXPORT EventHandler { | 22 struct MEDIA_EXPORT EventHandler { |
| 27 public: | 23 public: |
| 28 virtual ~EventHandler() {} | 24 virtual ~EventHandler() {} |
| 29 virtual void OnInitializeComplete(bool success) = 0; | 25 virtual void OnInitializeComplete(bool success) = 0; |
| 30 virtual void OnUninitializeComplete() = 0; | 26 virtual void OnUninitializeComplete() = 0; |
| 31 virtual void OnFlushComplete() = 0; | 27 virtual void OnFlushComplete() = 0; |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 60 // method is called to return the video frame object to the owner. | 56 // method is called to return the video frame object to the owner. |
| 61 // The content of the video frame may be invalid. | 57 // The content of the video frame may be invalid. |
| 62 virtual void ConsumeVideoFrame(scoped_refptr<VideoFrame> frame, | 58 virtual void ConsumeVideoFrame(scoped_refptr<VideoFrame> frame, |
| 63 const PipelineStatistics& statistics) = 0; | 59 const PipelineStatistics& statistics) = 0; |
| 64 }; | 60 }; |
| 65 | 61 |
| 66 virtual ~VideoDecodeEngine() {} | 62 virtual ~VideoDecodeEngine() {} |
| 67 | 63 |
| 68 // Initialize the engine with specified configuration. | 64 // Initialize the engine with specified configuration. |
| 69 // | 65 // |
| 70 // |decode_context| is used for allocation of VideoFrame. | |
| 71 // It is important that |decode_context| is called only on |message_loop|. | |
| 72 // | |
| 73 // TODO(hclam): Currently refactoring code to use VideoDecodeContext so | |
| 74 // |context| may be NULL in some cases. | |
| 75 // | |
| 76 // Engine should call EventHandler::OnInitializeDone() whether the | 66 // Engine should call EventHandler::OnInitializeDone() whether the |
| 77 // initialization operation finished successfully or not. | 67 // initialization operation finished successfully or not. |
| 78 virtual void Initialize(MessageLoop* message_loop, | 68 virtual void Initialize(EventHandler* event_handler, |
|
Ami GONE FROM CHROMIUM
2011/10/28 16:47:31
What is up w/ dropping message_loop_ from the engi
scherkus (not reviewing)
2011/10/28 17:00:38
it's not even used by FFVDE haha
Ami GONE FROM CHROMIUM
2011/10/28 17:23:17
Wow.
| |
| 79 EventHandler* event_handler, | |
| 80 VideoDecodeContext* context, | |
| 81 const VideoDecoderConfig& config) = 0; | 69 const VideoDecoderConfig& config) = 0; |
| 82 | 70 |
| 83 // Uninitialize the engine. Engine should destroy all resources and call | 71 // Uninitialize the engine. Engine should destroy all resources and call |
| 84 // EventHandler::OnUninitializeComplete(). | 72 // EventHandler::OnUninitializeComplete(). |
| 85 virtual void Uninitialize() = 0; | 73 virtual void Uninitialize() = 0; |
| 86 | 74 |
| 87 // Flush the engine. Engine should return all the buffers to owner ( which | 75 // Flush the engine. Engine should return all the buffers to owner ( which |
| 88 // could be itself. ) then call EventHandler::OnFlushDone(). | 76 // could be itself. ) then call EventHandler::OnFlushDone(). |
| 89 virtual void Flush() = 0; | 77 virtual void Flush() = 0; |
| 90 | 78 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 111 // is called by the user to return the video frame object. | 99 // is called by the user to return the video frame object. |
| 112 // | 100 // |
| 113 // In response to this method call, ConsumeVideoFrame() is called with a | 101 // In response to this method call, ConsumeVideoFrame() is called with a |
| 114 // video frame object containing decoded video content. | 102 // video frame object containing decoded video content. |
| 115 virtual void ProduceVideoFrame(scoped_refptr<VideoFrame> frame) = 0; | 103 virtual void ProduceVideoFrame(scoped_refptr<VideoFrame> frame) = 0; |
| 116 }; | 104 }; |
| 117 | 105 |
| 118 } // namespace media | 106 } // namespace media |
| 119 | 107 |
| 120 #endif // MEDIA_VIDEO_VIDEO_DECODE_ENGINE_H_ | 108 #endif // MEDIA_VIDEO_VIDEO_DECODE_ENGINE_H_ |
| OLD | NEW |