summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_mov.c
diff options
context:
space:
mode:
authoratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-03-22 00:54:10 +0000
committeratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-03-22 00:54:10 +0000
commit8266b9011db4628f4945e14aa293b9429981afd6 (patch)
treed28b251ede411c3258daa0d1dd2658d3e312de80 /libmpdemux/demux_mov.c
parent72b5003310ba6f691c2faac1c0cf83ee8f9afc72 (diff)
downloadmpv-8266b9011db4628f4945e14aa293b9429981afd6.tar.bz2
mpv-8266b9011db4628f4945e14aa293b9429981afd6.tar.xz
Add Parsing off ftyp box and some more docs ref
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5258 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/demux_mov.c')
-rw-r--r--libmpdemux/demux_mov.c40
1 files changed, 31 insertions, 9 deletions
diff --git a/libmpdemux/demux_mov.c b/libmpdemux/demux_mov.c
index 0434251c26..8433f33116 100644
--- a/libmpdemux/demux_mov.c
+++ b/libmpdemux/demux_mov.c
@@ -12,6 +12,8 @@
// aswell as .mov specific stuff.
// All sort of Stuff about MPEG4:
// http://www.cmlab.csie.ntu.edu.tw/~pkhsiao/thesis.html
+// I really recommend N4270-1.doc and N4270-2.doc which are exact specs
+// of the MP4-File Format and the MPEG4 Specific extensions. ::atmos
#include <stdio.h>
#include <stdlib.h>
@@ -248,15 +250,35 @@ int mov_check_file(demuxer_t* demuxer){
else if(len<8) break; // invalid chunk
switch(id){
- case MOV_FOURCC('f','t','y','p'):
- // skip over the file type chunk
- // Here are my guesses on it's format (atmos):
- // char[4] majorBrand (eg. 'isom')
- // int minorVersion (eg. 0x00000000)
- // char[4] mediaType(?) (eg. 'mp41')
- mp_msg(MSGT_DEMUX,MSGL_V,"MOV: Skipping unsupported Filetype chunk (len: %d)!\n",
- len);
- break;
+ case MOV_FOURCC('f','t','y','p'): {
+ int i;
+ unsigned int tmp;
+ // File Type Box (ftyp):
+ // char[4] major_brand (eg. 'isom')
+ // int minor_version (eg. 0x00000000)
+ // char[4] compatible_brands[] (eg. 'mp41')
+ // compatible_brands list spans to the end of box
+#if 1
+ tmp = stream_read_dword(demuxer->stream);
+ switch(tmp) {
+ case MOV_FOURCC('i','s','o','m'):
+ mp_msg(MSGT_DEMUX,MSGL_V,"MOV: File-Type Major-Brand: ISO Media File\n");
+ break;
+ default:
+ tmp = be2me_32(tmp);
+ mp_msg(MSGT_DEMUX,MSGL_WARN,"MOV: File-Type unknown Major-Brand: %.4s\n",&tmp);
+ }
+ mp_msg(MSGT_DEMUX,MSGL_V,"MOV: File-Type Minor-Version: %d\n",
+ stream_read_dword(demuxer->stream));
+ skipped += 8;
+ // List all compatible brands
+ for(i = 0; i < ((len-16)/4); i++) {
+ tmp = be2me_32(stream_read_dword(demuxer->stream));
+ mp_msg(MSGT_DEMUX,MSGL_V,"MOV: File-Type Compatible-Brands #%d: %.4s\n",i,&tmp);
+ skipped += 4;
+ }
+#endif
+ } break;
case MOV_FOURCC('m','o','o','v'):
// case MOV_FOURCC('c','m','o','v'):
mp_msg(MSGT_DEMUX,MSGL_V,"MOV: Movie header found!\n");