1 /* 2 * Copyright (C) 2011 The Android Open Source Project 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 /** 18 ************************************************************************* 19 * @file M4MCS_API.h 20 * @brief MCS error codes definitions (Media Compressor Service) 21 * @note 22 ************************************************************************* 23 **/ 24 25 #ifndef __M4MCS_ErrorCodes_H__ 26 #define __M4MCS_ErrorCodes_H__ 27 28 /** 29 * OSAL basic types and errors */ 30 #include "M4OSA_Types.h" 31 #include "M4OSA_Error.h" 32 33 /** 34 * OSAL core ID definitions */ 35 #include "M4OSA_CoreID.h" 36 37 38 /************************************************************************/ 39 /* Warning codes */ 40 /************************************************************************/ 41 42 /* End of processing, user should now call M4MCS_close() */ 43 #define M4MCS_WAR_TRANSCODING_DONE M4OSA_ERR_CREATE( M4_WAR, M4MCS, 0x1) 44 /* Mediatype is not supported by the MCS */ 45 #define M4MCS_WAR_MEDIATYPE_NOT_SUPPORTED M4OSA_ERR_CREATE( M4_WAR, M4MCS, 0x2) 46 /* Indicate that picture will be automatically resized to fit into the required 47 parameters (file size) */ 48 #define M4MCS_WAR_PICTURE_AUTO_RESIZE M4OSA_ERR_CREATE( M4_WAR, M4MCS, 0x3) 49 50 /************************************************************************/ 51 /* Error codes */ 52 /************************************************************************/ 53 54 55 /* ----- OPEN ERRORS ----- */ 56 57 /* The input file contains no supported stream (may be a corrupted file) */ 58 #define M4MCS_ERR_INPUT_FILE_CONTAINS_NO_SUPPORTED_STREAM M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x01) 59 /* The input file is invalid/corrupted */ 60 #define M4MCS_ERR_INVALID_INPUT_FILE M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x02) 61 /* The input video frame size parameter is undefined */ 62 #define M4MCS_ERR_INVALID_INPUT_VIDEO_FRAME_SIZE M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x03) 63 /* The input video frame size is non multiple of 16 */ 64 #define M4MCS_ERR_INPUT_VIDEO_SIZE_NON_X16 M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x04) 65 66 67 /* ----- SET OUTPUT PARAMS ERRORS ----- */ 68 69 /* The output video format parameter is undefined */ 70 #define M4MCS_ERR_UNDEFINED_OUTPUT_VIDEO_FORMAT M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x10) 71 /* The output video frame size parameter is undefined */ 72 #define M4MCS_ERR_UNDEFINED_OUTPUT_VIDEO_FRAME_SIZE M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x11) 73 /* The output video frame rate parameter is undefined */ 74 #define M4MCS_ERR_UNDEFINED_OUTPUT_VIDEO_FRAME_RATE M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x12) 75 /* The output audio format parameter is undefined */ 76 #define M4MCS_ERR_UNDEFINED_OUTPUT_AUDIO_FORMAT M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x13) 77 /* The output video frame size parameter is incompatible with H263 encoding */ 78 #define M4MCS_ERR_INVALID_VIDEO_FRAME_SIZE_FOR_H263 M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x14) 79 /* The output video frame rate parameter is incompatible with H263 encoding 80 (It can't happen in current version of MCS!) */ 81 #define M4MCS_ERR_INVALID_VIDEO_FRAME_RATE_FOR_H263 M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x15) 82 /* A null clip duration as been computed, which is unvalid (should never happen!) */ 83 #define M4MCS_ERR_DURATION_IS_NULL M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x16) 84 /* The .mp4 container cannot handle h263 codec */ 85 #define M4MCS_ERR_H263_FORBIDDEN_IN_MP4_FILE M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x17) 86 87 88 /* ----- PREPARE DECODERS ERRORS ----- */ 89 90 /* H263 Profile (other than 0) is not supported */ 91 #define M4MCS_ERR_H263_PROFILE_NOT_SUPPORTED M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x20) 92 /* The input file contains an AAC audio track with an invalid sampling frequency 93 (should never happen) */ 94 #define M4MCS_ERR_INVALID_AAC_SAMPLING_FREQUENCY M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x21) 95 /* The audio conversion (AAC to AMR-NB, or MP3) failed */ 96 #define M4MCS_ERR_AUDIO_CONVERSION_FAILED M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x22) 97 98 99 /* ----- SET ENCODING PARAMS ERRORS ----- */ 100 101 /* Begin cut time is larger than the input clip duration */ 102 #define M4MCS_ERR_BEGIN_CUT_LARGER_THAN_DURATION M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x30) 103 /* Begin cut and End cut are equals */ 104 #define M4MCS_ERR_BEGIN_CUT_EQUALS_END_CUT M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x31) 105 /* End cut time is smaller than begin cut time */ 106 #define M4MCS_ERR_END_CUT_SMALLER_THAN_BEGIN_CUT M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x32) 107 /* Not enough space to store whole output file at given bitrates */ 108 #define M4MCS_ERR_MAXFILESIZE_TOO_SMALL M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x33) 109 /* Video bitrate is too low (avoid ugly video) */ 110 #define M4MCS_ERR_VIDEOBITRATE_TOO_LOW M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x34) 111 /* Audio bitrate is too low (16 kbps min for aac, 12.2 for amr, 8 for mp3) */ 112 #define M4MCS_ERR_AUDIOBITRATE_TOO_LOW M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x35) 113 /* Video bitrate too high (we limit to 800 kbps) */ 114 #define M4MCS_ERR_VIDEOBITRATE_TOO_HIGH M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x36) 115 /* Audio bitrate too high (we limit to 96 kbps) */ 116 #define M4MCS_ERR_AUDIOBITRATE_TOO_HIGH M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x37) 117 118 /* ----- OTHERS ERRORS ----- */ 119 #define M4MCS_ERR_OUTPUT_FILE_SIZE_TOO_SMALL M4OSA_ERR_CREATE( M4_ERR, M4MCS, 0x50) 120 #define M4MCS_ERR_NOMORE_SPACE M4OSA_ERR_CREATE(M4_ERR, M4MCS, 0x51) 121 #define M4MCS_ERR_FILE_DRM_PROTECTED M4OSA_ERR_CREATE(M4_ERR, M4MCS, 0x52) 122 #endif /* __M4MCS_ErrorCodes_H__ */ 123 124