1 /*******************************************************************************
3 * This file is part of the Ogg Vorbis DirectShow filter collection *
5 * Copyright (c) 2001, Tobias Waldvogel *
6 * All rights reserved. *
8 * Redistribution and use in source and binary forms, with or without *
9 * modification, are permitted provided that the following conditions are met: *
11 * - Redistributions of source code must retain the above copyright notice, *
12 * this list of conditions and the following disclaimer. *
14 * - Redistributions in binary form must reproduce the above copyright notice, *
15 * this list of conditions and the following disclaimer in the documentation *
16 * and/or other materials provided with the distribution. *
18 * - The names of the contributors may not be used to endorse or promote *
19 * products derived from this software without specific prior written *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" *
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE *
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE *
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE *
26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF *
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS *
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN *
30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) *
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
32 * POSSIBILITY OF SUCH DAMAGE. *
34 *******************************************************************************/
44 #include <vorbis/codec.h>
45 #include <vorbis/vorbisenc.h>
46 #include "OggStream/OggStream.h"
49 #define SIZEOF_ARRAY(ar) (sizeof(ar)/sizeof((ar)[0]))
51 bool StringToReferenceTime(char* sTime
, REFERENCE_TIME
* rtTime
);
52 void CopyOggPacket(ogg_packet
* dop
, ogg_packet
* sop
);
53 int GetLCIDFromComment(vorbis_comment
* pvc
);
55 typedef struct tagLCID_REC
61 static const LCID_REC aLCID
[] =
63 { "Afrikaans", 0x0036 },
64 { "Albanian", 0x001c },
67 { "Belarusian", 0x0023 },
68 { "Bulgarian", 0x0002 },
69 { "Catalan", 0x0003 },
70 { "Chinese", 0x0004 },
71 { "Croatian", 0x001a },
75 { "English", 0x0009 },
76 { "Estonian", 0x0025 },
77 { "Faeroese", 0x0038 },
79 { "Finnish", 0x000b },
84 { "Hungarian", 0x000e },
85 { "Icelandic", 0x000f },
86 { "Indonesian", 0x0021 },
87 { "Italian", 0x0010 },
88 { "Japanese", 0x0011 },
90 { "Latvian", 0x0026 },
91 { "Lithuanian", 0x0027 },
93 { "Norwegian", 0x0014 },
95 { "Portuguese", 0x0016 },
96 { "Romanian", 0x0018 },
97 { "Russian", 0x0019 },
98 { "Serbian", 0x001a },
100 { "Slovenian", 0x0024 },
101 { "Spanish", 0x000a },
102 { "Swahili", 0x0041 },
103 { "Swedish", 0x001d },
105 { "Turkish", 0x001f },
106 { "Ukrainian", 0x0022 }
116 static const tSpeaker arSpeakers
[] =
118 { "Front Left", "FL", 0x00000001 },
119 { "Front Right", "FR", 0x00000002 },
120 { "Front Center", "FC", 0x00000004 },
121 { "Low Frequency", "LF", 0x00000008 },
122 { "Back Left", "BL", 0x00000010 },
123 { "Back Right", "BR", 0x00000020 },
124 { "Front Left of Center", "FLC", 0x00000040 },
125 { "Front Right of Center", "FRC", 0x00000080 },
126 { "Back Center", "BC", 0x00000100 },
127 { "Side Left", "SL", 0x00000200 },
128 { "Side Right", "SR", 0x00000400 },
129 { "Top Center", "TC", 0x00000800 },
130 { "Top Front Left", "TFL", 0x00001000 },
131 { "Top Front Center", "TFC", 0x00002000 },
132 { "Top Front Right", "TFR", 0x00004000 },
133 { "Top Back Left", "TBL", 0x00008000 },
134 { "Top Back Center", "TBC", 0x00010000 },
135 { "Top Back Right", "TBR", 0x00020000 }