| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // Trivial serialized thread worker interface implementation. | 200 // Trivial serialized thread worker interface implementation. |
| 201 // Note any worker that requires synchronization between other workers will | 201 // Note any worker that requires synchronization between other workers will |
| 202 // hang. | 202 // hang. |
| 203 namespace impl { | 203 namespace impl { |
| 204 | 204 |
| 205 void Init(VP9Worker *const worker) { memset(worker, 0, sizeof(*worker)); } | 205 void Init(VP9Worker *const worker) { memset(worker, 0, sizeof(*worker)); } |
| 206 int Reset(VP9Worker *const /*worker*/) { return 1; } | 206 int Reset(VP9Worker *const /*worker*/) { return 1; } |
| 207 int Sync(VP9Worker *const worker) { return !worker->had_error; } | 207 int Sync(VP9Worker *const worker) { return !worker->had_error; } |
| 208 | 208 |
| 209 void Execute(VP9Worker *const worker) { | 209 void Execute(VP9Worker *const worker) { |
| 210 worker->had_error |= worker->hook(worker->data1, worker->data2); | 210 worker->had_error |= !worker->hook(worker->data1, worker->data2); |
| 211 } | 211 } |
| 212 | 212 |
| 213 void Launch(VP9Worker *const worker) { Execute(worker); } | 213 void Launch(VP9Worker *const worker) { Execute(worker); } |
| 214 void End(VP9Worker *const /*worker*/) {} | 214 void End(VP9Worker *const /*worker*/) {} |
| 215 | 215 |
| 216 } // namespace impl | 216 } // namespace impl |
| 217 | 217 |
| 218 TEST(VP9WorkerThreadTest, TestSerialInterface) { | 218 TEST(VP9WorkerThreadTest, TestSerialInterface) { |
| 219 static const VP9WorkerInterface serial_interface = { | 219 static const VP9WorkerInterface serial_interface = { |
| 220 impl::Init, impl::Reset, impl::Sync, impl::Launch, impl::Execute, impl::End | 220 impl::Init, impl::Reset, impl::Sync, impl::Launch, impl::Execute, impl::End |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 { NULL, NULL } | 305 { NULL, NULL } |
| 306 }; | 306 }; |
| 307 | 307 |
| 308 DecodeFiles(files); | 308 DecodeFiles(files); |
| 309 } | 309 } |
| 310 #endif // CONFIG_WEBM_IO | 310 #endif // CONFIG_WEBM_IO |
| 311 | 311 |
| 312 INSTANTIATE_TEST_CASE_P(Synchronous, VP9WorkerThreadTest, ::testing::Bool()); | 312 INSTANTIATE_TEST_CASE_P(Synchronous, VP9WorkerThreadTest, ::testing::Bool()); |
| 313 | 313 |
| 314 } // namespace | 314 } // namespace |
| OLD | NEW |