Chromium Code Reviews| Index: content/common/gpu/media/vt_video_decode_accelerator.h |
| diff --git a/content/common/gpu/media/vt_video_decode_accelerator.h b/content/common/gpu/media/vt_video_decode_accelerator.h |
| index 5b5d8be070c194b13095ba5a39a135103cc6a70d..6d1c943057b0371341128fe78b9e1bcce7da6e9e 100644 |
| --- a/content/common/gpu/media/vt_video_decode_accelerator.h |
| +++ b/content/common/gpu/media/vt_video_decode_accelerator.h |
| @@ -5,19 +5,25 @@ |
| #ifndef CONTENT_COMMON_GPU_MEDIA_VT_VIDEO_DECODE_ACCELERATOR_H_ |
| #define CONTENT_COMMON_GPU_MEDIA_VT_VIDEO_DECODE_ACCELERATOR_H_ |
| -#include <stdint.h> |
| - |
| +#include "base/basictypes.h" |
| +#include "base/mac/scoped_cftyperef.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/message_loop/message_loop.h" |
| -#include "base/message_loop/message_loop_proxy.h" |
| +#include "base/threading/thread.h" |
| +#include "content/common/gpu/media/vt.h" |
| +#include "media/filters/h264_parser.h" |
| #include "media/video/video_decode_accelerator.h" |
| #include "ui/gl/gl_context_cgl.h" |
| +namespace base { |
| +class SingleThreadTaskRunner; |
| +} // namespace base |
| + |
| namespace content { |
| -// (Stub of a) VideoToolbox.framework implementation of the |
| -// VideoDecodeAccelerator interface for Mac OS X. |
| +// VideoToolbox.framework implementation of the VideoDecodeAccelerator |
| +// interface for Mac OS X (currently limited to 10.9+). |
| class VTVideoDecodeAccelerator |
| : public media::VideoDecodeAccelerator, |
| public base::NonThreadSafe { |
| @@ -38,10 +44,34 @@ class VTVideoDecodeAccelerator |
| virtual void Destroy() OVERRIDE; |
| virtual bool CanDecodeOnIOThread() OVERRIDE; |
| + // Called by VideoToolbox when a frame is decoded. |
| + void Output( |
| + int32_t bitstream_id, |
| + OSStatus status, |
| + VTDecodeInfoFlags info_flags, |
| + CVImageBufferRef image_buffer); |
| + |
| private: |
| - scoped_refptr<base::MessageLoopProxy> loop_proxy_; |
| + // Configure a VideoToolbox decompression session from parameter set NALUs. |
| + void ConfigureDecoder( |
| + const std::vector<const uint8_t*>& nalu_data_ptrs, |
| + const std::vector<size_t>& nalu_data_sizes); |
| + |
| + // Decode a frame of bitstream. |
| + void DecodeTask(const media::BitstreamBuffer); |
| + |
| + scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner_; |
|
scherkus (not reviewing)
2014/07/09 22:39:25
nit: I'd just get rid of this until you need it
|
| CGLContextObj cgl_context_; |
| media::VideoDecodeAccelerator::Client* client_; |
| + base::Thread decoder_thread_; |
| + |
| + // Decoder configuration (used only on decoder thread). |
| + VTDecompressionOutputCallbackRecord callback_; |
| + base::ScopedCFTypeRef<CMFormatDescriptionRef> format_; |
| + base::ScopedCFTypeRef<VTDecompressionSessionRef> session_; |
| + media::H264Parser parser_; |
| + int32_t coded_width_; |
|
Pawel Osciak
2014/07/10 00:10:55
Nit: use gfx::Size ?
|
| + int32_t coded_height_; |
| // Member variables should appear before the WeakPtrFactory, to ensure |
| // that any WeakPtrs to Controller are invalidated before its members |