00063 {
00064
ContainerInfo * info = NULL;
00065
HttpByteStream *stream = NULL;
00066 HttpMimeType mimeType = mime_unknown;
00067
00068 dprintf_full(
"ContainerFile::loadContainerInfo: ####HANDLE####\n");
00069
#ifdef ENABLE_DVDREAD
00070
dvd_handle_t *dvd_handle = DVDContainerFile::openDVD(fileName);
00071
00072
if(dvd_handle) {
00073
00074 u32 main_title_no = DVDContainerFile::getMainTitleNo(dvd_handle);
00075
00076 info = DVDContainerFile::loadContainerInfo(dvd_handle,main_title_no);
00077
delete dvd_handle;
00078 }
00079
#endif
00080
00081
00082
if(info==NULL) {
00083
00084
00085
if (!uri)
00086 uri =
new Url(fileName);
00087
00088
if (strstr(uri->
getProtocol(),
"http")) {
00089 stream =
new HttpByteStream(uri->
toString(),
true );
00090
if (!stream->
open()) {
00091 dprintf_err(
"ContainerFile::loadContainerInfo: file not found: %s!\n",fileName);
00092
return NULL;
00093 }
00094 mimeType = stream->
getMimeTypeEnum();
00095 }
00096
00097
00098
const char* suffix=strrchr(fileName,
'.');
00099
if(suffix || (mimeType != mime_unknown)) {
00100
00101
00102
if((mimeType == mime_vit) || strstr(fileName,
".vit") || strstr(fileName,
".VIT")) {
00103 dprintf_full(
"ContainerFile::loadContainerInfo(): VITOOKI container detected!\n");
00104 info = VITContainerFile::loadContainerInfo(uri,stream);
00105 }
00106
00107
#ifdef ENABLE_OGG
00108
00109
else if((mimeType == mime_ogg) || strstr(fileName,
".ogg") || strstr(fileName,
".OGG")) {
00110 dprintf_full(
"ContainerFile::loadContainerInfo(): OGG container detected!\n");
00111 info = OGGContainerFile::loadContainerInfo(uri,stream);
00112 }
00113
#endif
00114
00115
#ifdef ENABLE_MKV
00116
00117
else if((mimeType == mime_mkv) || strstr(fileName,
".mkv") || strstr(fileName,
".MKV")) {
00118
if (stream)
00119 stream->
close();
00120 dprintf_full(
"ContainerFile::loadContainerInfo(): MATROSKA detected!\n");
00121 info = MKContainerFile::loadContainerInfo(fileName,uri);
00122 }
00123
#endif
00124
00125
else if(strstr(fileName,
".mp4") || strstr(fileName,
".MP4") || mimeType == mime_mp4) {
00126
if (stream)
00127 stream->
close();
00128
00129
00130
00131 dprintf_full(
"ContainerFile::loadContainerInfo(): MP4 detected!\n");
00132
#ifdef ISOMP4
00133
info = ISOMP4ContainerFile::loadContainerInfo(fileName,uri);
00134
#endif
00135
#ifdef ENABLE_FFMPEG
00136
00137
if(info==NULL)
00138 info = ffMP4ContainerFile::loadContainerInfo(fileName,uri,(ffMP4ContainerFile::ParseType)type);
00139
#endif
00140
}
00141
else {
00142
if (stream)
00143 stream->
close();
00144
00145
#ifdef ENABLE_FFMPEG
00146
dprintf_full(
"ContainerFile::loadContainerInfo(): UNDEFINED detected!\n");
00147
00148 info = ffMP4ContainerFile::loadContainerInfo(fileName,uri,(ffMP4ContainerFile::ParseType)type);
00149
#endif
00150
}
00151 }
00152
else {
00153
00154
if (stream)
00155 stream->
close();
00156
#ifdef ENABLE_FFMPEG
00157
info = ffMP4ContainerFile::loadContainerInfo(fileName,uri,(ffMP4ContainerFile::ParseType)type);
00158
#endif
00159
}
00160 }
00161
00162
return info;
00163 }