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

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

Issue 2045273005: Have VDA clients inform decoder of supported picture buffer formats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // When set to ALLOCATE, the VDA is expected to allocate backing memory 108 // When set to ALLOCATE, the VDA is expected to allocate backing memory
109 // for PictureBuffers at the time of AssignPictureBuffers() call. 109 // for PictureBuffers at the time of AssignPictureBuffers() call.
110 // When set to IMPORT, the VDA will not allocate, but after receiving 110 // When set to IMPORT, the VDA will not allocate, but after receiving
111 // AssignPictureBuffers() call, it will expect a call to 111 // AssignPictureBuffers() call, it will expect a call to
112 // ImportBufferForPicture() for each PictureBuffer before use. 112 // ImportBufferForPicture() for each PictureBuffer before use.
113 enum class OutputMode { 113 enum class OutputMode {
114 ALLOCATE, 114 ALLOCATE,
115 IMPORT, 115 IMPORT,
116 }; 116 };
117 117
118 Config() = default; 118 Config();
119 Config(const Config& config);
119 120
120 // Intentional converting constructor. 121 // Intentional converting constructor.
121 // TODO(watk): Make this explicit. 122 // TODO(watk): Make this explicit.
122 Config(VideoCodecProfile profile); 123 Config(VideoCodecProfile profile);
123 124
125 ~Config();
126
124 std::string AsHumanReadableString() const; 127 std::string AsHumanReadableString() const;
125 128
126 // The video codec and profile. 129 // The video codec and profile.
127 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN; 130 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN;
128 131
129 // Whether the stream is encrypted. 132 // Whether the stream is encrypted.
130 bool is_encrypted = false; 133 bool is_encrypted = false;
131 134
132 // The CDM that the VDA should use to decode encrypted streams. Must be 135 // The CDM that the VDA should use to decode encrypted streams. Must be
133 // set to a valid ID if |is_encrypted|. 136 // set to a valid ID if |is_encrypted|.
134 int cdm_id = CdmContext::kInvalidCdmId; 137 int cdm_id = CdmContext::kInvalidCdmId;
135 138
136 // Whether the client supports deferred initialization. 139 // Whether the client supports deferred initialization.
137 bool is_deferred_initialization_allowed = false; 140 bool is_deferred_initialization_allowed = false;
138 141
139 // An optional graphics surface that the VDA should render to. For setting 142 // An optional graphics surface that the VDA should render to. For setting
140 // an output SurfaceView on Android. It's only valid when not equal to 143 // an output SurfaceView on Android. It's only valid when not equal to
141 // |kNoSurfaceID|. 144 // |kNoSurfaceID|.
142 int surface_id = kNoSurfaceID; 145 int surface_id = kNoSurfaceID;
143 146
144 // Coded size of the video frame hint, subject to change. 147 // Coded size of the video frame hint, subject to change.
145 gfx::Size initial_expected_coded_size = gfx::Size(320, 240); 148 gfx::Size initial_expected_coded_size = gfx::Size(320, 240);
146 149
147 OutputMode output_mode = OutputMode::ALLOCATE; 150 OutputMode output_mode = OutputMode::ALLOCATE;
151
152 // The list of picture buffer formats that the client knows how to use.
153 std::vector<VideoPixelFormat> supported_output_formats{PIXEL_FORMAT_ARGB,
Pawel Osciak 2016/06/13 07:57:31 What would you think of making an empty list the d
154 PIXEL_FORMAT_XRGB};
148 }; 155 };
149 156
150 // Interface for collaborating with picture interface to provide memory for 157 // Interface for collaborating with picture interface to provide memory for
151 // output picture and blitting them. These callbacks will not be made unless 158 // output picture and blitting them. These callbacks will not be made unless
152 // Initialize() has returned successfully. 159 // Initialize() has returned successfully.
153 // This interface is extended by the various layers that relay messages back 160 // This interface is extended by the various layers that relay messages back
154 // to the plugin, through the PPP_VideoDecoder_Dev interface the plugin 161 // to the plugin, through the PPP_VideoDecoder_Dev interface the plugin
155 // implements. 162 // implements.
156 class MEDIA_EXPORT Client { 163 class MEDIA_EXPORT Client {
157 public: 164 public:
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 // std::unique_ptr<VideoDecodeAccelerator> uses "Destroy()" instead of trying to 340 // std::unique_ptr<VideoDecodeAccelerator> uses "Destroy()" instead of trying to
334 // use the destructor. 341 // use the destructor.
335 template <> 342 template <>
336 struct MEDIA_EXPORT default_delete<media::VideoDecodeAccelerator> { 343 struct MEDIA_EXPORT default_delete<media::VideoDecodeAccelerator> {
337 void operator()(media::VideoDecodeAccelerator* vda) const; 344 void operator()(media::VideoDecodeAccelerator* vda) const;
338 }; 345 };
339 346
340 } // namespace std 347 } // namespace std
341 348
342 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ 349 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW
« no previous file with comments | « media/gpu/ipc/common/media_param_traits_macros.h ('k') | media/video/video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698