OLD | NEW |
---|---|
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 // The bulk of this file is support code; sorry about that. Here's an overview | 5 // The bulk of this file is support code; sorry about that. Here's an overview |
6 // to hopefully help readers of this code: | 6 // to hopefully help readers of this code: |
7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or | 7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or |
8 // Win/EGL. | 8 // Win/EGL. |
9 // - ClientState is an enum for the state of the decode client used by the test. | 9 // - ClientState is an enum for the state of the decode client used by the test. |
10 // - ClientStateNotification is a barrier abstraction that allows the test code | 10 // - ClientStateNotification is a barrier abstraction that allows the test code |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 #include "content/common/gpu/media/v4l2_video_device.h" | 65 #include "content/common/gpu/media/v4l2_video_device.h" |
66 #endif | 66 #endif |
67 #if defined(ARCH_CPU_X86_FAMILY) | 67 #if defined(ARCH_CPU_X86_FAMILY) |
68 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" | 68 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" |
69 #include "content/common/gpu/media/vaapi_wrapper.h" | 69 #include "content/common/gpu/media/vaapi_wrapper.h" |
70 #endif // defined(ARCH_CPU_X86_FAMILY) | 70 #endif // defined(ARCH_CPU_X86_FAMILY) |
71 #else | 71 #else |
72 #error The VideoAccelerator tests are not supported on this platform. | 72 #error The VideoAccelerator tests are not supported on this platform. |
73 #endif // OS_WIN | 73 #endif // OS_WIN |
74 | 74 |
75 #if defined(USE_OZONE) | |
76 #include "ui/ozone/public/ozone_platform.h" | |
77 #endif // defined(USE_OZONE) | |
78 | |
75 using media::VideoDecodeAccelerator; | 79 using media::VideoDecodeAccelerator; |
76 | 80 |
77 namespace content { | 81 namespace content { |
78 namespace { | 82 namespace { |
79 | 83 |
80 // Values optionally filled in from flags; see main() below. | 84 // Values optionally filled in from flags; see main() below. |
81 // The syntax of multiple test videos is: | 85 // The syntax of multiple test videos is: |
82 // test-video1;test-video2;test-video3 | 86 // test-video1;test-video2;test-video3 |
83 // where only the first video is required and other optional videos would be | 87 // where only the first video is required and other optional videos would be |
84 // decoded by concurrent decoders. | 88 // decoded by concurrent decoders. |
(...skipping 23 matching lines...) Expand all Loading... | |
108 | 112 |
109 // The value is set by the switch "--rendering_warm_up". | 113 // The value is set by the switch "--rendering_warm_up". |
110 int g_rendering_warm_up = 0; | 114 int g_rendering_warm_up = 0; |
111 | 115 |
112 // The value is set by the switch "--num_play_throughs". The video will play | 116 // The value is set by the switch "--num_play_throughs". The video will play |
113 // the specified number of times. In different test cases, we have different | 117 // the specified number of times. In different test cases, we have different |
114 // values for |num_play_throughs|. This setting will override the value. A | 118 // values for |num_play_throughs|. This setting will override the value. A |
115 // special value "0" means no override. | 119 // special value "0" means no override. |
116 int g_num_play_throughs = 0; | 120 int g_num_play_throughs = 0; |
117 | 121 |
122 // Environment to store rendering thread. | |
123 class VideoDecodeAcceleratorTestEnvironment; | |
124 VideoDecodeAcceleratorTestEnvironment* g_env; | |
125 | |
118 // Magic constants for differentiating the reasons for NotifyResetDone being | 126 // Magic constants for differentiating the reasons for NotifyResetDone being |
119 // called. | 127 // called. |
120 enum ResetPoint { | 128 enum ResetPoint { |
121 // Reset() just after calling Decode() with a fragment containing config info. | 129 // Reset() just after calling Decode() with a fragment containing config info. |
122 RESET_AFTER_FIRST_CONFIG_INFO = -4, | 130 RESET_AFTER_FIRST_CONFIG_INFO = -4, |
123 START_OF_STREAM_RESET = -3, | 131 START_OF_STREAM_RESET = -3, |
124 MID_STREAM_RESET = -2, | 132 MID_STREAM_RESET = -2, |
125 END_OF_STREAM_RESET = -1 | 133 END_OF_STREAM_RESET = -1 |
126 }; | 134 }; |
127 | 135 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
196 CS_INITIALIZED = 2, | 204 CS_INITIALIZED = 2, |
197 CS_FLUSHING = 3, | 205 CS_FLUSHING = 3, |
198 CS_FLUSHED = 4, | 206 CS_FLUSHED = 4, |
199 CS_RESETTING = 5, | 207 CS_RESETTING = 5, |
200 CS_RESET = 6, | 208 CS_RESET = 6, |
201 CS_ERROR = 7, | 209 CS_ERROR = 7, |
202 CS_DESTROYED = 8, | 210 CS_DESTROYED = 8, |
203 CS_MAX, // Must be last entry. | 211 CS_MAX, // Must be last entry. |
204 }; | 212 }; |
205 | 213 |
214 // Initialize the GPU thread for rendering. We only need to setup once | |
215 // for all test cases. | |
216 class VideoDecodeAcceleratorTestEnvironment : public ::testing::Environment { | |
217 public: | |
218 VideoDecodeAcceleratorTestEnvironment() | |
219 : rendering_thread_("GLRenderingVDAClientThread") {} | |
220 | |
221 virtual void SetUp() { | |
Pawel Osciak
2015/01/28 07:41:47
virtual -> override in this class please.
llandwerlin-old
2015/01/28 09:39:29
Done.
| |
222 rendering_thread_.Start(); | |
223 | |
224 base::WaitableEvent done(false, false); | |
225 rendering_thread_.task_runner()->PostTask( | |
226 FROM_HERE, base::Bind(&RenderingHelper::InitializeOneOff, &done)); | |
227 done.Wait(); | |
228 } | |
229 | |
230 virtual void TearDown() { rendering_thread_.Stop(); } | |
231 | |
232 scoped_refptr<base::SingleThreadTaskRunner> GetRenderingTaskRunner() const { | |
233 return rendering_thread_.task_runner(); | |
234 } | |
235 | |
236 private: | |
237 base::Thread rendering_thread_; | |
238 | |
239 DISALLOW_COPY_AND_ASSIGN(VideoDecodeAcceleratorTestEnvironment); | |
240 }; | |
241 | |
206 // A helper class used to manage the lifetime of a Texture. | 242 // A helper class used to manage the lifetime of a Texture. |
207 class TextureRef : public base::RefCounted<TextureRef> { | 243 class TextureRef : public base::RefCounted<TextureRef> { |
208 public: | 244 public: |
209 TextureRef(uint32 texture_id, const base::Closure& no_longer_needed_cb) | 245 TextureRef(uint32 texture_id, const base::Closure& no_longer_needed_cb) |
210 : texture_id_(texture_id), no_longer_needed_cb_(no_longer_needed_cb) {} | 246 : texture_id_(texture_id), no_longer_needed_cb_(no_longer_needed_cb) {} |
211 | 247 |
212 int32 texture_id() const { return texture_id_; } | 248 int32 texture_id() const { return texture_id_; } |
213 | 249 |
214 private: | 250 private: |
215 friend class base::RefCounted<TextureRef>; | 251 friend class base::RefCounted<TextureRef>; |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
934 void InitializeRenderingHelper(const RenderingHelperParams& helper_params); | 970 void InitializeRenderingHelper(const RenderingHelperParams& helper_params); |
935 void CreateAndStartDecoder(GLRenderingVDAClient* client, | 971 void CreateAndStartDecoder(GLRenderingVDAClient* client, |
936 ClientStateNotification<ClientState>* note); | 972 ClientStateNotification<ClientState>* note); |
937 void WaitUntilDecodeFinish(ClientStateNotification<ClientState>* note); | 973 void WaitUntilDecodeFinish(ClientStateNotification<ClientState>* note); |
938 void WaitUntilIdle(); | 974 void WaitUntilIdle(); |
939 void OutputLogFile(const base::FilePath::CharType* log_path, | 975 void OutputLogFile(const base::FilePath::CharType* log_path, |
940 const std::string& content); | 976 const std::string& content); |
941 | 977 |
942 std::vector<TestVideoFile*> test_video_files_; | 978 std::vector<TestVideoFile*> test_video_files_; |
943 RenderingHelper rendering_helper_; | 979 RenderingHelper rendering_helper_; |
944 scoped_refptr<base::MessageLoopProxy> rendering_loop_proxy_; | |
945 | 980 |
946 private: | 981 private: |
947 base::Thread rendering_thread_; | |
948 // Required for Thread to work. Not used otherwise. | 982 // Required for Thread to work. Not used otherwise. |
949 base::ShadowingAtExitManager at_exit_manager_; | 983 base::ShadowingAtExitManager at_exit_manager_; |
950 | 984 |
951 DISALLOW_COPY_AND_ASSIGN(VideoDecodeAcceleratorTest); | 985 DISALLOW_COPY_AND_ASSIGN(VideoDecodeAcceleratorTest); |
952 }; | 986 }; |
953 | 987 |
954 VideoDecodeAcceleratorTest::VideoDecodeAcceleratorTest() | 988 VideoDecodeAcceleratorTest::VideoDecodeAcceleratorTest() { |
955 : rendering_thread_("GLRenderingVDAClientThread") {} | 989 } |
956 | 990 |
957 void VideoDecodeAcceleratorTest::SetUp() { | 991 void VideoDecodeAcceleratorTest::SetUp() { |
958 ParseAndReadTestVideoData(g_test_video_data, &test_video_files_); | 992 ParseAndReadTestVideoData(g_test_video_data, &test_video_files_); |
959 | |
960 // Initialize the rendering thread. | |
961 base::Thread::Options options; | |
962 options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; | |
963 #if defined(OS_WIN) || defined(USE_OZONE) | |
964 // For windows the decoding thread initializes the media foundation decoder | |
965 // which uses COM. We need the thread to be a UI thread. | |
966 // On Ozone, the backend initializes the event system using a UI | |
967 // thread. | |
968 options.message_loop_type = base::MessageLoop::TYPE_UI; | |
969 #endif // OS_WIN || USE_OZONE | |
970 | |
971 rendering_thread_.StartWithOptions(options); | |
972 rendering_loop_proxy_ = rendering_thread_.message_loop_proxy(); | |
973 } | 993 } |
974 | 994 |
975 void VideoDecodeAcceleratorTest::TearDown() { | 995 void VideoDecodeAcceleratorTest::TearDown() { |
976 rendering_loop_proxy_->PostTask( | 996 g_env->GetRenderingTaskRunner()->PostTask( |
977 FROM_HERE, | 997 FROM_HERE, base::Bind(&STLDeleteElements<std::vector<TestVideoFile*>>, |
978 base::Bind(&STLDeleteElements<std::vector<TestVideoFile*> >, | 998 &test_video_files_)); |
979 &test_video_files_)); | |
980 | 999 |
981 base::WaitableEvent done(false, false); | 1000 base::WaitableEvent done(false, false); |
982 rendering_loop_proxy_->PostTask( | 1001 g_env->GetRenderingTaskRunner()->PostTask( |
983 FROM_HERE, | 1002 FROM_HERE, base::Bind(&RenderingHelper::UnInitialize, |
984 base::Bind(&RenderingHelper::UnInitialize, | 1003 base::Unretained(&rendering_helper_), &done)); |
985 base::Unretained(&rendering_helper_), | |
986 &done)); | |
987 done.Wait(); | 1004 done.Wait(); |
988 | 1005 |
989 rendering_thread_.Stop(); | 1006 rendering_helper_.TearDown(); |
990 } | 1007 } |
991 | 1008 |
992 void VideoDecodeAcceleratorTest::ParseAndReadTestVideoData( | 1009 void VideoDecodeAcceleratorTest::ParseAndReadTestVideoData( |
993 base::FilePath::StringType data, | 1010 base::FilePath::StringType data, |
994 std::vector<TestVideoFile*>* test_video_files) { | 1011 std::vector<TestVideoFile*>* test_video_files) { |
995 std::vector<base::FilePath::StringType> entries; | 1012 std::vector<base::FilePath::StringType> entries; |
996 base::SplitString(data, ';', &entries); | 1013 base::SplitString(data, ';', &entries); |
997 CHECK_GE(entries.size(), 1U) << data; | 1014 CHECK_GE(entries.size(), 1U) << data; |
998 for (size_t index = 0; index < entries.size(); ++index) { | 1015 for (size_t index = 0; index < entries.size(); ++index) { |
999 std::vector<base::FilePath::StringType> fields; | 1016 std::vector<base::FilePath::StringType> fields; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1047 | 1064 |
1048 if (video_file->min_fps_render != -1) | 1065 if (video_file->min_fps_render != -1) |
1049 video_file->min_fps_render /= num_concurrent_decoders; | 1066 video_file->min_fps_render /= num_concurrent_decoders; |
1050 if (video_file->min_fps_no_render != -1) | 1067 if (video_file->min_fps_no_render != -1) |
1051 video_file->min_fps_no_render /= num_concurrent_decoders; | 1068 video_file->min_fps_no_render /= num_concurrent_decoders; |
1052 } | 1069 } |
1053 } | 1070 } |
1054 | 1071 |
1055 void VideoDecodeAcceleratorTest::InitializeRenderingHelper( | 1072 void VideoDecodeAcceleratorTest::InitializeRenderingHelper( |
1056 const RenderingHelperParams& helper_params) { | 1073 const RenderingHelperParams& helper_params) { |
1074 rendering_helper_.Setup(); | |
1075 | |
1057 base::WaitableEvent done(false, false); | 1076 base::WaitableEvent done(false, false); |
1058 rendering_loop_proxy_->PostTask( | 1077 g_env->GetRenderingTaskRunner()->PostTask( |
1059 FROM_HERE, | 1078 FROM_HERE, |
1060 base::Bind(&RenderingHelper::Initialize, | 1079 base::Bind(&RenderingHelper::Initialize, |
1061 base::Unretained(&rendering_helper_), | 1080 base::Unretained(&rendering_helper_), helper_params, &done)); |
1062 helper_params, | |
1063 &done)); | |
1064 done.Wait(); | 1081 done.Wait(); |
1065 } | 1082 } |
1066 | 1083 |
1067 void VideoDecodeAcceleratorTest::CreateAndStartDecoder( | 1084 void VideoDecodeAcceleratorTest::CreateAndStartDecoder( |
1068 GLRenderingVDAClient* client, | 1085 GLRenderingVDAClient* client, |
1069 ClientStateNotification<ClientState>* note) { | 1086 ClientStateNotification<ClientState>* note) { |
1070 rendering_loop_proxy_->PostTask( | 1087 g_env->GetRenderingTaskRunner()->PostTask( |
1071 FROM_HERE, | 1088 FROM_HERE, base::Bind(&GLRenderingVDAClient::CreateAndStartDecoder, |
1072 base::Bind(&GLRenderingVDAClient::CreateAndStartDecoder, | 1089 base::Unretained(client))); |
1073 base::Unretained(client))); | |
1074 ASSERT_EQ(note->Wait(), CS_DECODER_SET); | 1090 ASSERT_EQ(note->Wait(), CS_DECODER_SET); |
1075 } | 1091 } |
1076 | 1092 |
1077 void VideoDecodeAcceleratorTest::WaitUntilDecodeFinish( | 1093 void VideoDecodeAcceleratorTest::WaitUntilDecodeFinish( |
1078 ClientStateNotification<ClientState>* note) { | 1094 ClientStateNotification<ClientState>* note) { |
1079 for (int i = 0; i < CS_MAX; i++) { | 1095 for (int i = 0; i < CS_MAX; i++) { |
1080 if (note->Wait() == CS_DESTROYED) | 1096 if (note->Wait() == CS_DESTROYED) |
1081 break; | 1097 break; |
1082 } | 1098 } |
1083 } | 1099 } |
1084 | 1100 |
1085 void VideoDecodeAcceleratorTest::WaitUntilIdle() { | 1101 void VideoDecodeAcceleratorTest::WaitUntilIdle() { |
1086 base::WaitableEvent done(false, false); | 1102 base::WaitableEvent done(false, false); |
1087 rendering_loop_proxy_->PostTask( | 1103 g_env->GetRenderingTaskRunner()->PostTask( |
1088 FROM_HERE, | 1104 FROM_HERE, |
1089 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); | 1105 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); |
1090 done.Wait(); | 1106 done.Wait(); |
1091 } | 1107 } |
1092 | 1108 |
1093 void VideoDecodeAcceleratorTest::OutputLogFile( | 1109 void VideoDecodeAcceleratorTest::OutputLogFile( |
1094 const base::FilePath::CharType* log_path, | 1110 const base::FilePath::CharType* log_path, |
1095 const std::string& content) { | 1111 const std::string& content) { |
1096 base::File file(base::FilePath(log_path), | 1112 base::File file(base::FilePath(log_path), |
1097 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE); | 1113 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1292 video_file->min_fps_no_render : video_file->min_fps_render; | 1308 video_file->min_fps_no_render : video_file->min_fps_render; |
1293 if (min_fps > 0 && !test_reuse_delay) | 1309 if (min_fps > 0 && !test_reuse_delay) |
1294 EXPECT_GT(client->frames_per_second(), min_fps); | 1310 EXPECT_GT(client->frames_per_second(), min_fps); |
1295 } | 1311 } |
1296 } | 1312 } |
1297 | 1313 |
1298 if (render_as_thumbnails) { | 1314 if (render_as_thumbnails) { |
1299 std::vector<unsigned char> rgb; | 1315 std::vector<unsigned char> rgb; |
1300 bool alpha_solid; | 1316 bool alpha_solid; |
1301 base::WaitableEvent done(false, false); | 1317 base::WaitableEvent done(false, false); |
1302 rendering_loop_proxy_->PostTask( | 1318 g_env->GetRenderingTaskRunner()->PostTask( |
1303 FROM_HERE, | 1319 FROM_HERE, base::Bind(&RenderingHelper::GetThumbnailsAsRGB, |
1304 base::Bind(&RenderingHelper::GetThumbnailsAsRGB, | 1320 base::Unretained(&rendering_helper_), &rgb, |
1305 base::Unretained(&rendering_helper_), | 1321 &alpha_solid, &done)); |
1306 &rgb, &alpha_solid, &done)); | |
1307 done.Wait(); | 1322 done.Wait(); |
1308 | 1323 |
1309 std::vector<std::string> golden_md5s; | 1324 std::vector<std::string> golden_md5s; |
1310 std::string md5_string = base::MD5String( | 1325 std::string md5_string = base::MD5String( |
1311 base::StringPiece(reinterpret_cast<char*>(&rgb[0]), rgb.size())); | 1326 base::StringPiece(reinterpret_cast<char*>(&rgb[0]), rgb.size())); |
1312 ReadGoldenThumbnailMD5s(test_video_files_[0], &golden_md5s); | 1327 ReadGoldenThumbnailMD5s(test_video_files_[0], &golden_md5s); |
1313 std::vector<std::string>::iterator match = | 1328 std::vector<std::string>::iterator match = |
1314 find(golden_md5s.begin(), golden_md5s.end(), md5_string); | 1329 find(golden_md5s.begin(), golden_md5s.end(), md5_string); |
1315 if (match == golden_md5s.end()) { | 1330 if (match == golden_md5s.end()) { |
1316 // Convert raw RGB into PNG for export. | 1331 // Convert raw RGB into PNG for export. |
(...skipping 25 matching lines...) Expand all Loading... | |
1342 // allowed to finish. | 1357 // allowed to finish. |
1343 if (g_output_log != NULL && delete_decoder_state >= CS_FLUSHED) { | 1358 if (g_output_log != NULL && delete_decoder_state >= CS_FLUSHED) { |
1344 base::File output_file( | 1359 base::File output_file( |
1345 base::FilePath(g_output_log), | 1360 base::FilePath(g_output_log), |
1346 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE); | 1361 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE); |
1347 for (size_t i = 0; i < num_concurrent_decoders; ++i) { | 1362 for (size_t i = 0; i < num_concurrent_decoders; ++i) { |
1348 clients[i]->OutputFrameDeliveryTimes(&output_file); | 1363 clients[i]->OutputFrameDeliveryTimes(&output_file); |
1349 } | 1364 } |
1350 } | 1365 } |
1351 | 1366 |
1352 rendering_loop_proxy_->PostTask( | 1367 g_env->GetRenderingTaskRunner()->PostTask( |
1353 FROM_HERE, | 1368 FROM_HERE, |
1354 base::Bind(&STLDeleteElements<std::vector<GLRenderingVDAClient*> >, | 1369 base::Bind(&STLDeleteElements<std::vector<GLRenderingVDAClient*>>, |
1355 &clients)); | 1370 &clients)); |
1356 rendering_loop_proxy_->PostTask( | 1371 g_env->GetRenderingTaskRunner()->PostTask( |
1357 FROM_HERE, | 1372 FROM_HERE, |
1358 base::Bind(&STLDeleteElements< | 1373 base::Bind(&STLDeleteElements< |
1359 std::vector<ClientStateNotification<ClientState>*> >, | 1374 std::vector<ClientStateNotification<ClientState>*>>, |
1360 ¬es)); | 1375 ¬es)); |
1361 WaitUntilIdle(); | 1376 WaitUntilIdle(); |
1362 }; | 1377 }; |
1363 | 1378 |
1364 // Test that replay after EOS works fine. | 1379 // Test that replay after EOS works fine. |
1365 INSTANTIATE_TEST_CASE_P( | 1380 INSTANTIATE_TEST_CASE_P( |
1366 ReplayAfterEOS, VideoDecodeAcceleratorParamTest, | 1381 ReplayAfterEOS, VideoDecodeAcceleratorParamTest, |
1367 ::testing::Values( | 1382 ::testing::Values( |
1368 MakeTuple(1, 1, 4, END_OF_STREAM_RESET, CS_RESET, false, false))); | 1383 MakeTuple(1, 1, 4, END_OF_STREAM_RESET, CS_RESET, false, false))); |
1369 | 1384 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1472 | 1487 |
1473 base::TimeDelta decode_time_median = client->decode_time_median(); | 1488 base::TimeDelta decode_time_median = client->decode_time_median(); |
1474 std::string output_string = | 1489 std::string output_string = |
1475 base::StringPrintf("Decode time median: %" PRId64 " us", | 1490 base::StringPrintf("Decode time median: %" PRId64 " us", |
1476 decode_time_median.InMicroseconds()); | 1491 decode_time_median.InMicroseconds()); |
1477 LOG(INFO) << output_string; | 1492 LOG(INFO) << output_string; |
1478 | 1493 |
1479 if (g_output_log != NULL) | 1494 if (g_output_log != NULL) |
1480 OutputLogFile(g_output_log, output_string); | 1495 OutputLogFile(g_output_log, output_string); |
1481 | 1496 |
1482 rendering_loop_proxy_->DeleteSoon(FROM_HERE, client); | 1497 g_env->GetRenderingTaskRunner()->DeleteSoon(FROM_HERE, client); |
1483 rendering_loop_proxy_->DeleteSoon(FROM_HERE, note); | 1498 g_env->GetRenderingTaskRunner()->DeleteSoon(FROM_HERE, note); |
1484 WaitUntilIdle(); | 1499 WaitUntilIdle(); |
1485 }; | 1500 }; |
1486 | 1501 |
1487 // TODO(fischman, vrk): add more tests! In particular: | 1502 // TODO(fischman, vrk): add more tests! In particular: |
1488 // - Test life-cycle: Seek/Stop/Pause/Play for a single decoder. | 1503 // - Test life-cycle: Seek/Stop/Pause/Play for a single decoder. |
1489 // - Test alternate configurations | 1504 // - Test alternate configurations |
1490 // - Test failure conditions. | 1505 // - Test failure conditions. |
1491 // - Test frame size changes mid-stream | 1506 // - Test frame size changes mid-stream |
1492 | 1507 |
1493 } // namespace | 1508 } // namespace |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1541 continue; | 1556 continue; |
1542 } | 1557 } |
1543 if (it->first == "v" || it->first == "vmodule") | 1558 if (it->first == "v" || it->first == "vmodule") |
1544 continue; | 1559 continue; |
1545 if (it->first == "ozone-platform" || it->first == "ozone-use-surfaceless") | 1560 if (it->first == "ozone-platform" || it->first == "ozone-use-surfaceless") |
1546 continue; | 1561 continue; |
1547 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; | 1562 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; |
1548 } | 1563 } |
1549 | 1564 |
1550 base::ShadowingAtExitManager at_exit_manager; | 1565 base::ShadowingAtExitManager at_exit_manager; |
1566 #if defined(OS_WIN) || defined(USE_OZONE) | |
1567 // For windows the decoding thread initializes the media foundation decoder | |
1568 // which uses COM. We need the thread to be a UI thread. | |
1569 // On Ozone, the backend initializes the event system using a UI | |
1570 // thread. | |
1571 base::MessageLoopForUI main_loop; | |
1572 #else | |
1551 base::MessageLoop main_loop; | 1573 base::MessageLoop main_loop; |
1552 content::RenderingHelper::InitializeOneOff(); | 1574 #endif // OS_WIN || USE_OZONE |
1575 | |
1576 #if defined(USE_OZONE) | |
1577 ui::OzonePlatform::InitializeForUI(); | |
1578 #endif | |
1579 | |
1580 content::g_env = | |
1581 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( | |
1582 testing::AddGlobalTestEnvironment( | |
1583 new content::VideoDecodeAcceleratorTestEnvironment())); | |
1553 | 1584 |
1554 return RUN_ALL_TESTS(); | 1585 return RUN_ALL_TESTS(); |
1555 } | 1586 } |
OLD | NEW |