1 /* ------------------------------------------------------------------ 2 * Copyright (C) 1998-2009 PacketVideo 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 13 * express or implied. 14 * See the License for the specific language governing permissions 15 * and limitations under the License. 16 * ------------------------------------------------------------------- 17 */ 18 /*********************************************************************************/ 19 /* ------------------------------------------------------------------- */ 20 /* ISucceedFail Class */ 21 /* ------------------------------------------------------------------- */ 22 /*********************************************************************************/ 23 /* 24 This ISucceedFail Class is the base class for all other classes here 25 - this provides the ability to check for failure when reading in an 26 mp4 file 27 */ 28 29 30 #ifndef ISUCCEEDFAIL_H_INCLUDED 31 #define ISUCCEEDFAIL_H_INCLUDED 32 33 #ifndef PV_MP4FFPARSER_CONFIG_H_INCLUDED 34 #include "pv_mp4ffparser_config.h" 35 #endif 36 37 #ifndef OSCL_FILE_IO_H_INCLUDED 38 #include "oscl_file_io.h" 39 #endif 40 41 42 #define MAX_ERROR_CODES 113 43 44 typedef enum { READ_FAILED = -1, 45 EVERYTHING_FINE = 0, 46 DEFAULT_ERROR = 1, 47 READ_USER_DATA_ATOM_FAILED = 2, 48 READ_MEDIA_DATA_ATOM_FAILED = 3, 49 READ_MOVIE_ATOM_FAILED = 4, 50 READ_MOVIE_HEADER_ATOM_FAILED = 5, 51 READ_TRACK_ATOM_FAILED = 6, 52 READ_TRACK_HEADER_ATOM_FAILED = 7, 53 READ_TRACK_REFERENCE_ATOM_FAILED = 8, 54 READ_TRACK_REFERENCE_TYPE_ATOM_FAILED = 9, 55 READ_OBJECT_DESCRIPTOR_ATOM_FAILED = 10, 56 READ_INITIAL_OBJECT_DESCRIPTOR_FAILED = 11, 57 READ_OBJECT_DESCRIPTOR_FAILED = 12, 58 READ_MEDIA_ATOM_FAILED = 13, 59 READ_MEDIA_HEADER_ATOM_FAILED = 14, 60 READ_HANDLER_ATOM_FAILED = 15, 61 READ_MEDIA_INFORMATION_ATOM_FAILED = 16, 62 READ_MEDIA_INFORMATION_HEADER_ATOM_FAILED = 17, 63 READ_VIDEO_MEDIA_HEADER_ATOM_FAILED = 18, 64 READ_SOUND_MEDIA_HEADER_ATOM_FAILED = 19, 65 READ_HINT_MEDIA_HEADER_ATOM_FAILED = 20, 66 READ_MPEG4_MEDIA_HEADER_ATOM_FAILED = 21, 67 READ_DATA_INFORMATION_ATOM_FAILED = 22, 68 READ_DATA_REFERENCE_ATOM_FAILED = 23, 69 READ_DATA_ENTRY_URL_ATOM_FAILED = 24, 70 READ_DATA_ENTRY_URN_ATOM_FAILED = 25, 71 READ_SAMPLE_TABLE_ATOM_FAILED = 26, 72 READ_TIME_TO_SAMPLE_ATOM_FAILED = 27, 73 READ_SAMPLE_DESCRIPTION_ATOM_FAILED = 28, 74 READ_SAMPLE_SIZE_ATOM_FAILED = 29, 75 READ_SAMPLE_TO_CHUNK_ATOM_FAILED = 30, 76 READ_CHUNK_OFFSET_ATOM_FAILED = 31, 77 READ_SYNC_SAMPLE_ATOM_FAILED = 32, 78 READ_SAMPLE_ENTRY_FAILED = 33, 79 READ_AUDIO_SAMPLE_ENTRY_FAILED = 34, 80 READ_VISUAL_SAMPLE_ENTRY_FAILED = 35, 81 READ_HINT_SAMPLE_ENTRY_FAILED = 36, 82 READ_MPEG_SAMPLE_ENTRY_FAILED = 37, 83 READ_AUDIO_HINT_SAMPLE_FAILED = 38, 84 READ_VIDEO_HINT_SAMPLE_FAILED = 39, 85 READ_ESD_ATOM_FAILED = 40, 86 READ_ES_DESCRIPTOR_FAILED = 41, 87 READ_SL_CONFIG_DESCRIPTOR_FAILED = 42, 88 READ_DECODER_CONFIG_DESCRIPTOR_FAILED = 43, 89 READ_DECODER_SPECIFIC_INFO_FAILED = 44, 90 DUPLICATE_MOVIE_ATOMS = 45, 91 NO_MOVIE_ATOM_PRESENT = 46, 92 DUPLICATE_OBJECT_DESCRIPTORS = 47, 93 NO_OBJECT_DESCRIPTOR_ATOM_PRESENT = 48, 94 DUPLICATE_MOVIE_HEADERS = 49, 95 NO_MOVIE_HEADER_ATOM_PRESENT = 50, 96 DUPLICATE_TRACK_REFERENCE_ATOMS = 51, 97 DUPLICATE_TRACK_HEADER_ATOMS = 52, 98 NO_TRACK_HEADER_ATOM_PRESENT = 53, 99 DUPLICATE_MEDIA_ATOMS = 54, 100 NO_MEDIA_ATOM_PRESENT = 55, 101 READ_UNKNOWN_ATOM = 56, 102 NON_PV_CONTENT = 57, 103 FILE_NOT_STREAMABLE = 58, 104 INSUFFICIENT_BUFFER_SIZE = 59, 105 INVALID_SAMPLE_SIZE = 60, 106 INVALID_CHUNK_OFFSET = 61, 107 END_OF_TRACK = 62, 108 MEMORY_ALLOCATION_FAILED = 63, 109 READ_FILE_TYPE_ATOM_FAILED = 64, 110 ZERO_OR_NEGATIVE_ATOM_SIZE = 65, 111 NO_MEDIA_TRACKS_IN_FILE = 66, 112 NO_META_DATA_FOR_MEDIA_TRACKS = 67, 113 MEDIA_DATA_NOT_SELF_CONTAINED = 68, 114 READ_PVTI_SESSION_INFO_FAILED = 69, 115 READ_PVTI_MEDIA_INFO_FAILED = 70, 116 READ_CONTENT_VERSION_FAILED = 71, 117 READ_DOWNLOAD_ATOM_FAILED = 72, 118 READ_TRACK_INFO_ATOM_FAILED = 73, 119 READ_REQUIREMENTS_ATOM_FAILED = 74, 120 READ_WMF_SET_MEDIA_ATOM_FAILED = 75, 121 READ_WMF_SET_SESSION_ATOM_FAILED = 76, 122 READ_PV_USER_DATA_ATOM_FAILED = 77, 123 READ_VIDEO_INFORMATION_ATOM_FAILED = 78, 124 READ_RANDOM_ACCESS_ATOM_FAILED = 79, 125 READ_AMR_SAMPLE_ENTRY_FAILED = 80, 126 READ_H263_SAMPLE_ENTRY_FAILED = 81, 127 FILE_OPEN_FAILED = 82, 128 READ_UUID_ATOM_FAILED = 83, 129 FILE_VERSION_NOT_SUPPORTED = 84, 130 TRACK_VERSION_NOT_SUPPORTED = 85, 131 132 133 READ_COPYRIGHT_ATOM_FAILED = 88, 134 READ_FONT_TABLE_ATOM_FAILED = 89, 135 READ_FONT_RECORD_FAILED = 90, 136 FILE_PSEUDO_STREAMABLE = 91, 137 FILE_NOT_PSEUDO_STREAMABLE = 92, 138 READ_PV_ENTITY_TAG_ATOM_FAILED = 93, 139 DUPLICATE_FILE_TYPE_ATOMS = 94, 140 UNSUPPORTED_FILE_TYPE = 95, 141 FILE_TYPE_ATOM_NOT_FOUND = 96, 142 READ_EDIT_ATOM_FAILED = 97, 143 READ_EDITLIST_ATOM_FAILED = 98, 144 ATOM_VERSION_NOT_SUPPORTED = 99, 145 READ_UDTA_TITL_FAILED = 100, 146 READ_UDTA_DSCP_FAILED = 101, 147 READ_UDTA_CPRT_FAILED = 102, 148 READ_UDTA_PERF_FAILED = 103, 149 READ_UDTA_AUTH_FAILED = 104, 150 READ_UDTA_GNRE_FAILED = 105, 151 READ_UDTA_RTNG_FAILED = 106, 152 READ_UDTA_CLSF_FAILED = 107, 153 READ_UDTA_KYWD_FAILED = 108, 154 READ_PV_CONTENT_TYPE_ATOM_FAILED = 109, 155 READ_TEXT_SAMPLE_MODIFIERS_FAILED = 110, 156 READ_AVC_SAMPLE_ENTRY_FAILED = 111, 157 READ_AVC_CONFIG_BOX_FAILED = 112, 158 READ_MPEG4_BITRATE_BOX_FAILED = 113, 159 READ_AVC_SAMPLE_DEPENDENCY_TYPE_BOX_FAILED = 114, 160 READ_AVC_SAMPLE_TO_GROUP_BOX_FAILED = 115, 161 READ_AVC_SAMPLE_GROUP_DESCRIPTION_BOX_FAILED = 116, 162 READ_AVC_SUBSEQUENCE_DESCRIPTION_BOX_FAILED = 117, 163 READ_AVC_LAYER_DESCRIPTION_BOX_FAILED = 118, 164 READ_AVC_SAMPLE_DEPENDENCY_BOX_FAILED = 119, 165 166 167 READ_TRACK_EXTENDS_ATOM_FAILED = 127, 168 READ_MOVIE_EXTENDS_HEADER_FAILED = 128, 169 READ_MOVIE_EXTENDS_ATOM_FAILED = 129, 170 DUPLICATE_MOOF_ATOM = 130, 171 READ_MOVIE_FRAGMENT_ATOM_FAILED = 131, 172 READ_MOVIE_FRAGMENT_HEADER_FAILED = 132, 173 READ_TRACK_FRAGMENT_ATOM_FAILED = 133, 174 READ_TRACK_FRAGMENT_RUN_ATOM_FAILED = 134, 175 READ_TRACK_FRAGMENT_HEADER_ATOM_FAILED = 135, 176 READ_MOVIE_FRAGMENT_RANDOM_ACCESS_OFFSET_FAILED = 136, 177 READ_TRACK_FRAGMENT_RANDOM_ACCESS_ATOM_FAILED = 137, 178 READ_MOVIE_FRAGMENT_RANDOM_ACCESS_ATOM_FAILED = 138, 179 READ_META_DATA_FAILED = 139, 180 181 182 READ_ITUNES_ILST_META_DATA_FAILED = 140, 183 184 185 INSUFFICIENT_DATA = 141, 186 NOT_SUPPORTED = 142, 187 READ_OMADRM_KMS_BOX_FAILED = 143, 188 DUPLICATE_OMADRM_KMS_BOX = 144, 189 READ_SCHEME_INFORMATION_BOX_FAILED = 145, 190 NO_SAMPLE_IN_CURRENT_MOOF = 146, 191 SUFFICIENT_DATA_IN_FILE = 147, 192 LAST_SAMPLE_IN_MOOV = 148, 193 READ_UDTA_LOC_FAILED = 149, 194 NOT_PROGRESSIVE_STREAMABLE = 150, 195 READ_PIXELASPECTRATIO_BOX_FAILED = 151, 196 197 EXCEED_MAX_LIMIT_SUPPORTED_FOR_TOTAL_TRACKS 198 199 } MP4_ERROR_CODE; 200 201 202 class ISucceedFail 203 { 204 205 public: 206 bool MP4Success() 207 { 208 return _success; 209 } 210 int32 GetMP4Error() 211 { 212 return _mp4ErrorCode; 213 } 214 215 protected: 216 bool _success; 217 int32 _mp4ErrorCode; 218 }; 219 220 221 #endif // ISUCCEEDFAIL_H_INCLUDED 222