1 /* 2 * Copyright (c) 2009-2011 Intel Corporation. All rights reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef __VIDEO_ENCODER_LOG_H__ 18 #define __VIDEO_ENCODER_LOG_H__ 19 20 #define LOG_TAG "VideoEncoder" 21 22 #include <wrs_omxil_core/log.h> 23 24 #define LOG_V ALOGV 25 #define LOG_D ALOGD 26 #define LOG_I ALOGI 27 #define LOG_W ALOGW 28 #define LOG_E ALOGE 29 30 extern int32_t gLogLevel; 31 #define CHECK_VA_STATUS_RETURN(FUNC)\ 32 if (vaStatus != VA_STATUS_SUCCESS) {\ 33 LOG_E(FUNC" failed. vaStatus = %d\n", vaStatus);\ 34 return ENCODE_DRIVER_FAIL;\ 35 } 36 37 #define CHECK_VA_STATUS_GOTO_CLEANUP(FUNC)\ 38 if (vaStatus != VA_STATUS_SUCCESS) {\ 39 LOG_E(FUNC" failed. vaStatus = %d\n", vaStatus);\ 40 ret = ENCODE_DRIVER_FAIL; \ 41 goto CLEAN_UP;\ 42 } 43 44 #define CHECK_ENCODE_STATUS_RETURN(FUNC)\ 45 if (ret != ENCODE_SUCCESS) { \ 46 LOG_E(FUNC"Failed. ret = 0x%08x\n", ret); \ 47 return ret; \ 48 } 49 50 #define CHECK_ENCODE_STATUS_CLEANUP(FUNC)\ 51 if (ret != ENCODE_SUCCESS) { \ 52 LOG_E(FUNC"Failed, ret = 0x%08x\n", ret); \ 53 goto CLEAN_UP;\ 54 } 55 56 #define CHECK_NULL_RETURN_IFFAIL(POINTER)\ 57 if (POINTER == NULL) { \ 58 LOG_E("Invalid pointer\n"); \ 59 return ENCODE_NULL_PTR;\ 60 } 61 #endif /* __VIDEO_ENCODER_LOG_H__ */ 62