OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
no sievers
2015/09/11 00:20:39
nit: drop (c)
liberato (no reviews please)
2015/09/14 17:41:28
Done.
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_COMMON_GPU_MEDIA_AVDA_RETURN_ON_FAILURE_H_ | |
6 #define CONTENT_COMMON_GPU_MEDIA_AVDA_RETURN_ON_FAILURE_H_ | |
7 | |
8 #include "media/video/video_decode_accelerator.h" | |
9 | |
10 // Helper macros for dealing with failure. If |result| evaluates false, emit | |
11 // |log| to ERROR, register |error| with the decoder, and return. This will | |
12 // also transition to the error state, stopping further decoding. | |
13 // This is meant to be used only within AndroidVideoDecoder and the various | |
14 // backing strategies. |provider| must support PostError. | |
15 #define RETURN_ON_FAILURE(provider, result, log, error) \ | |
16 do { \ | |
17 if (!(result)) { \ | |
18 DLOG(ERROR) << log; \ | |
19 provider->PostError(FROM_HERE, media::VideoDecodeAccelerator::error); \ | |
20 return; \ | |
21 } \ | |
22 } while (0) | |
23 | |
24 #endif // CONTENT_COMMON_GPU_MEDIA_AVDA_RETURN_ON_FAILURE_H_ | |
OLD | NEW |