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

Side by Side Diff: content/browser/renderer_host/media/web_contents_video_capture_device_unittest.cc

Issue 22645005: media::VideoFrame::WrapExternalSharedMemory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@git-svn
Patch Set: 87b7a18a Rebase, added TODO Created 7 years, 4 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
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 #include "content/browser/renderer_host/media/web_contents_video_capture_device. h" 5 #include "content/browser/renderer_host/media/web_contents_video_capture_device. h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/debug/debugger.h" 8 #include "base/debug/debugger.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/test/test_timeouts.h" 10 #include "base/test/test_timeouts.h"
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 int rotation, 367 int rotation,
368 bool flip_vert, 368 bool flip_vert,
369 bool flip_horiz) OVERRIDE { 369 bool flip_horiz) OVERRIDE {
370 FAIL(); 370 FAIL();
371 } 371 }
372 372
373 virtual void OnIncomingCapturedVideoFrame( 373 virtual void OnIncomingCapturedVideoFrame(
374 const scoped_refptr<media::VideoFrame>& frame, 374 const scoped_refptr<media::VideoFrame>& frame,
375 base::Time timestamp) OVERRIDE { 375 base::Time timestamp) OVERRIDE {
376 EXPECT_EQ(gfx::Size(kTestWidth, kTestHeight), frame->coded_size()); 376 EXPECT_EQ(gfx::Size(kTestWidth, kTestHeight), frame->coded_size());
377 EXPECT_EQ(media::VideoFrame::YV12, frame->format()); 377 EXPECT_EQ(media::VideoFrame::I420, frame->format());
378 EXPECT_LE( 378 EXPECT_LE(
379 0, 379 0,
380 buffer_pool_->RecognizeReservedBuffer(frame->shared_memory_handle())); 380 buffer_pool_->RecognizeReservedBuffer(frame->shared_memory_handle()));
381 uint8 yuv[3]; 381 uint8 yuv[3];
382 for (int plane = 0; plane < 3; ++plane) { 382 for (int plane = 0; plane < 3; ++plane) {
383 yuv[plane] = frame->data(plane)[0]; 383 yuv[plane] = frame->data(plane)[0];
384 } 384 }
385 // TODO(nick): We just look at the first pixel presently, because if 385 // TODO(nick): We just look at the first pixel presently, because if
386 // the analysis is too slow, the backlog of frames will grow without bound 386 // the analysis is too slow, the backlog of frames will grow without bound
387 // and trouble erupts. http://crbug.com/174519 387 // and trouble erupts. http://crbug.com/174519
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 ASSERT_NO_FATAL_FAILURE(consumer()->WaitForNextColor(SK_ColorGREEN)); 788 ASSERT_NO_FATAL_FAILURE(consumer()->WaitForNextColor(SK_ColorGREEN));
789 source()->SetSolidColor(SK_ColorRED); 789 source()->SetSolidColor(SK_ColorRED);
790 ASSERT_NO_FATAL_FAILURE(consumer()->WaitForNextColor(SK_ColorRED)); 790 ASSERT_NO_FATAL_FAILURE(consumer()->WaitForNextColor(SK_ColorRED));
791 791
792 device()->Stop(); 792 device()->Stop();
793 device()->DeAllocate(); 793 device()->DeAllocate();
794 } 794 }
795 795
796 } // namespace 796 } // namespace
797 } // namespace content 797 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698