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

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

Issue 1942123002: Plumb decoded video pixel format from GPU process to renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test on bots 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
« no previous file with comments | « media/gpu/vt_video_decode_accelerator_mac.cc ('k') | media/video/video_decode_accelerator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // supported by the VDA (see Capabilities), and it is supported by the 160 // supported by the VDA (see Capabilities), and it is supported by the
161 // client (see Config::is_deferred_initialization_allowed), and the initial 161 // client (see Config::is_deferred_initialization_allowed), and the initial
162 // call to VDA::Initialize returns true. 162 // call to VDA::Initialize returns true.
163 // The default implementation is a NOTREACHED, since deferred initialization 163 // The default implementation is a NOTREACHED, since deferred initialization
164 // is not supported by default. 164 // is not supported by default.
165 virtual void NotifyInitializationComplete(bool success); 165 virtual void NotifyInitializationComplete(bool success);
166 166
167 // Callback to tell client how many and what size of buffers to provide. 167 // Callback to tell client how many and what size of buffers to provide.
168 // Note that the actual count provided through AssignPictureBuffers() can be 168 // Note that the actual count provided through AssignPictureBuffers() can be
169 // larger than the value requested. 169 // larger than the value requested.
170 // |format| indicates what format the decoded frames will be produced in
171 // by the VDA, or PIXEL_FORMAT_UNKNOWN if the underlying platform handles
172 // this transparently.
170 virtual void ProvidePictureBuffers(uint32_t requested_num_of_buffers, 173 virtual void ProvidePictureBuffers(uint32_t requested_num_of_buffers,
174 VideoPixelFormat format,
171 uint32_t textures_per_buffer, 175 uint32_t textures_per_buffer,
172 const gfx::Size& dimensions, 176 const gfx::Size& dimensions,
173 uint32_t texture_target) = 0; 177 uint32_t texture_target) = 0;
174 178
175 // Callback to dismiss picture buffer that was assigned earlier. 179 // Callback to dismiss picture buffer that was assigned earlier.
176 virtual void DismissPictureBuffer(int32_t picture_buffer_id) = 0; 180 virtual void DismissPictureBuffer(int32_t picture_buffer_id) = 0;
177 181
178 // Callback to deliver decoded pictures ready to be displayed. 182 // Callback to deliver decoded pictures ready to be displayed.
179 virtual void PictureReady(const Picture& picture) = 0; 183 virtual void PictureReady(const Picture& picture) = 0;
180 184
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 // to run decode operations without GL context, which helps reduce latency and 314 // to run decode operations without GL context, which helps reduce latency and
311 // offloads the GPU Child thread. 315 // offloads the GPU Child thread.
312 virtual bool TryToSetupDecodeOnSeparateThread( 316 virtual bool TryToSetupDecodeOnSeparateThread(
313 const base::WeakPtr<Client>& decode_client, 317 const base::WeakPtr<Client>& decode_client,
314 const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner); 318 const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner);
315 319
316 // Windows creates a BGRA texture. 320 // Windows creates a BGRA texture.
317 // TODO(dshwang): after moving to D3D11, remove this. crbug.com/438691 321 // TODO(dshwang): after moving to D3D11, remove this. crbug.com/438691
318 virtual GLenum GetSurfaceInternalFormat() const; 322 virtual GLenum GetSurfaceInternalFormat() const;
319 323
320 // In IMPORT OutputMode, if supported by the VDA, return the format that it
321 // requires for imported picture buffers.
322 virtual VideoPixelFormat GetOutputFormat() const;
323
324 protected: 324 protected:
325 // Do not delete directly; use Destroy() or own it with a scoped_ptr, which 325 // Do not delete directly; use Destroy() or own it with a scoped_ptr, which
326 // will Destroy() it properly by default. 326 // will Destroy() it properly by default.
327 virtual ~VideoDecodeAccelerator(); 327 virtual ~VideoDecodeAccelerator();
328 }; 328 };
329 329
330 } // namespace media 330 } // namespace media
331 331
332 namespace std { 332 namespace std {
333 333
334 // Specialize std::default_delete so that 334 // Specialize std::default_delete so that
335 // std::unique_ptr<VideoDecodeAccelerator> uses "Destroy()" instead of trying to 335 // std::unique_ptr<VideoDecodeAccelerator> uses "Destroy()" instead of trying to
336 // use the destructor. 336 // use the destructor.
337 template <> 337 template <>
338 struct MEDIA_EXPORT default_delete<media::VideoDecodeAccelerator> { 338 struct MEDIA_EXPORT default_delete<media::VideoDecodeAccelerator> {
339 void operator()(media::VideoDecodeAccelerator* vda) const; 339 void operator()(media::VideoDecodeAccelerator* vda) const;
340 }; 340 };
341 341
342 } // namespace std 342 } // namespace std
343 343
344 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ 344 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW
« no previous file with comments | « media/gpu/vt_video_decode_accelerator_mac.cc ('k') | media/video/video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698