Chromium Code Reviews| 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 <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 // Encoded input is unreadable. | 46 // Encoded input is unreadable. |
| 47 UNREADABLE_INPUT, | 47 UNREADABLE_INPUT, |
| 48 // A failure occurred at the browser layer or one of its dependencies. | 48 // A failure occurred at the browser layer or one of its dependencies. |
| 49 // Examples of such failures include GPU hardware failures, GPU driver | 49 // Examples of such failures include GPU hardware failures, GPU driver |
| 50 // failures, GPU library failures, browser programming errors, and so on. | 50 // failures, GPU library failures, browser programming errors, and so on. |
| 51 PLATFORM_FAILURE, | 51 PLATFORM_FAILURE, |
| 52 // Largest used enum. This should be adjusted when new errors are added. | 52 // Largest used enum. This should be adjusted when new errors are added. |
| 53 LARGEST_ERROR_ENUM, | 53 LARGEST_ERROR_ENUM, |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 // Congig structure contains parameters required for the VDA initialization. | |
|
Pawel Osciak
2015/12/04 00:48:59
s/Congig/Config/
Tima Vaisburd
2015/12/04 01:36:51
Done.
| |
| 57 struct MEDIA_EXPORT Config { | |
| 58 Config() = default; | |
| 59 Config(VideoCodecProfile profile); | |
| 60 Config(const VideoDecoderConfig& video_decoder_config); | |
| 61 | |
| 62 // |profile| combines the information about the codec and its profile. | |
| 63 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN; | |
| 64 | |
| 65 // The flag indicating whether the stream is encrypted. | |
| 66 bool is_encrypted = false; | |
| 67 }; | |
| 68 | |
| 56 // Interface for collaborating with picture interface to provide memory for | 69 // Interface for collaborating with picture interface to provide memory for |
| 57 // output picture and blitting them. These callbacks will not be made unless | 70 // output picture and blitting them. These callbacks will not be made unless |
| 58 // Initialize() has returned successfully. | 71 // Initialize() has returned successfully. |
| 59 // This interface is extended by the various layers that relay messages back | 72 // This interface is extended by the various layers that relay messages back |
| 60 // to the plugin, through the PPP_VideoDecoder_Dev interface the plugin | 73 // to the plugin, through the PPP_VideoDecoder_Dev interface the plugin |
| 61 // implements. | 74 // implements. |
| 62 class MEDIA_EXPORT Client { | 75 class MEDIA_EXPORT Client { |
| 63 public: | 76 public: |
| 64 // SetCdm completion callback to indicate whether the CDM is successfully | 77 // SetCdm completion callback to indicate whether the CDM is successfully |
| 65 // attached to the decoder. The default implementation is a no-op since most | 78 // attached to the decoder. The default implementation is a no-op since most |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 // decoder construction. This call is synchronous and returns true iff | 117 // decoder construction. This call is synchronous and returns true iff |
| 105 // initialization is successful. | 118 // initialization is successful. |
| 106 // | 119 // |
| 107 // For encrpyted video, the decoder needs a CDM to be able to decode encrypted | 120 // For encrpyted video, the decoder needs a CDM to be able to decode encrypted |
| 108 // buffers. SetCdm() should be called after Initialize() to set such a CDM. | 121 // buffers. SetCdm() should be called after Initialize() to set such a CDM. |
| 109 // Client::NotifyCdmAttached() will then be called to indicate whether the CDM | 122 // Client::NotifyCdmAttached() will then be called to indicate whether the CDM |
| 110 // is successfully attached to the decoder. Only when a CDM is successfully | 123 // is successfully attached to the decoder. Only when a CDM is successfully |
| 111 // attached can we start to decode. | 124 // attached can we start to decode. |
| 112 // | 125 // |
| 113 // Parameters: | 126 // Parameters: |
| 114 // |profile| is the video stream's format profile. | 127 // |params| are the initialization parameters. |
|
Pawel Osciak
2015/12/04 00:48:59
Please update this documentation.
Tima Vaisburd
2015/12/04 01:36:51
Done.
| |
| 115 // |client| is the client of this video decoder. Does not take ownership of | 128 // |client| is the client of this video decoder. Does not take ownership of |
| 116 // |client| which must be valid until Destroy() is called. | 129 // |client| which must be valid until Destroy() is called. |
| 117 virtual bool Initialize(VideoCodecProfile profile, Client* client) = 0; | 130 virtual bool Initialize(const Config& config, Client* client) = 0; |
| 118 | 131 |
| 119 // Sets a CDM to be used by the decoder to decode encrypted buffers. | 132 // Sets a CDM to be used by the decoder to decode encrypted buffers. |
| 120 // Client::NotifyCdmAttached() will then be called to indicate whether the CDM | 133 // Client::NotifyCdmAttached() will then be called to indicate whether the CDM |
| 121 // is successfully attached to the decoder. The default implementation is a | 134 // is successfully attached to the decoder. The default implementation is a |
| 122 // no-op since most VDAs don't support encrypted video. | 135 // no-op since most VDAs don't support encrypted video. |
| 123 virtual void SetCdm(int cdm_id); | 136 virtual void SetCdm(int cdm_id); |
| 124 | 137 |
| 125 // Decodes given bitstream buffer that contains at most one frame. Once | 138 // Decodes given bitstream buffer that contains at most one frame. Once |
| 126 // decoder is done with processing |bitstream_buffer| it will call | 139 // decoder is done with processing |bitstream_buffer| it will call |
| 127 // NotifyEndOfBitstreamBuffer() with the bitstream buffer id. | 140 // NotifyEndOfBitstreamBuffer() with the bitstream buffer id. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 // Specialize std::default_delete so that scoped_ptr<VideoDecodeAccelerator> | 209 // Specialize std::default_delete so that scoped_ptr<VideoDecodeAccelerator> |
| 197 // uses "Destroy()" instead of trying to use the destructor. | 210 // uses "Destroy()" instead of trying to use the destructor. |
| 198 template <> | 211 template <> |
| 199 struct MEDIA_EXPORT default_delete<media::VideoDecodeAccelerator> { | 212 struct MEDIA_EXPORT default_delete<media::VideoDecodeAccelerator> { |
| 200 void operator()(media::VideoDecodeAccelerator* vda) const; | 213 void operator()(media::VideoDecodeAccelerator* vda) const; |
| 201 }; | 214 }; |
| 202 | 215 |
| 203 } // namespace std | 216 } // namespace std |
| 204 | 217 |
| 205 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 218 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |