Mercurial > libavformat.hg
annotate electronicarts.c @ 3690:50c074bc02b4 libavformat
matroskadec: expand useless ebml_read_element_id() wrapper
author | aurel |
---|---|
date | Tue, 05 Aug 2008 00:42:58 +0000 |
parents | 08688b4b1441 |
children | c458ae91b0f9 |
rev | line source |
---|---|
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
1 /* Electronic Arts Multimedia File Demuxer |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
2 * Copyright (c) 2004 The ffmpeg Project |
3551 | 3 * Copyright (c) 2006-2008 Peter Ross |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
4 * |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1169
diff
changeset
|
5 * This file is part of FFmpeg. |
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1169
diff
changeset
|
6 * |
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1169
diff
changeset
|
7 * FFmpeg is free software; you can redistribute it and/or |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
9 * License as published by the Free Software Foundation; either |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1169
diff
changeset
|
10 * version 2.1 of the License, or (at your option) any later version. |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
11 * |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1169
diff
changeset
|
12 * FFmpeg is distributed in the hope that it will be useful, |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
15 * Lesser General Public License for more details. |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
16 * |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1169
diff
changeset
|
18 * License along with FFmpeg; if not, write to the Free Software |
896
edbe5c3717f9
Update licensing information: The FSF changed postal address.
diego
parents:
885
diff
changeset
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
20 */ |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
21 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
22 /** |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
23 * @file electronicarts.c |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
24 * Electronic Arts Multimedia file demuxer (WVE/UV2/etc.) |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
25 * by Robin Kay (komadori at gekkou.co.uk) |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
26 */ |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
27 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
28 #include "avformat.h" |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
29 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
30 #define SCHl_TAG MKTAG('S', 'C', 'H', 'l') |
2685 | 31 #define SEAD_TAG MKTAG('S', 'E', 'A', 'D') /* Sxxx header */ |
32 #define SNDC_TAG MKTAG('S', 'N', 'D', 'C') /* Sxxx data */ | |
33 #define SEND_TAG MKTAG('S', 'E', 'N', 'D') /* Sxxx end */ | |
2674 | 34 #define ISNh_TAG MKTAG('1', 'S', 'N', 'h') /* 1SNx header */ |
2673 | 35 #define EACS_TAG MKTAG('E', 'A', 'C', 'S') |
2674 | 36 #define ISNd_TAG MKTAG('1', 'S', 'N', 'd') /* 1SNx data */ |
37 #define ISNe_TAG MKTAG('1', 'S', 'N', 'e') /* 1SNx end */ | |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
38 #define PT00_TAG MKTAG('P', 'T', 0x0, 0x0) |
2613 | 39 #define GSTR_TAG MKTAG('G', 'S', 'T', 'R') |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
40 #define SCDl_TAG MKTAG('S', 'C', 'D', 'l') |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
41 #define SCEl_TAG MKTAG('S', 'C', 'E', 'l') |
2717 | 42 #define kVGT_TAG MKTAG('k', 'V', 'G', 'T') /* TGV i-frame */ |
43 #define MADk_TAG MKTAG('M', 'A', 'D', 'k') /* MAD i-frame */ | |
44 #define MPCh_TAG MKTAG('M', 'P', 'C', 'h') /* MPEG2 */ | |
2613 | 45 #define MVhd_TAG MKTAG('M', 'V', 'h', 'd') |
46 #define MV0K_TAG MKTAG('M', 'V', '0', 'K') | |
47 #define MV0F_TAG MKTAG('M', 'V', '0', 'F') | |
2717 | 48 #define MVIh_TAG MKTAG('M', 'V', 'I', 'h') /* CMV header */ |
3551 | 49 #define MVIf_TAG MKTAG('M', 'V', 'I', 'f') /* CMV i-frame */ |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
50 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
51 typedef struct EaDemuxContext { |
2635 | 52 int big_endian; |
53 | |
3291
fb5f48e1956f
Fix icc warning #188: enumerated type mixed with another type
cehoyos
parents:
2780
diff
changeset
|
54 enum CodecID video_codec; |
2613 | 55 AVRational time_base; |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
56 int video_stream_index; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
57 |
3291
fb5f48e1956f
Fix icc warning #188: enumerated type mixed with another type
cehoyos
parents:
2780
diff
changeset
|
58 enum CodecID audio_codec; |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
59 int audio_stream_index; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
60 int audio_frame_counter; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
61 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
62 int64_t audio_pts; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
63 |
2642 | 64 int bytes; |
2639 | 65 int sample_rate; |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
66 int num_channels; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
67 int num_samples; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
68 } EaDemuxContext; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
69 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
70 static uint32_t read_arbitary(ByteIOContext *pb) { |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
71 uint8_t size, byte; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
72 int i; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
73 uint32_t word; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
74 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
75 size = get_byte(pb); |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
76 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
77 word = 0; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
78 for (i = 0; i < size; i++) { |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
79 byte = get_byte(pb); |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
80 word <<= 8; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
81 word |= byte; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
82 } |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
83 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
84 return word; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
85 } |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
86 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
87 /* |
2626 | 88 * Process PT/GSTR sound header |
89 * return 1 if success, 0 if invalid format, otherwise AVERROR_xxx | |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
90 */ |
2626 | 91 static int process_audio_header_elements(AVFormatContext *s) |
92 { | |
2611 | 93 int inHeader = 1; |
2006 | 94 EaDemuxContext *ea = s->priv_data; |
2771
d52c718e83f9
Use dynamically allocated ByteIOContext in AVFormatContext
andoma
parents:
2717
diff
changeset
|
95 ByteIOContext *pb = s->pb; |
2780
0b9d29522781
add pcm_s16le_planar support for electronicarts files
aurel
parents:
2771
diff
changeset
|
96 int compression_type = -1, revision = -1, revision2 = -1; |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
97 |
2642 | 98 ea->bytes = 2; |
2639 | 99 ea->sample_rate = -1; |
2627 | 100 ea->num_channels = 1; |
101 | |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
102 while (inHeader) { |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
103 int inSubheader; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
104 uint8_t byte; |
2612 | 105 byte = get_byte(pb); |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
106 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
107 switch (byte) { |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
108 case 0xFD: |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
109 av_log (s, AV_LOG_INFO, "entered audio subheader\n"); |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
110 inSubheader = 1; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
111 while (inSubheader) { |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
112 uint8_t subbyte; |
2612 | 113 subbyte = get_byte(pb); |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
114 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
115 switch (subbyte) { |
2639 | 116 case 0x80: |
117 revision = read_arbitary(pb); | |
118 av_log (s, AV_LOG_INFO, "revision (element 0x80) set to 0x%08x\n", revision); | |
119 break; | |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
120 case 0x82: |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
121 ea->num_channels = read_arbitary(pb); |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
122 av_log (s, AV_LOG_INFO, "num_channels (element 0x82) set to 0x%08x\n", ea->num_channels); |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
123 break; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
124 case 0x83: |
2636
3b95556c8cd4
make compression_type a function local var instead of a context var
aurel
parents:
2635
diff
changeset
|
125 compression_type = read_arbitary(pb); |
3b95556c8cd4
make compression_type a function local var instead of a context var
aurel
parents:
2635
diff
changeset
|
126 av_log (s, AV_LOG_INFO, "compression_type (element 0x83) set to 0x%08x\n", compression_type); |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
127 break; |
2639 | 128 case 0x84: |
129 ea->sample_rate = read_arbitary(pb); | |
130 av_log (s, AV_LOG_INFO, "sample_rate (element 0x84) set to %i\n", ea->sample_rate); | |
131 break; | |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
132 case 0x85: |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
133 ea->num_samples = read_arbitary(pb); |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
134 av_log (s, AV_LOG_INFO, "num_samples (element 0x85) set to 0x%08x\n", ea->num_samples); |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
135 break; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
136 case 0x8A: |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
137 av_log (s, AV_LOG_INFO, "element 0x%02x set to 0x%08x\n", subbyte, read_arbitary(pb)); |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
138 av_log (s, AV_LOG_INFO, "exited audio subheader\n"); |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
139 inSubheader = 0; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
140 break; |
2780
0b9d29522781
add pcm_s16le_planar support for electronicarts files
aurel
parents:
2771
diff
changeset
|
141 case 0xA0: |
0b9d29522781
add pcm_s16le_planar support for electronicarts files
aurel
parents:
2771
diff
changeset
|
142 revision2 = read_arbitary(pb); |
0b9d29522781
add pcm_s16le_planar support for electronicarts files
aurel
parents:
2771
diff
changeset
|
143 av_log (s, AV_LOG_INFO, "revision2 (element 0xA0) set to 0x%08x\n", revision2); |
0b9d29522781
add pcm_s16le_planar support for electronicarts files
aurel
parents:
2771
diff
changeset
|
144 break; |
2613 | 145 case 0xFF: |
2625 | 146 av_log (s, AV_LOG_INFO, "end of header block reached (within audio subheader)\n"); |
2613 | 147 inSubheader = 0; |
148 inHeader = 0; | |
149 break; | |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
150 default: |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
151 av_log (s, AV_LOG_INFO, "element 0x%02x set to 0x%08x\n", subbyte, read_arbitary(pb)); |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
152 break; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
153 } |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
154 } |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
155 break; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
156 case 0xFF: |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
157 av_log (s, AV_LOG_INFO, "end of header block reached\n"); |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
158 inHeader = 0; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
159 break; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
160 default: |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
161 av_log (s, AV_LOG_INFO, "header element 0x%02x set to 0x%08x\n", byte, read_arbitary(pb)); |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
162 break; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
163 } |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
164 } |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
165 |
2637 | 166 switch (compression_type) { |
2638 | 167 case 0: ea->audio_codec = CODEC_ID_PCM_S16LE; break; |
2637 | 168 case 7: ea->audio_codec = CODEC_ID_ADPCM_EA; break; |
2670 | 169 case -1: |
170 switch (revision) { | |
171 case 1: ea->audio_codec = CODEC_ID_ADPCM_EA_R1; break; | |
172 case 2: ea->audio_codec = CODEC_ID_ADPCM_EA_R2; break; | |
173 case 3: ea->audio_codec = CODEC_ID_ADPCM_EA_R3; break; | |
2780
0b9d29522781
add pcm_s16le_planar support for electronicarts files
aurel
parents:
2771
diff
changeset
|
174 case -1: break; |
2670 | 175 default: |
176 av_log(s, AV_LOG_ERROR, "unsupported stream type; revision=%i\n", revision); | |
177 return 0; | |
178 } | |
2780
0b9d29522781
add pcm_s16le_planar support for electronicarts files
aurel
parents:
2771
diff
changeset
|
179 switch (revision2) { |
0b9d29522781
add pcm_s16le_planar support for electronicarts files
aurel
parents:
2771
diff
changeset
|
180 case 8: ea->audio_codec = CODEC_ID_PCM_S16LE_PLANAR; break; |
3609 | 181 case -1: break; |
2780
0b9d29522781
add pcm_s16le_planar support for electronicarts files
aurel
parents:
2771
diff
changeset
|
182 default: |
0b9d29522781
add pcm_s16le_planar support for electronicarts files
aurel
parents:
2771
diff
changeset
|
183 av_log(s, AV_LOG_ERROR, "unsupported stream type; revision2=%i\n", revision2); |
0b9d29522781
add pcm_s16le_planar support for electronicarts files
aurel
parents:
2771
diff
changeset
|
184 return 0; |
0b9d29522781
add pcm_s16le_planar support for electronicarts files
aurel
parents:
2771
diff
changeset
|
185 } |
2670 | 186 break; |
2637 | 187 default: |
188 av_log(s, AV_LOG_ERROR, "unsupported stream type; compression_type=%i\n", compression_type); | |
189 return 0; | |
190 } | |
2631 | 191 |
2639 | 192 if (ea->sample_rate == -1) |
193 ea->sample_rate = revision==3 ? 48000 : 22050; | |
194 | |
2626 | 195 return 1; |
196 } | |
197 | |
2673 | 198 /* |
199 * Process EACS sound header | |
200 * return 1 if success, 0 if invalid format, otherwise AVERROR_xxx | |
201 */ | |
202 static int process_audio_header_eacs(AVFormatContext *s) | |
203 { | |
204 EaDemuxContext *ea = s->priv_data; | |
2771
d52c718e83f9
Use dynamically allocated ByteIOContext in AVFormatContext
andoma
parents:
2717
diff
changeset
|
205 ByteIOContext *pb = s->pb; |
2673 | 206 int compression_type; |
207 | |
208 ea->sample_rate = ea->big_endian ? get_be32(pb) : get_le32(pb); | |
209 ea->bytes = get_byte(pb); /* 1=8-bit, 2=16-bit */ | |
210 ea->num_channels = get_byte(pb); | |
211 compression_type = get_byte(pb); | |
212 url_fskip(pb, 13); | |
213 | |
214 switch (compression_type) { | |
215 case 0: | |
216 switch (ea->bytes) { | |
217 case 1: ea->audio_codec = CODEC_ID_PCM_S8; break; | |
218 case 2: ea->audio_codec = CODEC_ID_PCM_S16LE; break; | |
219 } | |
220 break; | |
221 case 1: ea->audio_codec = CODEC_ID_PCM_MULAW; ea->bytes = 1; break; | |
2686 | 222 case 2: ea->audio_codec = CODEC_ID_ADPCM_IMA_EA_EACS; break; |
2673 | 223 default: |
224 av_log (s, AV_LOG_ERROR, "unsupported stream type; audio compression_type=%i\n", compression_type); | |
225 } | |
226 | |
227 return 1; | |
228 } | |
229 | |
2685 | 230 /* |
231 * Process SEAD sound header | |
232 * return 1 if success, 0 if invalid format, otherwise AVERROR_xxx | |
233 */ | |
234 static int process_audio_header_sead(AVFormatContext *s) | |
235 { | |
236 EaDemuxContext *ea = s->priv_data; | |
2771
d52c718e83f9
Use dynamically allocated ByteIOContext in AVFormatContext
andoma
parents:
2717
diff
changeset
|
237 ByteIOContext *pb = s->pb; |
2685 | 238 |
239 ea->sample_rate = get_le32(pb); | |
240 ea->bytes = get_le32(pb); /* 1=8-bit, 2=16-bit */ | |
241 ea->num_channels = get_le32(pb); | |
242 ea->audio_codec = CODEC_ID_ADPCM_IMA_EA_SEAD; | |
243 | |
244 return 1; | |
245 } | |
246 | |
2629 | 247 static int process_video_header_vp6(AVFormatContext *s) |
248 { | |
249 EaDemuxContext *ea = s->priv_data; | |
2771
d52c718e83f9
Use dynamically allocated ByteIOContext in AVFormatContext
andoma
parents:
2717
diff
changeset
|
250 ByteIOContext *pb = s->pb; |
2629 | 251 |
252 url_fskip(pb, 16); | |
253 ea->time_base.den = get_le32(pb); | |
254 ea->time_base.num = get_le32(pb); | |
2631 | 255 ea->video_codec = CODEC_ID_VP6; |
2629 | 256 |
257 return 1; | |
258 } | |
259 | |
2626 | 260 /* |
261 * Process EA file header | |
262 * Returns 1 if the EA file is valid and successfully opened, 0 otherwise | |
263 */ | |
264 static int process_ea_header(AVFormatContext *s) { | |
265 uint32_t blockid, size = 0; | |
266 EaDemuxContext *ea = s->priv_data; | |
2771
d52c718e83f9
Use dynamically allocated ByteIOContext in AVFormatContext
andoma
parents:
2717
diff
changeset
|
267 ByteIOContext *pb = s->pb; |
2632
c5118e086450
parse header chunk in a loop (don't depend on a fixed chunk ordering)
aurel
parents:
2631
diff
changeset
|
268 int i; |
c5118e086450
parse header chunk in a loop (don't depend on a fixed chunk ordering)
aurel
parents:
2631
diff
changeset
|
269 |
c5118e086450
parse header chunk in a loop (don't depend on a fixed chunk ordering)
aurel
parents:
2631
diff
changeset
|
270 for (i=0; i<5 && (!ea->audio_codec || !ea->video_codec); i++) { |
c5118e086450
parse header chunk in a loop (don't depend on a fixed chunk ordering)
aurel
parents:
2631
diff
changeset
|
271 unsigned int startpos = url_ftell(pb); |
2634 | 272 int err = 0; |
2626 | 273 |
2633 | 274 blockid = get_le32(pb); |
2626 | 275 size = get_le32(pb); |
2635 | 276 if (i == 0) |
277 ea->big_endian = size > 0x000FFFFF; | |
278 if (ea->big_endian) | |
279 size = bswap_32(size); | |
2632
c5118e086450
parse header chunk in a loop (don't depend on a fixed chunk ordering)
aurel
parents:
2631
diff
changeset
|
280 |
c5118e086450
parse header chunk in a loop (don't depend on a fixed chunk ordering)
aurel
parents:
2631
diff
changeset
|
281 switch (blockid) { |
2674 | 282 case ISNh_TAG: |
2673 | 283 if (get_le32(pb) != EACS_TAG) { |
284 av_log (s, AV_LOG_ERROR, "unknown 1SNh headerid\n"); | |
285 return 0; | |
286 } | |
287 err = process_audio_header_eacs(s); | |
288 break; | |
289 | |
2632
c5118e086450
parse header chunk in a loop (don't depend on a fixed chunk ordering)
aurel
parents:
2631
diff
changeset
|
290 case SCHl_TAG : |
2633 | 291 blockid = get_le32(pb); |
292 if (blockid == GSTR_TAG) { | |
293 url_fskip(pb, 4); | |
294 } else if (blockid != PT00_TAG) { | |
295 av_log (s, AV_LOG_ERROR, "unknown SCHl headerid\n"); | |
296 return 0; | |
297 } | |
2634 | 298 err = process_audio_header_elements(s); |
2632
c5118e086450
parse header chunk in a loop (don't depend on a fixed chunk ordering)
aurel
parents:
2631
diff
changeset
|
299 break; |
2626 | 300 |
2685 | 301 case SEAD_TAG: |
302 err = process_audio_header_sead(s); | |
303 break; | |
304 | |
3551 | 305 case MVIh_TAG : |
306 ea->video_codec = CODEC_ID_CMV; | |
307 ea->time_base = (AVRational){0,0}; | |
308 break; | |
309 | |
2632
c5118e086450
parse header chunk in a loop (don't depend on a fixed chunk ordering)
aurel
parents:
2631
diff
changeset
|
310 case MVhd_TAG : |
2634 | 311 err = process_video_header_vp6(s); |
2632
c5118e086450
parse header chunk in a loop (don't depend on a fixed chunk ordering)
aurel
parents:
2631
diff
changeset
|
312 break; |
c5118e086450
parse header chunk in a loop (don't depend on a fixed chunk ordering)
aurel
parents:
2631
diff
changeset
|
313 } |
c5118e086450
parse header chunk in a loop (don't depend on a fixed chunk ordering)
aurel
parents:
2631
diff
changeset
|
314 |
2634 | 315 if (err < 0) { |
316 av_log(s, AV_LOG_ERROR, "error parsing header: %i\n", err); | |
317 return err; | |
318 } | |
319 | |
2632
c5118e086450
parse header chunk in a loop (don't depend on a fixed chunk ordering)
aurel
parents:
2631
diff
changeset
|
320 url_fseek(pb, startpos + size, SEEK_SET); |
c5118e086450
parse header chunk in a loop (don't depend on a fixed chunk ordering)
aurel
parents:
2631
diff
changeset
|
321 } |
c5118e086450
parse header chunk in a loop (don't depend on a fixed chunk ordering)
aurel
parents:
2631
diff
changeset
|
322 |
c5118e086450
parse header chunk in a loop (don't depend on a fixed chunk ordering)
aurel
parents:
2631
diff
changeset
|
323 url_fseek(pb, 0, SEEK_SET); |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
324 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
325 return 1; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
326 } |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
327 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
328 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
329 static int ea_probe(AVProbeData *p) |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
330 { |
2661
bed166d88f63
convert a if() into a switch() to ease addition of new tags to probe
aurel
parents:
2647
diff
changeset
|
331 switch (AV_RL32(&p->buf[0])) { |
2675 | 332 case ISNh_TAG: |
2661
bed166d88f63
convert a if() into a switch() to ease addition of new tags to probe
aurel
parents:
2647
diff
changeset
|
333 case SCHl_TAG: |
2685 | 334 case SEAD_TAG: |
2717 | 335 case kVGT_TAG: |
336 case MADk_TAG: | |
337 case MPCh_TAG: | |
2661
bed166d88f63
convert a if() into a switch() to ease addition of new tags to probe
aurel
parents:
2647
diff
changeset
|
338 case MVhd_TAG: |
2717 | 339 case MVIh_TAG: |
2613 | 340 return AVPROBE_SCORE_MAX; |
2661
bed166d88f63
convert a if() into a switch() to ease addition of new tags to probe
aurel
parents:
2647
diff
changeset
|
341 } |
2613 | 342 return 0; |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
343 } |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
344 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
345 static int ea_read_header(AVFormatContext *s, |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
346 AVFormatParameters *ap) |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
347 { |
2006 | 348 EaDemuxContext *ea = s->priv_data; |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
349 AVStream *st; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
350 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
351 if (!process_ea_header(s)) |
2274
b21c2af60bc9
Replace all occurrences of AVERROR_IO with AVERROR(EIO).
takis
parents:
2273
diff
changeset
|
352 return AVERROR(EIO); |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
353 |
2647 | 354 if (ea->video_codec) { |
2614 | 355 /* initialize the video decoder stream */ |
356 st = av_new_stream(s, 0); | |
357 if (!st) | |
358 return AVERROR(ENOMEM); | |
359 ea->video_stream_index = st->index; | |
360 st->codec->codec_type = CODEC_TYPE_VIDEO; | |
2631 | 361 st->codec->codec_id = ea->video_codec; |
2614 | 362 st->codec->codec_tag = 0; /* no fourcc */ |
363 st->codec->time_base = ea->time_base; | |
2613 | 364 } |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
365 |
2644
ad769d06b84c
check if we found an audio track before initializing the audio stream
aurel
parents:
2643
diff
changeset
|
366 if (ea->audio_codec) { |
2645 | 367 /* initialize the audio decoder stream */ |
368 st = av_new_stream(s, 0); | |
369 if (!st) | |
370 return AVERROR(ENOMEM); | |
371 av_set_pts_info(st, 33, 1, ea->sample_rate); | |
372 st->codec->codec_type = CODEC_TYPE_AUDIO; | |
373 st->codec->codec_id = ea->audio_codec; | |
374 st->codec->codec_tag = 0; /* no tag */ | |
375 st->codec->channels = ea->num_channels; | |
376 st->codec->sample_rate = ea->sample_rate; | |
377 st->codec->bits_per_sample = ea->bytes * 8; | |
378 st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * | |
379 st->codec->bits_per_sample / 4; | |
380 st->codec->block_align = st->codec->channels*st->codec->bits_per_sample; | |
381 ea->audio_stream_index = st->index; | |
382 ea->audio_frame_counter = 0; | |
2644
ad769d06b84c
check if we found an audio track before initializing the audio stream
aurel
parents:
2643
diff
changeset
|
383 } |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
384 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
385 return 1; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
386 } |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
387 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
388 static int ea_read_packet(AVFormatContext *s, |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
389 AVPacket *pkt) |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
390 { |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
391 EaDemuxContext *ea = s->priv_data; |
2771
d52c718e83f9
Use dynamically allocated ByteIOContext in AVFormatContext
andoma
parents:
2717
diff
changeset
|
392 ByteIOContext *pb = s->pb; |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
393 int ret = 0; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
394 int packet_read = 0; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
395 unsigned int chunk_type, chunk_size; |
2613 | 396 int key = 0; |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
397 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
398 while (!packet_read) { |
2640 | 399 chunk_type = get_le32(pb); |
2641 | 400 chunk_size = (ea->big_endian ? get_be32(pb) : get_le32(pb)) - 8; |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
401 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
402 switch (chunk_type) { |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
403 /* audio data */ |
2674 | 404 case ISNh_TAG: |
2673 | 405 /* header chunk also contains data; skip over the header portion*/ |
406 url_fskip(pb, 32); | |
407 chunk_size -= 32; | |
2674 | 408 case ISNd_TAG: |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
409 case SCDl_TAG: |
2685 | 410 case SNDC_TAG: |
2646 | 411 if (!ea->audio_codec) { |
412 url_fskip(pb, chunk_size); | |
413 break; | |
2780
0b9d29522781
add pcm_s16le_planar support for electronicarts files
aurel
parents:
2771
diff
changeset
|
414 } else if (ea->audio_codec == CODEC_ID_PCM_S16LE_PLANAR) { |
0b9d29522781
add pcm_s16le_planar support for electronicarts files
aurel
parents:
2771
diff
changeset
|
415 url_fskip(pb, 12); /* planar header */ |
0b9d29522781
add pcm_s16le_planar support for electronicarts files
aurel
parents:
2771
diff
changeset
|
416 chunk_size -= 12; |
2646 | 417 } |
775 | 418 ret = av_get_packet(pb, pkt, chunk_size); |
419 if (ret != chunk_size) | |
2274
b21c2af60bc9
Replace all occurrences of AVERROR_IO with AVERROR(EIO).
takis
parents:
2273
diff
changeset
|
420 ret = AVERROR(EIO); |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
421 else { |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
422 pkt->stream_index = ea->audio_stream_index; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
423 pkt->pts = 90000; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
424 pkt->pts *= ea->audio_frame_counter; |
2639 | 425 pkt->pts /= ea->sample_rate; |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
426 |
2643 | 427 switch (ea->audio_codec) { |
428 case CODEC_ID_ADPCM_EA: | |
885 | 429 /* 2 samples/byte, 1 or 2 samples per frame depending |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
430 * on stereo; chunk also has 12-byte header */ |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
431 ea->audio_frame_counter += ((chunk_size - 12) * 2) / |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
432 ea->num_channels; |
2643 | 433 break; |
434 default: | |
435 ea->audio_frame_counter += chunk_size / | |
436 (ea->bytes * ea->num_channels); | |
437 } | |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
438 } |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
439 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
440 packet_read = 1; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
441 break; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
442 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
443 /* ending tag */ |
2671
7f320fb9f1c9
avoid infinite loop at the end of files which are not properly terminated
aurel
parents:
2670
diff
changeset
|
444 case 0: |
2674 | 445 case ISNe_TAG: |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
446 case SCEl_TAG: |
2685 | 447 case SEND_TAG: |
2274
b21c2af60bc9
Replace all occurrences of AVERROR_IO with AVERROR(EIO).
takis
parents:
2273
diff
changeset
|
448 ret = AVERROR(EIO); |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
449 packet_read = 1; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
450 break; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
451 |
3551 | 452 case MVIh_TAG: |
453 key = PKT_FLAG_KEY; | |
454 case MVIf_TAG: | |
455 url_fseek(pb, -8, SEEK_CUR); // include chunk preamble | |
456 chunk_size += 8; | |
457 goto get_video_packet; | |
458 | |
2613 | 459 case MV0K_TAG: |
460 key = PKT_FLAG_KEY; | |
461 case MV0F_TAG: | |
3551 | 462 get_video_packet: |
2613 | 463 ret = av_get_packet(pb, pkt, chunk_size); |
464 if (ret != chunk_size) | |
465 ret = AVERROR_IO; | |
466 else { | |
467 pkt->stream_index = ea->video_stream_index; | |
468 pkt->flags |= key; | |
469 } | |
470 packet_read = 1; | |
471 break; | |
472 | |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
473 default: |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
474 url_fseek(pb, chunk_size, SEEK_CUR); |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
475 break; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
476 } |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
477 } |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
478 |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
479 return ret; |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
480 } |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
481 |
1169 | 482 AVInputFormat ea_demuxer = { |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
483 "ea", |
3424
7a0230981402
Make long_names in lavf/lavdev optional depending on CONFIG_SMALL.
diego
parents:
3291
diff
changeset
|
484 NULL_IF_CONFIG_SMALL("Electronic Arts Multimedia Format"), |
565
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
485 sizeof(EaDemuxContext), |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
486 ea_probe, |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
487 ea_read_header, |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
488 ea_read_packet, |
485a529adaee
Electronic Arts Game Multimedia format demuxer (WVE/UV2/etc.)
melanson
parents:
diff
changeset
|
489 }; |