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

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

Issue 10411085: Build AVC decoder configuration record (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 8 years, 7 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/mac_video_decode_accelerator.h
diff --git a/content/common/gpu/media/mac_video_decode_accelerator.h b/content/common/gpu/media/mac_video_decode_accelerator.h
index 7a8262f4c6df6ad29f2f73059e17cfd204059e75..f6be512553cad6f196d78539c042d00b0fb4f00b 100644
--- a/content/common/gpu/media/mac_video_decode_accelerator.h
+++ b/content/common/gpu/media/mac_video_decode_accelerator.h
@@ -12,6 +12,8 @@
#include "base/mac/scoped_cftyperef.h"
#include "base/memory/ref_counted.h"
#include "base/threading/non_thread_safe.h"
+#include "content/common/gpu/media/avc_config_record_builder.h"
+#include "content/common/gpu/media/h264_parser.h"
#include "media/video/video_decode_accelerator.h"
namespace base {
@@ -33,12 +35,6 @@ class MacVideoDecodeAccelerator : public media::VideoDecodeAccelerator,
// Set the OpenGL context to use.
void SetGLContext(void* gl_context);
- // Set extra data required to initialize the H.264 video decoder.
- // TODO(sail): Move this into Initialize.
- bool SetConfigInfo(uint32_t frame_width,
- uint32_t frame_height,
- const std::vector<uint8_t>& avc_data);
-
// media::VideoDecodeAccelerator implementation.
virtual bool Initialize(media::VideoCodecProfile profile) OVERRIDE;
virtual void Decode(const media::BitstreamBuffer& bitstream_buffer) OVERRIDE;
@@ -70,6 +66,14 @@ class MacVideoDecodeAccelerator : public media::VideoDecodeAccelerator,
// Calls the client's reset completed callback.
void NotifyResetDone();
+ // Create the decoder.
+ void CreateDecoder(const std::vector<uint8_t>& extra_data);
+
+ // Send the given NALU to the decoder.
+ void DecodeNALU(const content::H264NALU& nalu,
+ int32 bitstream_buffer_id);
+
+
// To expose client callbacks from VideoDecodeAccelerator.
Client* client_;
// C++ wrapper around the Mac VDA API.
@@ -100,14 +104,14 @@ class MacVideoDecodeAccelerator : public media::VideoDecodeAccelerator,
// The context to use to perform OpenGL operations.
CGLContextObj cgl_context_;
- // The number of bytes used to store the frame buffer size.
- size_t nalu_len_field_size_;
+ // Flag to check if AVC decoder configuration record has been built.
+ bool did_build_config_record_;
- // Size of a video frame.
- gfx::Size frame_size_;
+ // Parser for the H264 stream.
+ content::H264Parser h264_parser_;
- // Flag to check if pictures have been requested from the client.
- bool did_request_pictures_;
+ // Utility to build the AVC configuration record.
+ content::AVCConfigRecordBuilder config_record_builder_;
};
#endif // CONTENT_COMMON_GPU_MEDIA_VIDEO_DECODE_ACCELERATOR_MAC_H_

Powered by Google App Engine
This is Rietveld 408576698