| OLD | NEW |
| 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 "media/capture/video/video_capture_buffer_pool.h" | 7 #include "media/capture/video/video_capture_buffer_pool.h" |
| 8 | 8 |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 namespace content { | 34 namespace content { |
| 35 | 35 |
| 36 struct PixelFormatAndStorage { | 36 struct PixelFormatAndStorage { |
| 37 media::VideoPixelFormat pixel_format; | 37 media::VideoPixelFormat pixel_format; |
| 38 media::VideoPixelStorage pixel_storage; | 38 media::VideoPixelStorage pixel_storage; |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 static const PixelFormatAndStorage kCapturePixelFormatAndStorages[] = { | 41 static const PixelFormatAndStorage kCapturePixelFormatAndStorages[] = { |
| 42 {media::PIXEL_FORMAT_I420, media::PIXEL_STORAGE_CPU}, | 42 {media::PIXEL_FORMAT_I420, media::PIXEL_STORAGE_CPU}, |
| 43 {media::PIXEL_FORMAT_ARGB, media::PIXEL_STORAGE_CPU}, | 43 {media::PIXEL_FORMAT_ARGB, media::PIXEL_STORAGE_CPU}, |
| 44 {media::PIXEL_FORMAT_Y16, media::PIXEL_STORAGE_CPU}, |
| 44 #if !defined(OS_ANDROID) | 45 #if !defined(OS_ANDROID) |
| 45 {media::PIXEL_FORMAT_I420, | 46 {media::PIXEL_FORMAT_I420, media::PIXEL_STORAGE_GPUMEMORYBUFFER}, |
| 46 media::PIXEL_STORAGE_GPUMEMORYBUFFER}, | 47 // TODO(astojilj): Y16 on OSX/Linux is OK. Check Windows. |
| 48 {media::PIXEL_FORMAT_Y16, media::PIXEL_STORAGE_GPUMEMORYBUFFER}, |
| 47 #endif | 49 #endif |
| 48 }; | 50 }; |
| 49 | 51 |
| 50 static const int kTestBufferPoolSize = 3; | 52 static const int kTestBufferPoolSize = 3; |
| 51 | 53 |
| 52 // Note that this test does not exercise the class VideoCaptureBufferPool | 54 // Note that this test does not exercise the class VideoCaptureBufferPool |
| 53 // in isolation. The "unit under test" is an instance of VideoCaptureBufferPool | 55 // in isolation. The "unit under test" is an instance of VideoCaptureBufferPool |
| 54 // with some context that is specific to renderer_host/media, and therefore | 56 // with some context that is specific to renderer_host/media, and therefore |
| 55 // this test must live here and not in media/capture/video. | 57 // this test must live here and not in media/capture/video. |
| 56 class VideoCaptureBufferPoolTest | 58 class VideoCaptureBufferPoolTest |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 ASSERT_NE(nullptr, held_buffers.back().get()); | 505 ASSERT_NE(nullptr, held_buffers.back().get()); |
| 504 resurrected = ResurrectLastBuffer(gfx::Size(10, 10), GetParam()); | 506 resurrected = ResurrectLastBuffer(gfx::Size(10, 10), GetParam()); |
| 505 ASSERT_EQ(nullptr, resurrected.get()); | 507 ASSERT_EQ(nullptr, resurrected.get()); |
| 506 } | 508 } |
| 507 | 509 |
| 508 INSTANTIATE_TEST_CASE_P(, | 510 INSTANTIATE_TEST_CASE_P(, |
| 509 VideoCaptureBufferPoolTest, | 511 VideoCaptureBufferPoolTest, |
| 510 testing::ValuesIn(kCapturePixelFormatAndStorages)); | 512 testing::ValuesIn(kCapturePixelFormatAndStorages)); |
| 511 | 513 |
| 512 } // namespace content | 514 } // namespace content |
| OLD | NEW |