| 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" |
| 11 #include "base/memory/weak_ptr.h" |
| 11 #include "media/base/bitstream_buffer.h" | 12 #include "media/base/bitstream_buffer.h" |
| 12 #include "media/base/video_decoder_config.h" | 13 #include "media/base/video_decoder_config.h" |
| 13 #include "media/video/picture.h" | 14 #include "media/video/picture.h" |
| 14 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
| 15 | 16 |
| 16 namespace media { | 17 namespace media { |
| 17 | 18 |
| 18 // Video decoder interface. | 19 // Video decoder interface. |
| 19 // This interface is extended by the various components that ultimately | 20 // This interface is extended by the various components that ultimately |
| 20 // implement the backend of PPB_VideoDecode_Dev. | 21 // implement the backend of PPB_VideoDecode_Dev. |
| 21 // | |
| 22 // No thread-safety guarantees are implied by the use of RefCountedThreadSafe | |
| 23 // below. | |
| 24 class MEDIA_EXPORT VideoDecodeAccelerator | 22 class MEDIA_EXPORT VideoDecodeAccelerator |
| 25 : public base::RefCountedThreadSafe<VideoDecodeAccelerator> { | 23 : public base::SupportsWeakPtr<VideoDecodeAccelerator> { |
| 26 public: | 24 public: |
| 25 virtual ~VideoDecodeAccelerator(); |
| 26 |
| 27 // Enumeration of potential errors generated by the API. | 27 // Enumeration of potential errors generated by the API. |
| 28 // Note: Keep these in sync with PP_VideoDecodeError_Dev. | 28 // Note: Keep these in sync with PP_VideoDecodeError_Dev. |
| 29 enum Error { | 29 enum Error { |
| 30 // An operation was attempted during an incompatible decoder state. | 30 // An operation was attempted during an incompatible decoder state. |
| 31 ILLEGAL_STATE = 1, | 31 ILLEGAL_STATE = 1, |
| 32 // Invalid argument was passed to an API method. | 32 // Invalid argument was passed to an API method. |
| 33 INVALID_ARGUMENT, | 33 INVALID_ARGUMENT, |
| 34 // Encoded input is unreadable. | 34 // Encoded input is unreadable. |
| 35 UNREADABLE_INPUT, | 35 UNREADABLE_INPUT, |
| 36 // A failure occurred at the browser layer or one of its dependencies. | 36 // A failure occurred at the browser layer or one of its dependencies. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 // Resets the decoder: all pending inputs are dropped immediately and the | 120 // Resets the decoder: all pending inputs are dropped immediately and the |
| 121 // decoder returned to a state ready for further Decode()s, followed by | 121 // decoder returned to a state ready for further Decode()s, followed by |
| 122 // NotifyResetDone() being called on the client. Can be used to implement | 122 // NotifyResetDone() being called on the client. Can be used to implement |
| 123 // "seek". | 123 // "seek". |
| 124 virtual void Reset() = 0; | 124 virtual void Reset() = 0; |
| 125 | 125 |
| 126 // Destroys the decoder: all pending inputs are dropped immediately and the | 126 // Destroys the decoder: all pending inputs are dropped immediately and the |
| 127 // component is freed. This call may asynchornously free system resources, | 127 // component is freed. This call may asynchornously free system resources, |
| 128 // but its client-visible effects are synchronous. After this method returns | 128 // but its client-visible effects are synchronous. After this method returns |
| 129 // no more callbacks will be made on the client. | 129 // no more callbacks will be made on the client. Deletes |this| |
| 130 // unconditionally, so make sure to drop all pointers to it! |
| 130 virtual void Destroy() = 0; | 131 virtual void Destroy() = 0; |
| 131 | |
| 132 protected: | |
| 133 friend class base::RefCountedThreadSafe<VideoDecodeAccelerator>; | |
| 134 virtual ~VideoDecodeAccelerator(); | |
| 135 }; | 132 }; |
| 136 | 133 |
| 137 } // namespace media | 134 } // namespace media |
| 138 | 135 |
| 139 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 136 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |