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

Unified Diff: content/common/gpu/media/vt_video_decode_accelerator.h

Issue 374153003: Use PPS/SPS NALUs to initialize a VTDecompressionSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
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..ca4225e564be2692bb9e440d286ef86002685e3e 100644
--- a/content/common/gpu/media/vt_video_decode_accelerator.h
+++ b/content/common/gpu/media/vt_video_decode_accelerator.h
@@ -5,15 +5,19 @@
#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/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 "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
@@ -38,15 +42,35 @@ 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);
+
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
CGLContextObj cgl_context_;
media::VideoDecodeAccelerator::Client* client_;
+ media::H264Parser parser_;
+
+ // Decoder configuration.
+ VTDecompressionOutputCallbackRecord callback_;
+ CMFormatDescriptionRef format_;
+ VTDecompressionSessionRef session_;
+ int32_t coded_width_;
+ int32_t coded_height_;
// Member variables should appear before the WeakPtrFactory, to ensure
// that any WeakPtrs to Controller are invalidated before its members
// variable's destructors are executed, rendering them invalid.
- base::WeakPtrFactory<VTVideoDecodeAccelerator> weak_this_factory_;
+ base::WeakPtrFactory<VTVideoDecodeAccelerator> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(VTVideoDecodeAccelerator);
};

Powered by Google App Engine
This is Rietveld 408576698