comparison libmpdemux/demux_mov.c @ 15356:94ff994b4f37

Decode "d263" and "damr" atoms in 3gp files Patch by adland
author rtognimp
date Thu, 05 May 2005 21:40:33 +0000
parents 1e8305fffa79
children 9bebc73be6fa
comparison
equal deleted inserted replaced
15355:ec1ad0dfbe00 15356:94ff994b4f37
12 // aswell as .mov specific stuff. 12 // aswell as .mov specific stuff.
13 // All sort of Stuff about MPEG4: 13 // All sort of Stuff about MPEG4:
14 // http://www.cmlab.csie.ntu.edu.tw/~pkhsiao/thesis.html 14 // http://www.cmlab.csie.ntu.edu.tw/~pkhsiao/thesis.html
15 // I really recommend N4270-1.doc and N4270-2.doc which are exact specs 15 // I really recommend N4270-1.doc and N4270-2.doc which are exact specs
16 // of the MP4-File Format and the MPEG4 Specific extensions. ::atmos 16 // of the MP4-File Format and the MPEG4 Specific extensions. ::atmos
17 // TSGS#15(02)0088
18 // http://www.3gpp.org/ftp/tsg_sa/TSG_SA/TSGS_15/Docs/pdf/SP-020088.pdf
19 // http://www.3gpp2.org/Public_html/specs/C.S0050-0_v1.0_121503.pdf
17 20
18 #include <stdio.h> 21 #include <stdio.h>
19 #include <stdlib.h> 22 #include <stdlib.h>
20 #include <unistd.h> 23 #include <unistd.h>
21 24
1007 sh->codecdata_len = atom_len; 1010 sh->codecdata_len = atom_len;
1008 sh->codecdata = (unsigned char *)malloc(sh->codecdata_len); 1011 sh->codecdata = (unsigned char *)malloc(sh->codecdata_len);
1009 memcpy(sh->codecdata, &trak->stdata[28], sh->codecdata_len); 1012 memcpy(sh->codecdata, &trak->stdata[28], sh->codecdata_len);
1010 } 1013 }
1011 } break; 1014 } break;
1015 case MOV_FOURCC('d','a','m','r'):
1016 mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: Found AMR audio atom %c%c%c%c (%d)!\n", trak->stdata[32+adjust],trak->stdata[33+adjust],trak->stdata[34+adjust],trak->stdata[35+adjust], atom_len);
1017 if (atom_len>14) {
1018 mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: Vendor: %c%c%c%c Version: %d\n",trak->stdata[36+adjust],trak->stdata[37+adjust],trak->stdata[38+adjust], trak->stdata[39+adjust],trak->stdata[40+adjust]);
1019 mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: Modes set: %02x%02x\n",trak->stdata[41+adjust],trak->stdata[42+adjust]);
1020 mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: Mode change period: %d Frames per sample: %d\n",trak->stdata[43+adjust],trak->stdata[44+adjust]);
1021 }
1022 break;
1012 default: 1023 default:
1013 mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: Found unknown audio atom %c%c%c%c (%d)!\n", 1024 mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: Found unknown audio atom %c%c%c%c (%d)!\n",
1014 trak->stdata[32+adjust],trak->stdata[33+adjust],trak->stdata[34+adjust],trak->stdata[35+adjust], 1025 trak->stdata[32+adjust],trak->stdata[33+adjust],trak->stdata[34+adjust],trak->stdata[35+adjust],
1015 atom_len); 1026 atom_len);
1016 } 1027 }
1194 trak->stream_header_len = atom_len-8; 1205 trak->stream_header_len = atom_len-8;
1195 trak->stream_header = (unsigned char *)malloc(trak->stream_header_len); 1206 trak->stream_header = (unsigned char *)malloc(trak->stream_header_len);
1196 memcpy(trak->stream_header, trak->stdata+pos+8, trak->stream_header_len); 1207 memcpy(trak->stream_header, trak->stdata+pos+8, trak->stream_header_len);
1197 } 1208 }
1198 break; 1209 break;
1210 case MOV_FOURCC('d','2','6','3'):
1211 mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: Found H.263 decoder atom %c%c%c%c (%d)!\n", trak->stdata[pos+4],trak->stdata[pos+5],trak->stdata[pos+6],trak->stdata[pos+7],atom_len);
1212 if (atom_len>10)
1213 mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: Vendor: %c%c%c%c H.263 level: %d H.263 profile: %d \n", trak->stdata[pos+8],trak->stdata[pos+9],trak->stdata[pos+10],trak->stdata[pos+11],trak->stdata[pos+12],trak->stdata[pos+13]);
1214 break;
1199 case 0: 1215 case 0:
1200 break; 1216 break;
1201 default: 1217 default:
1202 mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: Found unknown movie atom %c%c%c%c (%d)!\n", 1218 mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: Found unknown movie atom %c%c%c%c (%d)!\n",
1203 trak->stdata[pos+4],trak->stdata[pos+5],trak->stdata[pos+6],trak->stdata[pos+7], 1219 trak->stdata[pos+4],trak->stdata[pos+5],trak->stdata[pos+6],trak->stdata[pos+7],