| 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_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/callback_old.h" | 11 #include "base/callback_old.h" |
| 12 #include "media/base/bitstream_buffer.h" | 12 #include "media/base/bitstream_buffer.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 // |
| 22 // No thread-safety guarantees are implied by the use of RefCountedThreadSafe | 23 // No thread-safety guarantees are implied by the use of RefCountedThreadSafe |
| 23 // below. | 24 // below. |
| 24 class MEDIA_EXPORT VideoDecodeAccelerator | 25 class MEDIA_EXPORT VideoDecodeAccelerator |
| 25 : public base::RefCountedThreadSafe<VideoDecodeAccelerator> { | 26 : public base::RefCountedThreadSafe<VideoDecodeAccelerator> { |
| 26 public: | 27 public: |
| 27 // Video stream profile. This *must* match PP_VideoDecoder_Profile. | 28 // TODO(fischman): fix foreign references to this and get rid of this typedef. |
| 28 enum Profile { | 29 typedef VideoCodecProfile Profile; |
| 29 // Keep the values in this enum unique, as they imply format (h.264 vs. VP8, | |
| 30 // for example), and keep the values for a particular format grouped | |
| 31 // together for clarity. | |
| 32 H264PROFILE_MIN = 0, | |
| 33 H264PROFILE_BASELINE = H264PROFILE_MIN, | |
| 34 H264PROFILE_MAIN, | |
| 35 H264PROFILE_EXTENDED, | |
| 36 H264PROFILE_HIGH, | |
| 37 H264PROFILE_HIGH10PROFILE, | |
| 38 H264PROFILE_HIGH422PROFILE, | |
| 39 H264PROFILE_HIGH444PREDICTIVEPROFILE, | |
| 40 H264PROFILE_SCALABLEBASELINE, | |
| 41 H264PROFILE_SCALABLEHIGH, | |
| 42 H264PROFILE_STEREOHIGH, | |
| 43 H264PROFILE_MULTIVIEWHIGH, | |
| 44 H264PROFILE_MAX = H264PROFILE_MULTIVIEWHIGH, | |
| 45 }; | |
| 46 | 30 |
| 47 // Enumeration of potential errors generated by the API. | 31 // Enumeration of potential errors generated by the API. |
| 48 // Note: Keep these in sync with PP_VideoDecodeError_Dev. | 32 // Note: Keep these in sync with PP_VideoDecodeError_Dev. |
| 49 enum Error { | 33 enum Error { |
| 50 // An operation was attempted during an incompatible decoder state. | 34 // An operation was attempted during an incompatible decoder state. |
| 51 ILLEGAL_STATE = 1, | 35 ILLEGAL_STATE = 1, |
| 52 // Invalid argument was passed to an API method. | 36 // Invalid argument was passed to an API method. |
| 53 INVALID_ARGUMENT, | 37 INVALID_ARGUMENT, |
| 54 // Encoded input is unreadable. | 38 // Encoded input is unreadable. |
| 55 UNREADABLE_INPUT, | 39 UNREADABLE_INPUT, |
| 56 // A failure occurred at the browser layer or one of its dependencies. | 40 // A failure occurred at the browser layer or one of its dependencies. |
| 57 // Examples of such failures include GPU hardware failures, GPU driver | 41 // Examples of such failures include GPU hardware failures, GPU driver |
| 58 // failures, GPU library failures, browser programming errors, and so on. | 42 // failures, GPU library failures, browser programming errors, and so on. |
| 59 PLATFORM_FAILURE, | 43 PLATFORM_FAILURE, |
| 60 }; | 44 }; |
| 61 | 45 |
| 62 // Interface for collaborating with picture interface to provide memory for | 46 // Interface for collaborating with picture interface to provide memory for |
| 63 // output picture and blitting them. | 47 // output picture and blitting them. |
| 64 // This interface is extended by the various layers that relay messages back | 48 // This interface is extended by the various layers that relay messages back |
| 65 // to the plugin, through the PPP_VideoDecode_Dev interface the plugin | 49 // to the plugin, through the PPP_VideoDecode_Dev interface the plugin |
| 66 // implements. | 50 // implements. |
| 67 class Client { | 51 class MEDIA_EXPORT Client { |
| 68 public: | 52 public: |
| 69 virtual ~Client() {} | 53 virtual ~Client() {} |
| 70 | 54 |
| 71 // Callback to notify client that decoder has been initialized. | 55 // Callback to notify client that decoder has been initialized. |
| 72 virtual void NotifyInitializeDone() = 0; | 56 virtual void NotifyInitializeDone() = 0; |
| 73 | 57 |
| 74 // Callback to tell client how many and what size of buffers to provide. | 58 // Callback to tell client how many and what size of buffers to provide. |
| 75 virtual void ProvidePictureBuffers( | 59 virtual void ProvidePictureBuffers( |
| 76 uint32 requested_num_of_buffers, const gfx::Size& dimensions) = 0; | 60 uint32 requested_num_of_buffers, const gfx::Size& dimensions) = 0; |
| 77 | 61 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 virtual void Destroy() = 0; | 136 virtual void Destroy() = 0; |
| 153 | 137 |
| 154 protected: | 138 protected: |
| 155 friend class base::RefCountedThreadSafe<VideoDecodeAccelerator>; | 139 friend class base::RefCountedThreadSafe<VideoDecodeAccelerator>; |
| 156 virtual ~VideoDecodeAccelerator(); | 140 virtual ~VideoDecodeAccelerator(); |
| 157 }; | 141 }; |
| 158 | 142 |
| 159 } // namespace media | 143 } // namespace media |
| 160 | 144 |
| 161 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 145 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |