OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_ACCELERATOR_H_ | 5 #ifndef MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
6 #define MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 PLATFORM_FAILURE, | 39 PLATFORM_FAILURE, |
40 }; | 40 }; |
41 | 41 |
42 // Interface for collaborating with picture interface to provide memory for | 42 // Interface for collaborating with picture interface to provide memory for |
43 // output picture and blitting them. | 43 // output picture and blitting them. |
44 // This interface is extended by the various layers that relay messages back | 44 // This interface is extended by the various layers that relay messages back |
45 // to the plugin, through the PPP_VideoDecode_Dev interface the plugin | 45 // to the plugin, through the PPP_VideoDecode_Dev interface the plugin |
46 // implements. | 46 // implements. |
47 class MEDIA_EXPORT Client { | 47 class MEDIA_EXPORT Client { |
48 public: | 48 public: |
49 virtual ~Client() {} | |
50 | |
51 // Callback to notify client that decoder has been initialized. | 49 // Callback to notify client that decoder has been initialized. |
52 virtual void NotifyInitializeDone() = 0; | 50 virtual void NotifyInitializeDone() = 0; |
53 | 51 |
54 // Callback to tell client how many and what size of buffers to provide. | 52 // Callback to tell client how many and what size of buffers to provide. |
55 virtual void ProvidePictureBuffers(uint32 requested_num_of_buffers, | 53 virtual void ProvidePictureBuffers(uint32 requested_num_of_buffers, |
56 const gfx::Size& dimensions, | 54 const gfx::Size& dimensions, |
57 uint32 texture_target) = 0; | 55 uint32 texture_target) = 0; |
58 | 56 |
59 // Callback to dismiss picture buffer that was assigned earlier. | 57 // Callback to dismiss picture buffer that was assigned earlier. |
60 virtual void DismissPictureBuffer(int32 picture_buffer_id) = 0; | 58 virtual void DismissPictureBuffer(int32 picture_buffer_id) = 0; |
61 | 59 |
62 // Callback to deliver decoded pictures ready to be displayed. | 60 // Callback to deliver decoded pictures ready to be displayed. |
63 virtual void PictureReady(const Picture& picture) = 0; | 61 virtual void PictureReady(const Picture& picture) = 0; |
64 | 62 |
65 // Callback to notify that decoded has decoded the end of the current | 63 // Callback to notify that decoded has decoded the end of the current |
66 // bitstream buffer. | 64 // bitstream buffer. |
67 virtual void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) = 0; | 65 virtual void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) = 0; |
68 | 66 |
69 // Flush completion callback. | 67 // Flush completion callback. |
70 virtual void NotifyFlushDone() = 0; | 68 virtual void NotifyFlushDone() = 0; |
71 | 69 |
72 // Reset completion callback. | 70 // Reset completion callback. |
73 virtual void NotifyResetDone() = 0; | 71 virtual void NotifyResetDone() = 0; |
74 | 72 |
75 // Callback to notify about decoding errors. | 73 // Callback to notify about decoding errors. |
76 virtual void NotifyError(Error error) = 0; | 74 virtual void NotifyError(Error error) = 0; |
| 75 |
| 76 protected: |
| 77 virtual ~Client() {} |
77 }; | 78 }; |
78 | 79 |
79 // Video decoder functions. | 80 // Video decoder functions. |
80 | 81 |
81 // Initializes the video decoder with specific configuration. | 82 // Initializes the video decoder with specific configuration. |
82 // Parameters: | 83 // Parameters: |
83 // |profile| is the video stream's format profile. | 84 // |profile| is the video stream's format profile. |
84 // | 85 // |
85 // Returns true when command successfully accepted. Otherwise false. | 86 // Returns true when command successfully accepted. Otherwise false. |
86 virtual bool Initialize(VideoCodecProfile profile) = 0; | 87 virtual bool Initialize(VideoCodecProfile profile) = 0; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 virtual void Destroy() = 0; | 130 virtual void Destroy() = 0; |
130 | 131 |
131 protected: | 132 protected: |
132 friend class base::RefCountedThreadSafe<VideoDecodeAccelerator>; | 133 friend class base::RefCountedThreadSafe<VideoDecodeAccelerator>; |
133 virtual ~VideoDecodeAccelerator(); | 134 virtual ~VideoDecodeAccelerator(); |
134 }; | 135 }; |
135 | 136 |
136 } // namespace media | 137 } // namespace media |
137 | 138 |
138 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 139 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |