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() { | |
222 rendering_thread_.Start(); | |
223 rendering_loop_proxy_ = rendering_thread_.message_loop_proxy(); | |
224 | |
225 base::WaitableEvent done(false, false); | |
226 rendering_loop_proxy_->PostTask( | |
227 FROM_HERE, base::Bind(&RenderingHelper::InitializeOneOff, &done)); | |
228 done.Wait(); | |
229 } | |
230 | |
231 virtual void TearDown() { rendering_thread_.Stop(); } | |
232 | |
233 const scoped_refptr<base::MessageLoopProxy>& rendering_loop_proxy() const { | |
234 return rendering_loop_proxy_; | |
Owen Lin
2015/01/26 07:25:29
considering the message_loop_proxy() has been depr
llandwerlin-old
2015/01/26 11:35:48
Done, with slight change to 1. because coding styl
| |
235 } | |
236 | |
237 private: | |
238 base::Thread rendering_thread_; | |
239 scoped_refptr<base::MessageLoopProxy> rendering_loop_proxy_; | |
240 | |
241 DISALLOW_COPY_AND_ASSIGN(VideoDecodeAcceleratorTestEnvironment); | |
242 }; | |
243 | |
206 // A helper class used to manage the lifetime of a Texture. | 244 // A helper class used to manage the lifetime of a Texture. |
207 class TextureRef : public base::RefCounted<TextureRef> { | 245 class TextureRef : public base::RefCounted<TextureRef> { |
208 public: | 246 public: |
209 TextureRef(uint32 texture_id, const base::Closure& no_longer_needed_cb) | 247 TextureRef(uint32 texture_id, const base::Closure& no_longer_needed_cb) |
210 : texture_id_(texture_id), no_longer_needed_cb_(no_longer_needed_cb) {} | 248 : texture_id_(texture_id), no_longer_needed_cb_(no_longer_needed_cb) {} |
211 | 249 |
212 int32 texture_id() const { return texture_id_; } | 250 int32 texture_id() const { return texture_id_; } |
213 | 251 |
214 private: | 252 private: |
215 friend class base::RefCounted<TextureRef>; | 253 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); | 972 void InitializeRenderingHelper(const RenderingHelperParams& helper_params); |
935 void CreateAndStartDecoder(GLRenderingVDAClient* client, | 973 void CreateAndStartDecoder(GLRenderingVDAClient* client, |
936 ClientStateNotification<ClientState>* note); | 974 ClientStateNotification<ClientState>* note); |
937 void WaitUntilDecodeFinish(ClientStateNotification<ClientState>* note); | 975 void WaitUntilDecodeFinish(ClientStateNotification<ClientState>* note); |
938 void WaitUntilIdle(); | 976 void WaitUntilIdle(); |
939 void OutputLogFile(const base::FilePath::CharType* log_path, | 977 void OutputLogFile(const base::FilePath::CharType* log_path, |
940 const std::string& content); | 978 const std::string& content); |
941 | 979 |
942 std::vector<TestVideoFile*> test_video_files_; | 980 std::vector<TestVideoFile*> test_video_files_; |
943 RenderingHelper rendering_helper_; | 981 RenderingHelper rendering_helper_; |
944 scoped_refptr<base::MessageLoopProxy> rendering_loop_proxy_; | |
945 | 982 |
946 private: | 983 private: |
947 base::Thread rendering_thread_; | |
948 // Required for Thread to work. Not used otherwise. | 984 // Required for Thread to work. Not used otherwise. |
949 base::ShadowingAtExitManager at_exit_manager_; | 985 base::ShadowingAtExitManager at_exit_manager_; |
950 | 986 |
951 DISALLOW_COPY_AND_ASSIGN(VideoDecodeAcceleratorTest); | 987 DISALLOW_COPY_AND_ASSIGN(VideoDecodeAcceleratorTest); |
952 }; | 988 }; |
953 | 989 |
954 VideoDecodeAcceleratorTest::VideoDecodeAcceleratorTest() | 990 VideoDecodeAcceleratorTest::VideoDecodeAcceleratorTest() { |
955 : rendering_thread_("GLRenderingVDAClientThread") {} | 991 } |
956 | 992 |
957 void VideoDecodeAcceleratorTest::SetUp() { | 993 void VideoDecodeAcceleratorTest::SetUp() { |
958 ParseAndReadTestVideoData(g_test_video_data, &test_video_files_); | 994 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 } | 995 } |
974 | 996 |
975 void VideoDecodeAcceleratorTest::TearDown() { | 997 void VideoDecodeAcceleratorTest::TearDown() { |
976 rendering_loop_proxy_->PostTask( | 998 g_env->rendering_loop_proxy()->PostTask( |
977 FROM_HERE, | 999 FROM_HERE, base::Bind(&STLDeleteElements<std::vector<TestVideoFile*>>, |
978 base::Bind(&STLDeleteElements<std::vector<TestVideoFile*> >, | 1000 &test_video_files_)); |
979 &test_video_files_)); | |
980 | 1001 |
981 base::WaitableEvent done(false, false); | 1002 base::WaitableEvent done(false, false); |
982 rendering_loop_proxy_->PostTask( | 1003 g_env->rendering_loop_proxy()->PostTask( |
983 FROM_HERE, | 1004 FROM_HERE, base::Bind(&RenderingHelper::UnInitialize, |
984 base::Bind(&RenderingHelper::UnInitialize, | 1005 base::Unretained(&rendering_helper_), &done)); |
985 base::Unretained(&rendering_helper_), | |
986 &done)); | |
987 done.Wait(); | 1006 done.Wait(); |
988 | 1007 |
989 rendering_thread_.Stop(); | 1008 rendering_helper_.TearDown(); |
990 } | 1009 } |
991 | 1010 |
992 void VideoDecodeAcceleratorTest::ParseAndReadTestVideoData( | 1011 void VideoDecodeAcceleratorTest::ParseAndReadTestVideoData( |
993 base::FilePath::StringType data, | 1012 base::FilePath::StringType data, |
994 std::vector<TestVideoFile*>* test_video_files) { | 1013 std::vector<TestVideoFile*>* test_video_files) { |
995 std::vector<base::FilePath::StringType> entries; | 1014 std::vector<base::FilePath::StringType> entries; |
996 base::SplitString(data, ';', &entries); | 1015 base::SplitString(data, ';', &entries); |
997 CHECK_GE(entries.size(), 1U) << data; | 1016 CHECK_GE(entries.size(), 1U) << data; |
998 for (size_t index = 0; index < entries.size(); ++index) { | 1017 for (size_t index = 0; index < entries.size(); ++index) { |
999 std::vector<base::FilePath::StringType> fields; | 1018 std::vector<base::FilePath::StringType> fields; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1047 | 1066 |
1048 if (video_file->min_fps_render != -1) | 1067 if (video_file->min_fps_render != -1) |
1049 video_file->min_fps_render /= num_concurrent_decoders; | 1068 video_file->min_fps_render /= num_concurrent_decoders; |
1050 if (video_file->min_fps_no_render != -1) | 1069 if (video_file->min_fps_no_render != -1) |
1051 video_file->min_fps_no_render /= num_concurrent_decoders; | 1070 video_file->min_fps_no_render /= num_concurrent_decoders; |
1052 } | 1071 } |
1053 } | 1072 } |
1054 | 1073 |
1055 void VideoDecodeAcceleratorTest::InitializeRenderingHelper( | 1074 void VideoDecodeAcceleratorTest::InitializeRenderingHelper( |
1056 const RenderingHelperParams& helper_params) { | 1075 const RenderingHelperParams& helper_params) { |
1076 rendering_helper_.Setup(); | |
1077 | |
1057 base::WaitableEvent done(false, false); | 1078 base::WaitableEvent done(false, false); |
1058 rendering_loop_proxy_->PostTask( | 1079 g_env->rendering_loop_proxy()->PostTask( |
1059 FROM_HERE, | 1080 FROM_HERE, |
1060 base::Bind(&RenderingHelper::Initialize, | 1081 base::Bind(&RenderingHelper::Initialize, |
1061 base::Unretained(&rendering_helper_), | 1082 base::Unretained(&rendering_helper_), helper_params, &done)); |
1062 helper_params, | |
1063 &done)); | |
1064 done.Wait(); | 1083 done.Wait(); |
1065 } | 1084 } |
1066 | 1085 |
1067 void VideoDecodeAcceleratorTest::CreateAndStartDecoder( | 1086 void VideoDecodeAcceleratorTest::CreateAndStartDecoder( |
1068 GLRenderingVDAClient* client, | 1087 GLRenderingVDAClient* client, |
1069 ClientStateNotification<ClientState>* note) { | 1088 ClientStateNotification<ClientState>* note) { |
1070 rendering_loop_proxy_->PostTask( | 1089 g_env->rendering_loop_proxy()->PostTask( |
1071 FROM_HERE, | 1090 FROM_HERE, base::Bind(&GLRenderingVDAClient::CreateAndStartDecoder, |
1072 base::Bind(&GLRenderingVDAClient::CreateAndStartDecoder, | 1091 base::Unretained(client))); |
1073 base::Unretained(client))); | |
1074 ASSERT_EQ(note->Wait(), CS_DECODER_SET); | 1092 ASSERT_EQ(note->Wait(), CS_DECODER_SET); |
1075 } | 1093 } |
1076 | 1094 |
1077 void VideoDecodeAcceleratorTest::WaitUntilDecodeFinish( | 1095 void VideoDecodeAcceleratorTest::WaitUntilDecodeFinish( |
1078 ClientStateNotification<ClientState>* note) { | 1096 ClientStateNotification<ClientState>* note) { |
1079 for (int i = 0; i < CS_MAX; i++) { | 1097 for (int i = 0; i < CS_MAX; i++) { |
1080 if (note->Wait() == CS_DESTROYED) | 1098 if (note->Wait() == CS_DESTROYED) |
1081 break; | 1099 break; |
1082 } | 1100 } |
1083 } | 1101 } |
1084 | 1102 |
1085 void VideoDecodeAcceleratorTest::WaitUntilIdle() { | 1103 void VideoDecodeAcceleratorTest::WaitUntilIdle() { |
1086 base::WaitableEvent done(false, false); | 1104 base::WaitableEvent done(false, false); |
1087 rendering_loop_proxy_->PostTask( | 1105 g_env->rendering_loop_proxy()->PostTask( |
1088 FROM_HERE, | 1106 FROM_HERE, |
1089 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); | 1107 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); |
1090 done.Wait(); | 1108 done.Wait(); |
1091 } | 1109 } |
1092 | 1110 |
1093 void VideoDecodeAcceleratorTest::OutputLogFile( | 1111 void VideoDecodeAcceleratorTest::OutputLogFile( |
1094 const base::FilePath::CharType* log_path, | 1112 const base::FilePath::CharType* log_path, |
1095 const std::string& content) { | 1113 const std::string& content) { |
1096 base::File file(base::FilePath(log_path), | 1114 base::File file(base::FilePath(log_path), |
1097 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE); | 1115 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; | 1310 video_file->min_fps_no_render : video_file->min_fps_render; |
1293 if (min_fps > 0 && !test_reuse_delay) | 1311 if (min_fps > 0 && !test_reuse_delay) |
1294 EXPECT_GT(client->frames_per_second(), min_fps); | 1312 EXPECT_GT(client->frames_per_second(), min_fps); |
1295 } | 1313 } |
1296 } | 1314 } |
1297 | 1315 |
1298 if (render_as_thumbnails) { | 1316 if (render_as_thumbnails) { |
1299 std::vector<unsigned char> rgb; | 1317 std::vector<unsigned char> rgb; |
1300 bool alpha_solid; | 1318 bool alpha_solid; |
1301 base::WaitableEvent done(false, false); | 1319 base::WaitableEvent done(false, false); |
1302 rendering_loop_proxy_->PostTask( | 1320 g_env->rendering_loop_proxy()->PostTask( |
1303 FROM_HERE, | 1321 FROM_HERE, base::Bind(&RenderingHelper::GetThumbnailsAsRGB, |
1304 base::Bind(&RenderingHelper::GetThumbnailsAsRGB, | 1322 base::Unretained(&rendering_helper_), &rgb, |
1305 base::Unretained(&rendering_helper_), | 1323 &alpha_solid, &done)); |
1306 &rgb, &alpha_solid, &done)); | |
1307 done.Wait(); | 1324 done.Wait(); |
1308 | 1325 |
1309 std::vector<std::string> golden_md5s; | 1326 std::vector<std::string> golden_md5s; |
1310 std::string md5_string = base::MD5String( | 1327 std::string md5_string = base::MD5String( |
1311 base::StringPiece(reinterpret_cast<char*>(&rgb[0]), rgb.size())); | 1328 base::StringPiece(reinterpret_cast<char*>(&rgb[0]), rgb.size())); |
1312 ReadGoldenThumbnailMD5s(test_video_files_[0], &golden_md5s); | 1329 ReadGoldenThumbnailMD5s(test_video_files_[0], &golden_md5s); |
1313 std::vector<std::string>::iterator match = | 1330 std::vector<std::string>::iterator match = |
1314 find(golden_md5s.begin(), golden_md5s.end(), md5_string); | 1331 find(golden_md5s.begin(), golden_md5s.end(), md5_string); |
1315 if (match == golden_md5s.end()) { | 1332 if (match == golden_md5s.end()) { |
1316 // Convert raw RGB into PNG for export. | 1333 // Convert raw RGB into PNG for export. |
(...skipping 25 matching lines...) Expand all Loading... | |
1342 // allowed to finish. | 1359 // allowed to finish. |
1343 if (g_output_log != NULL && delete_decoder_state >= CS_FLUSHED) { | 1360 if (g_output_log != NULL && delete_decoder_state >= CS_FLUSHED) { |
1344 base::File output_file( | 1361 base::File output_file( |
1345 base::FilePath(g_output_log), | 1362 base::FilePath(g_output_log), |
1346 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE); | 1363 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE); |
1347 for (size_t i = 0; i < num_concurrent_decoders; ++i) { | 1364 for (size_t i = 0; i < num_concurrent_decoders; ++i) { |
1348 clients[i]->OutputFrameDeliveryTimes(&output_file); | 1365 clients[i]->OutputFrameDeliveryTimes(&output_file); |
1349 } | 1366 } |
1350 } | 1367 } |
1351 | 1368 |
1352 rendering_loop_proxy_->PostTask( | 1369 g_env->rendering_loop_proxy()->PostTask( |
1353 FROM_HERE, | 1370 FROM_HERE, |
1354 base::Bind(&STLDeleteElements<std::vector<GLRenderingVDAClient*> >, | 1371 base::Bind(&STLDeleteElements<std::vector<GLRenderingVDAClient*>>, |
1355 &clients)); | 1372 &clients)); |
1356 rendering_loop_proxy_->PostTask( | 1373 g_env->rendering_loop_proxy()->PostTask( |
1357 FROM_HERE, | 1374 FROM_HERE, |
1358 base::Bind(&STLDeleteElements< | 1375 base::Bind(&STLDeleteElements< |
1359 std::vector<ClientStateNotification<ClientState>*> >, | 1376 std::vector<ClientStateNotification<ClientState>*>>, |
1360 ¬es)); | 1377 ¬es)); |
1361 WaitUntilIdle(); | 1378 WaitUntilIdle(); |
1362 }; | 1379 }; |
1363 | 1380 |
1364 // Test that replay after EOS works fine. | 1381 // Test that replay after EOS works fine. |
1365 INSTANTIATE_TEST_CASE_P( | 1382 INSTANTIATE_TEST_CASE_P( |
1366 ReplayAfterEOS, VideoDecodeAcceleratorParamTest, | 1383 ReplayAfterEOS, VideoDecodeAcceleratorParamTest, |
1367 ::testing::Values( | 1384 ::testing::Values( |
1368 MakeTuple(1, 1, 4, END_OF_STREAM_RESET, CS_RESET, false, false))); | 1385 MakeTuple(1, 1, 4, END_OF_STREAM_RESET, CS_RESET, false, false))); |
1369 | 1386 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1472 | 1489 |
1473 base::TimeDelta decode_time_median = client->decode_time_median(); | 1490 base::TimeDelta decode_time_median = client->decode_time_median(); |
1474 std::string output_string = | 1491 std::string output_string = |
1475 base::StringPrintf("Decode time median: %" PRId64 " us", | 1492 base::StringPrintf("Decode time median: %" PRId64 " us", |
1476 decode_time_median.InMicroseconds()); | 1493 decode_time_median.InMicroseconds()); |
1477 LOG(INFO) << output_string; | 1494 LOG(INFO) << output_string; |
1478 | 1495 |
1479 if (g_output_log != NULL) | 1496 if (g_output_log != NULL) |
1480 OutputLogFile(g_output_log, output_string); | 1497 OutputLogFile(g_output_log, output_string); |
1481 | 1498 |
1482 rendering_loop_proxy_->DeleteSoon(FROM_HERE, client); | 1499 g_env->rendering_loop_proxy()->DeleteSoon(FROM_HERE, client); |
1483 rendering_loop_proxy_->DeleteSoon(FROM_HERE, note); | 1500 g_env->rendering_loop_proxy()->DeleteSoon(FROM_HERE, note); |
1484 WaitUntilIdle(); | 1501 WaitUntilIdle(); |
1485 }; | 1502 }; |
1486 | 1503 |
1487 // TODO(fischman, vrk): add more tests! In particular: | 1504 // TODO(fischman, vrk): add more tests! In particular: |
1488 // - Test life-cycle: Seek/Stop/Pause/Play for a single decoder. | 1505 // - Test life-cycle: Seek/Stop/Pause/Play for a single decoder. |
1489 // - Test alternate configurations | 1506 // - Test alternate configurations |
1490 // - Test failure conditions. | 1507 // - Test failure conditions. |
1491 // - Test frame size changes mid-stream | 1508 // - Test frame size changes mid-stream |
1492 | 1509 |
1493 } // namespace | 1510 } // namespace |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1541 continue; | 1558 continue; |
1542 } | 1559 } |
1543 if (it->first == "v" || it->first == "vmodule") | 1560 if (it->first == "v" || it->first == "vmodule") |
1544 continue; | 1561 continue; |
1545 if (it->first == "ozone-platform" || it->first == "ozone-use-surfaceless") | 1562 if (it->first == "ozone-platform" || it->first == "ozone-use-surfaceless") |
1546 continue; | 1563 continue; |
1547 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; | 1564 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; |
1548 } | 1565 } |
1549 | 1566 |
1550 base::ShadowingAtExitManager at_exit_manager; | 1567 base::ShadowingAtExitManager at_exit_manager; |
1568 #if defined(OS_WIN) || defined(USE_OZONE) | |
1569 // For windows the decoding thread initializes the media foundation decoder | |
1570 // which uses COM. We need the thread to be a UI thread. | |
1571 // On Ozone, the backend initializes the event system using a UI | |
1572 // thread. | |
1573 base::MessageLoopForUI main_loop; | |
1574 #else | |
1551 base::MessageLoop main_loop; | 1575 base::MessageLoop main_loop; |
1552 content::RenderingHelper::InitializeOneOff(); | 1576 #endif // OS_WIN || USE_OZONE |
1577 | |
1578 #if defined(USE_OZONE) | |
1579 ui::OzonePlatform::InitializeForUI(); | |
1580 #endif | |
1581 | |
1582 content::g_env = | |
1583 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( | |
1584 testing::AddGlobalTestEnvironment( | |
1585 new content::VideoDecodeAcceleratorTestEnvironment())); | |
1553 | 1586 |
1554 return RUN_ALL_TESTS(); | 1587 return RUN_ALL_TESTS(); |
1555 } | 1588 } |
OLD | NEW |