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

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

Issue 2121043002: 16 bpp video stream capture, render and WebGL usage - Realsense R200 & SR300 support. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests: cc, skcanvas_video_renderer, wrtcrecorder... Fake capture supports Y16. Created 4 years, 2 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 // Unit test for VideoCaptureBufferPool. 5 // Unit test for VideoCaptureBufferPool.
6 6
7 #include "content/browser/renderer_host/media/video_capture_buffer_pool.h" 7 #include "content/browser/renderer_host/media/video_capture_buffer_pool.h"
8 8
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 21 matching lines...) Expand all
32 namespace content { 32 namespace content {
33 33
34 struct PixelFormatAndStorage { 34 struct PixelFormatAndStorage {
35 media::VideoPixelFormat pixel_format; 35 media::VideoPixelFormat pixel_format;
36 media::VideoPixelStorage pixel_storage; 36 media::VideoPixelStorage pixel_storage;
37 }; 37 };
38 38
39 static const PixelFormatAndStorage kCapturePixelFormatAndStorages[] = { 39 static const PixelFormatAndStorage kCapturePixelFormatAndStorages[] = {
40 {media::PIXEL_FORMAT_I420, media::PIXEL_STORAGE_CPU}, 40 {media::PIXEL_FORMAT_I420, media::PIXEL_STORAGE_CPU},
41 {media::PIXEL_FORMAT_ARGB, media::PIXEL_STORAGE_CPU}, 41 {media::PIXEL_FORMAT_ARGB, media::PIXEL_STORAGE_CPU},
42 {media::PIXEL_FORMAT_Y16, media::PIXEL_STORAGE_CPU},
42 #if !defined(OS_ANDROID) 43 #if !defined(OS_ANDROID)
43 {media::PIXEL_FORMAT_I420, 44 {media::PIXEL_FORMAT_I420, media::PIXEL_STORAGE_GPUMEMORYBUFFER},
44 media::PIXEL_STORAGE_GPUMEMORYBUFFER}, 45 // TODO(astojilj): Y16 on OSX/Linux is OK. Why Windows is fine with I420?
46 {media::PIXEL_FORMAT_Y16, media::PIXEL_STORAGE_GPUMEMORYBUFFER},
45 #endif 47 #endif
46 }; 48 };
47 49
48 static const int kTestBufferPoolSize = 3; 50 static const int kTestBufferPoolSize = 3;
49 51
50 class VideoCaptureBufferPoolTest 52 class VideoCaptureBufferPoolTest
51 : public testing::TestWithParam<PixelFormatAndStorage> { 53 : public testing::TestWithParam<PixelFormatAndStorage> {
52 protected: 54 protected:
53 // A GpuMemoryBuffer Mock to provide a trivial RGBA buffer as Map() backing. 55 // A GpuMemoryBuffer Mock to provide a trivial RGBA buffer as Map() backing.
54 // We need to allocate on ctor and deallocate on dtor so that consecutive 56 // We need to allocate on ctor and deallocate on dtor so that consecutive
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 ASSERT_NE(nullptr, held_buffers.back().get()); 497 ASSERT_NE(nullptr, held_buffers.back().get());
496 resurrected = ResurrectLastBuffer(gfx::Size(10, 10), GetParam()); 498 resurrected = ResurrectLastBuffer(gfx::Size(10, 10), GetParam());
497 ASSERT_EQ(nullptr, resurrected.get()); 499 ASSERT_EQ(nullptr, resurrected.get());
498 } 500 }
499 501
500 INSTANTIATE_TEST_CASE_P(, 502 INSTANTIATE_TEST_CASE_P(,
501 VideoCaptureBufferPoolTest, 503 VideoCaptureBufferPoolTest,
502 testing::ValuesIn(kCapturePixelFormatAndStorages)); 504 testing::ValuesIn(kCapturePixelFormatAndStorages));
503 505
504 } // namespace content 506 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698