OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
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 AndroidVideoDecoderBase and its | |
14 // various subclasses. |provider| must support PostError. | |
watk
2015/09/09 00:36:01
Comment is out of date already :P
| |
15 #define RETURN_ON_FAILURE(provider, result, log, error) \ | |
16 do { \ | |
17 if (!(result)) { \ | |
18 DLOG(ERROR) << log; \ | |
19 provider->PostError(FROM_HERE, \ | |
20 media::VideoDecodeAccelerator::error); \ | |
21 return; \ | |
22 } \ | |
23 } while (0) | |
24 | |
25 #endif // CONTENT_COMMON_GPU_MEDIA_AVDA_RETURN_ON_FAILURE_H_ | |
OLD | NEW |