Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: media/video/video_decode_accelerator.h

Issue 1485043002: Passed is_encrypted parameter to the VDA initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 InitParams {
58 InitParams(VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN,
59 bool is_encrypted = false);
dcheng 2015/12/01 02:03:13 The style guide forbids default args.
60 VideoCodecProfile profile;
61 bool is_encrypted;
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
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;
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698