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 // Parameters required for the Initialize(). | |
|
Pawel Osciak
2015/12/01 07:16:07
Please document all parameters.
Tima Vaisburd
2015/12/02 02:25:07
Done.
| |
| 57 struct MEDIA_EXPORT InitParams { | |
|
xhwang
2015/12/01 07:15:02
We use VideoDecoderConfig to initialize VideoDecod
Pawel Osciak
2015/12/01 07:16:07
Perhaps s/InitParam/StreamParameters/ or StreamCon
Tima Vaisburd
2015/12/02 02:25:07
Chose StreamParameters to distinguish from VideoDe
Tima Vaisburd
2015/12/02 02:25:07
Did s/InitParams/StreamParameters/
| |
| 58 InitParams(VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN, | |
| 59 bool is_encrypted = false); | |
|
xhwang
2015/12/01 07:15:02
no default parameters per style guide
Pawel Osciak
2015/12/01 07:16:07
Default parameters are generally not allowed by co
Tima Vaisburd
2015/12/02 02:25:07
Done.
Tima Vaisburd
2015/12/02 02:25:07
Done.
| |
| 60 VideoCodecProfile profile; | |
| 61 bool is_encrypted; | |
|
xhwang
2015/12/01 07:15:02
You can use Non-Static Class Member Initializers h
Tima Vaisburd
2015/12/02 02:25:07
Since we have several constructors now I thought i
| |
| 62 }; | |
| 63 | |
| 56 // Interface for collaborating with picture interface to provide memory for | 64 // Interface for collaborating with picture interface to provide memory for |
| 57 // output picture and blitting them. These callbacks will not be made unless | 65 // output picture and blitting them. These callbacks will not be made unless |
| 58 // Initialize() has returned successfully. | 66 // Initialize() has returned successfully. |
| 59 // This interface is extended by the various layers that relay messages back | 67 // This interface is extended by the various layers that relay messages back |
| 60 // to the plugin, through the PPP_VideoDecoder_Dev interface the plugin | 68 // to the plugin, through the PPP_VideoDecoder_Dev interface the plugin |
| 61 // implements. | 69 // implements. |
| 62 class MEDIA_EXPORT Client { | 70 class MEDIA_EXPORT Client { |
| 63 public: | 71 public: |
| 64 // SetCdm completion callback to indicate whether the CDM is successfully | 72 // SetCdm completion callback to indicate whether the CDM is successfully |
| 65 // attached to the decoder. The default implementation is a no-op since most | 73 // 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 | 112 // decoder construction. This call is synchronous and returns true iff |
| 105 // initialization is successful. | 113 // initialization is successful. |
| 106 // | 114 // |
| 107 // For encrpyted video, the decoder needs a CDM to be able to decode encrypted | 115 // 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. | 116 // buffers. SetCdm() should be called after Initialize() to set such a CDM. |
| 109 // Client::NotifyCdmAttached() will then be called to indicate whether the CDM | 117 // Client::NotifyCdmAttached() will then be called to indicate whether the CDM |
| 110 // is successfully attached to the decoder. Only when a CDM is successfully | 118 // is successfully attached to the decoder. Only when a CDM is successfully |
| 111 // attached can we start to decode. | 119 // attached can we start to decode. |
| 112 // | 120 // |
| 113 // Parameters: | 121 // Parameters: |
| 114 // |profile| is the video stream's format profile. | 122 // |params| are the initialization parameters. |
| 115 // |client| is the client of this video decoder. Does not take ownership of | 123 // |client| is the client of this video decoder. Does not take ownership of |
| 116 // |client| which must be valid until Destroy() is called. | 124 // |client| which must be valid until Destroy() is called. |
| 117 virtual bool Initialize(VideoCodecProfile profile, Client* client) = 0; | 125 virtual bool Initialize(const InitParams& params, Client* client) = 0; |
|
Pawel Osciak
2015/12/01 07:16:07
Would it be possible to just indicate encrypted st
Tima Vaisburd
2015/12/02 02:25:07
On Android the Initialize() call might come before
| |
| 118 | 126 |
| 119 // Sets a CDM to be used by the decoder to decode encrypted buffers. | 127 // 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 | 128 // Client::NotifyCdmAttached() will then be called to indicate whether the CDM |
| 121 // is successfully attached to the decoder. The default implementation is a | 129 // is successfully attached to the decoder. The default implementation is a |
| 122 // no-op since most VDAs don't support encrypted video. | 130 // no-op since most VDAs don't support encrypted video. |
| 123 virtual void SetCdm(int cdm_id); | 131 virtual void SetCdm(int cdm_id); |
| 124 | 132 |
| 125 // Decodes given bitstream buffer that contains at most one frame. Once | 133 // Decodes given bitstream buffer that contains at most one frame. Once |
| 126 // decoder is done with processing |bitstream_buffer| it will call | 134 // decoder is done with processing |bitstream_buffer| it will call |
| 127 // NotifyEndOfBitstreamBuffer() with the bitstream buffer id. | 135 // 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> | 204 // Specialize std::default_delete so that scoped_ptr<VideoDecodeAccelerator> |
| 197 // uses "Destroy()" instead of trying to use the destructor. | 205 // uses "Destroy()" instead of trying to use the destructor. |
| 198 template <> | 206 template <> |
| 199 struct MEDIA_EXPORT default_delete<media::VideoDecodeAccelerator> { | 207 struct MEDIA_EXPORT default_delete<media::VideoDecodeAccelerator> { |
| 200 void operator()(media::VideoDecodeAccelerator* vda) const; | 208 void operator()(media::VideoDecodeAccelerator* vda) const; |
| 201 }; | 209 }; |
| 202 | 210 |
| 203 } // namespace std | 211 } // namespace std |
| 204 | 212 |
| 205 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 213 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |