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(). | |
| 57 struct MEDIA_EXPORT StreamParameters { | |
|
xhwang
2015/12/02 06:48:18
IMHO "Parameters" doesn't add any value to the nam
liberato (no reviews please)
2015/12/02 16:18:50
i don't think that VDA::Config will always be a su
Tima Vaisburd
2015/12/02 18:02:15
(1) Not every method calling Initialize() has VDC
liberato (no reviews please)
2015/12/02 18:29:47
(1) good question -- i don't know. "whole VDC" do
xhwang
2015/12/02 18:58:34
I am okay with just renaming the current StreamPar
Tima Vaisburd
2015/12/02 22:56:58
Done.
Tima Vaisburd
2015/12/02 22:56:58
This is what I ended up doing in this PS, although
sandersd (OOO until July 31)
2015/12/02 23:33:27
I wanted to add my late $0.02 here because this in
| |
| 58 StreamParameters(); | |
| 59 StreamParameters(VideoCodecProfile profile); | |
| 60 StreamParameters(const VideoDecoderConfig& config); | |
| 61 | |
| 62 // |profile| combines the information about the codec and its profile. | |
| 63 VideoCodecProfile profile; | |
| 64 | |
| 65 // The flag indicating whether the stream is encrypted. | |
| 66 bool is_encrypted; | |
|
xhwang
2015/12/02 06:48:18
Having multiple constructors is actually the perfe
liberato (no reviews please)
2015/12/02 16:18:50
+1
Tima Vaisburd
2015/12/02 18:02:15
Acknowledged.
Tima Vaisburd
2015/12/02 22:56:58
Done.
| |
| 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. |
| 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 StreamParameters& params, 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 |