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

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

Issue 10408003: Plumb extra_data() to VideoDecodeAccelerator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rev interface versino 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.mm
diff --git a/content/common/gpu/media/mac_video_decode_accelerator.mm b/content/common/gpu/media/mac_video_decode_accelerator.mm
index a68b4d22c41114c19af4a5be6c20040fd812b2d0..e926aee42476ca5fa2c07d811ca0bc0082421d5d 100644
--- a/content/common/gpu/media/mac_video_decode_accelerator.mm
+++ b/content/common/gpu/media/mac_video_decode_accelerator.mm
@@ -95,25 +95,25 @@ void MacVideoDecodeAccelerator::SetGLContext(void* gl_context) {
cgl_context_ = static_cast<CGLContextObj>(gl_context);
}
-bool MacVideoDecodeAccelerator::SetConfigInfo(
- uint32_t frame_width,
- uint32_t frame_height,
- const std::vector<uint8_t>& avc_data) {
- frame_width_ = frame_width;
- frame_height_ = frame_height;
- nalu_len_field_size_ = (avc_data[4] & 0x03) + 1;
+bool MacVideoDecodeAccelerator::Initialize(
+ media::VideoCodecProfile profile,
+ const gfx::Size& frame_size,
+ const std::vector<uint8_t>& extra_data) {
+ if (extra_data.size() < 5)
+ return false;
+
+ frame_width_ = frame_size.width();
+ frame_height_ = frame_size.height();
+ nalu_len_field_size_ = (extra_data[4] & 0x03) + 1;
DCHECK(!vda_.get());
vda_ = new gfx::VideoDecodeAccelerationSupport();
gfx::VideoDecodeAccelerationSupport::Status status = vda_->Create(
frame_width_, frame_height_,
- kCVPixelFormatType_422YpCbCr8, &avc_data.front(), avc_data.size());
+ kCVPixelFormatType_422YpCbCr8, &extra_data.front(), extra_data.size());
if (status != gfx::VideoDecodeAccelerationSupport::VDA_SUCCESS)
return false;
- return true;
-}
-bool MacVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile) {
if (client_)
client_->NotifyInitializeDone();
return true;
« no previous file with comments | « content/common/gpu/media/mac_video_decode_accelerator.h ('k') | content/common/gpu/media/omx_video_decode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698