1 /* Copyright 2005 Jan Schmidt <thaytan@mad.scientist.com>
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Library General Public
5 * License as published by the Free Software Foundation; either
6 * version 2 of the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Library General Public License for more details.
13 * You should have received a copy of the GNU Library General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 * Boston, MA 02111-1307, USA.
26 /* private tag for storing unprocessed ID3v2 frames */
27 #define GST_ID3_DEMUX_TAG_ID3V2_FRAME "private-id3v2-frame"
29 #define ID3V1_TAG_SIZE 128
30 #define ID3V2_MARK_SIZE 3
31 #define ID3V2_HDR_SIZE 10
40 guint id3demux_calc_id3v2_tag_size (GstBuffer * buf);
41 ID3TagsResult id3demux_read_id3v2_tag (GstBuffer *buffer, guint *id3v2_size,
44 guint read_synch_uint (const guint8 * data, guint size);
46 /* Things shared by id3tags.c and id3v2frames.c */
47 #define ID3V2_VERSION 0x0400
48 #define ID3V2_VER_MAJOR(v) ((v) >> 8)
49 #define ID3V2_VER_MINOR(v) ((v) & 0xff)
57 guint32 frame_data_size;
60 guint8 ext_flag_bytes;
61 guint8 *ext_flag_data;
70 /* Current frame decoding */
78 /* To collect day/month from obsolete TDAT frame if it exists */
84 ID3V2_HDR_FLAG_UNSYNC = 0x80,
85 ID3V2_HDR_FLAG_EXTHDR = 0x40,
86 ID3V2_HDR_FLAG_EXPERIMENTAL = 0x20,
87 ID3V2_HDR_FLAG_FOOTER = 0x10
91 ID3V2_EXT_FLAG_UPDATE = 0x80,
92 ID3V2_EXT_FLAG_CRC = 0x40,
93 ID3V2_EXT_FLAG_RESTRICTED = 0x20
97 ID3V2_FRAME_STATUS_FRAME_ALTER_PRESERVE = 0x4000,
98 ID3V2_FRAME_STATUS_FILE_ALTER_PRESERVE = 0x2000,
99 ID3V2_FRAME_STATUS_READONLY = 0x1000,
100 ID3V2_FRAME_FORMAT_GROUPING_ID = 0x0040,
101 ID3V2_FRAME_FORMAT_COMPRESSION = 0x0008,
102 ID3V2_FRAME_FORMAT_ENCRYPTION = 0x0004,
103 ID3V2_FRAME_FORMAT_UNSYNCHRONISATION = 0x0002,
104 ID3V2_FRAME_FORMAT_DATA_LENGTH_INDICATOR = 0x0001
107 #define ID3V2_3_FRAME_FLAGS_MASK \
108 (ID3V2_FRAME_STATUS_FRAME_ALTER_PRESERVE | \
109 ID3V2_FRAME_STATUS_FILE_ALTER_PRESERVE | \
110 ID3V2_FRAME_STATUS_READONLY | \
111 ID3V2_FRAME_FORMAT_GROUPING_ID | \
112 ID3V2_FRAME_FORMAT_COMPRESSION | \
113 ID3V2_FRAME_FORMAT_ENCRYPTION)
115 /* From id3v2frames.c */
116 gboolean id3demux_id3v2_parse_frame (ID3TagsWorking *work);
118 guint8 * id3demux_ununsync_data (const guint8 * unsync_data, guint32 * size);