xine-lib 1.2.11
Data Structures | Macros | Typedefs | Functions
id3.h File Reference
#include <xine/xine_internal.h>
#include <xine/xineutils.h>
#include "bswap.h"

Go to the source code of this file.

Data Structures

struct  id3v2_header_t
 
struct  id3v22_frame_header_t
 
struct  id3v23_frame_header_t
 
struct  id3v23_frame_ext_header_t
 
struct  id3v24_frame_header_t
 
struct  id3v24_frame_ext_header_t
 
struct  id3v1_tag_t
 

Macros

#define ID3V22_TAG   ME_FOURCC('I', 'D', '3', 2) /* id3 v2.2 header tag */
 
#define ID3V23_TAG   ME_FOURCC('I', 'D', '3', 3) /* id3 v2.3 header tag */
 
#define ID3V24_TAG   ME_FOURCC('I', 'D', '3', 4) /* id3 v2.4 header tag */
 
#define ID3V24_FOOTER_TAG   ME_FOURCC('3', 'D', 'I', 0) /* id3 v2.4 footer tag */
 
#define ID3V2X_TAG   ME_FOURCC('I', 'D', '3', 0) /* id3 v2.x header tag */
 
#define ID3V2X_MASK   ~ME_FOURCC( 0 , 0 , 0 , 0xFF) /* id3 v2.x header mask */
 
#define ID3V22_UNSYNCH_FLAG   0x80
 
#define ID3V22_COMPRESS_FLAG   0x40
 
#define ID3V22_ZERO_FLAG   0x3F
 
#define ID3V22_FRAME_HEADER_SIZE   6
 
#define ID3V23_UNSYNCH_FLAG   0x80
 
#define ID3V23_EXT_HEADER_FLAG   0x40
 
#define ID3V23_EXPERIMENTAL_FLAG   0x20
 
#define ID3V23_ZERO_FLAG   0x1F
 
#define ID3V23_FRAME_HEADER_SIZE   10
 
#define ID3V23_FRAME_TAG_PRESERV_FLAG   0x8000
 
#define ID3V23_FRAME_FILE_PRESERV_FLAG   0x4000
 
#define ID3V23_FRAME_READ_ONLY_FLAG   0x2000
 
#define ID3V23_FRAME_COMPRESS_FLAG   0x0080
 
#define ID3V23_FRAME_ENCRYPT_FLAG   0x0040
 
#define ID3V23_FRAME_GROUP_ID_FLAG   0x0020
 
#define ID3V23_FRAME_ZERO_FLAG   0x1F1F
 
#define ID3V24_UNSYNCH_FLAG   0x80
 
#define ID3V24_EXT_HEADER_FLAG   0x40
 
#define ID3V24_EXPERIMENTAL_FLAG   0x20
 
#define ID3V24_FOOTER_FLAG   0x10
 
#define ID3V24_ZERO_FLAG   0x0F
 
#define ID3V24_EXT_UPDATE_FLAG   0x40
 
#define ID3V24_EXT_CRC_FLAG   0x20
 
#define ID3V24_EXT_RESTRICTIONS_FLAG   0x10
 
#define ID3V24_EXT_ZERO_FLAG   0x8F
 
#define ID3V24_FRAME_HEADER_SIZE   10
 
#define ID3V24_FRAME_TAG_PRESERV_FLAG   0x4000
 
#define ID3V24_FRAME_FILE_PRESERV_FLAG   0x2000
 
#define ID3V24_FRAME_READ_ONLY_FLAG   0x1000
 
#define ID3V24_FRAME_GROUP_ID_FLAG   0x0040
 
#define ID3V24_FRAME_COMPRESS_FLAG   0x0008
 
#define ID3V24_FRAME_ENCRYPT_FLAG   0x0004
 
#define ID3V24_FRAME_UNSYNCH_FLAG   0x0002
 
#define ID3V24_FRAME_DATA_LEN_FLAG   0x0001
 
#define ID3V24_FRAME_ZERO_FLAG   0x8FB0
 
#define ID3V24_FOOTER_SIZE   10
 

Typedefs

typedef id3v2_header_t id3v24_footer_t
 

Functions

int id3v1_parse_tag (input_plugin_t *input, xine_stream_t *stream)
 
int id3v2_parse_tag (input_plugin_t *input, xine_stream_t *stream, uint32_t id3_signature)
 Generic function for ID3v2 tags parsing. More...
 
static int id3v2_istag (uint32_t id3_signature)
 Checks if the given buffer is an ID3 tag preamble. More...
 
static uint32_t _X_BE_24_synchsafe (uint8_t buf[3])
 
static uint32_t _X_BE_32_synchsafe (uint8_t buf[4])
 
static uint32_t BE_35_synchsafe (uint8_t buf[5])
 

Macro Definition Documentation

◆ ID3V22_COMPRESS_FLAG

#define ID3V22_COMPRESS_FLAG   0x40

◆ ID3V22_FRAME_HEADER_SIZE

#define ID3V22_FRAME_HEADER_SIZE   6

◆ ID3V22_TAG

#define ID3V22_TAG   ME_FOURCC('I', 'D', '3', 2) /* id3 v2.2 header tag */

◆ ID3V22_UNSYNCH_FLAG

#define ID3V22_UNSYNCH_FLAG   0x80

◆ ID3V22_ZERO_FLAG

#define ID3V22_ZERO_FLAG   0x3F

◆ ID3V23_EXPERIMENTAL_FLAG

#define ID3V23_EXPERIMENTAL_FLAG   0x20

◆ ID3V23_EXT_HEADER_FLAG

#define ID3V23_EXT_HEADER_FLAG   0x40

◆ ID3V23_FRAME_COMPRESS_FLAG

#define ID3V23_FRAME_COMPRESS_FLAG   0x0080

◆ ID3V23_FRAME_ENCRYPT_FLAG

#define ID3V23_FRAME_ENCRYPT_FLAG   0x0040

◆ ID3V23_FRAME_FILE_PRESERV_FLAG

#define ID3V23_FRAME_FILE_PRESERV_FLAG   0x4000

◆ ID3V23_FRAME_GROUP_ID_FLAG

#define ID3V23_FRAME_GROUP_ID_FLAG   0x0020

◆ ID3V23_FRAME_HEADER_SIZE

#define ID3V23_FRAME_HEADER_SIZE   10

◆ ID3V23_FRAME_READ_ONLY_FLAG

#define ID3V23_FRAME_READ_ONLY_FLAG   0x2000

◆ ID3V23_FRAME_TAG_PRESERV_FLAG

#define ID3V23_FRAME_TAG_PRESERV_FLAG   0x8000

◆ ID3V23_FRAME_ZERO_FLAG

#define ID3V23_FRAME_ZERO_FLAG   0x1F1F

◆ ID3V23_TAG

#define ID3V23_TAG   ME_FOURCC('I', 'D', '3', 3) /* id3 v2.3 header tag */

◆ ID3V23_UNSYNCH_FLAG

#define ID3V23_UNSYNCH_FLAG   0x80

◆ ID3V23_ZERO_FLAG

#define ID3V23_ZERO_FLAG   0x1F

◆ ID3V24_EXPERIMENTAL_FLAG

#define ID3V24_EXPERIMENTAL_FLAG   0x20

◆ ID3V24_EXT_CRC_FLAG

#define ID3V24_EXT_CRC_FLAG   0x20

◆ ID3V24_EXT_HEADER_FLAG

#define ID3V24_EXT_HEADER_FLAG   0x40

◆ ID3V24_EXT_RESTRICTIONS_FLAG

#define ID3V24_EXT_RESTRICTIONS_FLAG   0x10

◆ ID3V24_EXT_UPDATE_FLAG

#define ID3V24_EXT_UPDATE_FLAG   0x40

◆ ID3V24_EXT_ZERO_FLAG

#define ID3V24_EXT_ZERO_FLAG   0x8F

◆ ID3V24_FOOTER_FLAG

#define ID3V24_FOOTER_FLAG   0x10

◆ ID3V24_FOOTER_SIZE

#define ID3V24_FOOTER_SIZE   10

◆ ID3V24_FOOTER_TAG

#define ID3V24_FOOTER_TAG   ME_FOURCC('3', 'D', 'I', 0) /* id3 v2.4 footer tag */

◆ ID3V24_FRAME_COMPRESS_FLAG

#define ID3V24_FRAME_COMPRESS_FLAG   0x0008

◆ ID3V24_FRAME_DATA_LEN_FLAG

#define ID3V24_FRAME_DATA_LEN_FLAG   0x0001

◆ ID3V24_FRAME_ENCRYPT_FLAG

#define ID3V24_FRAME_ENCRYPT_FLAG   0x0004

◆ ID3V24_FRAME_FILE_PRESERV_FLAG

#define ID3V24_FRAME_FILE_PRESERV_FLAG   0x2000

◆ ID3V24_FRAME_GROUP_ID_FLAG

#define ID3V24_FRAME_GROUP_ID_FLAG   0x0040

◆ ID3V24_FRAME_HEADER_SIZE

#define ID3V24_FRAME_HEADER_SIZE   10

◆ ID3V24_FRAME_READ_ONLY_FLAG

#define ID3V24_FRAME_READ_ONLY_FLAG   0x1000

◆ ID3V24_FRAME_TAG_PRESERV_FLAG

#define ID3V24_FRAME_TAG_PRESERV_FLAG   0x4000

◆ ID3V24_FRAME_UNSYNCH_FLAG

#define ID3V24_FRAME_UNSYNCH_FLAG   0x0002

◆ ID3V24_FRAME_ZERO_FLAG

#define ID3V24_FRAME_ZERO_FLAG   0x8FB0

◆ ID3V24_TAG

#define ID3V24_TAG   ME_FOURCC('I', 'D', '3', 4) /* id3 v2.4 header tag */

◆ ID3V24_UNSYNCH_FLAG

#define ID3V24_UNSYNCH_FLAG   0x80

◆ ID3V24_ZERO_FLAG

#define ID3V24_ZERO_FLAG   0x0F

◆ ID3V2X_MASK

#define ID3V2X_MASK   ~ME_FOURCC( 0 , 0 , 0 , 0xFF) /* id3 v2.x header mask */

◆ ID3V2X_TAG

#define ID3V2X_TAG   ME_FOURCC('I', 'D', '3', 0) /* id3 v2.x header tag */

Typedef Documentation

◆ id3v24_footer_t

Function Documentation

◆ _X_BE_24_synchsafe()

static uint32_t _X_BE_24_synchsafe ( uint8_t  buf[3])
inlinestatic

◆ _X_BE_32_synchsafe()

static uint32_t _X_BE_32_synchsafe ( uint8_t  buf[4])
inlinestatic

◆ BE_35_synchsafe()

static uint32_t BE_35_synchsafe ( uint8_t  buf[5])
inlinestatic

Referenced by id3v24_parse_ext_header().

◆ id3v1_parse_tag()

int id3v1_parse_tag ( input_plugin_t input,
xine_stream_t stream 
)

◆ id3v2_istag()

static int id3v2_istag ( uint32_t  id3_signature)
inlinestatic

Checks if the given buffer is an ID3 tag preamble.

Parameters
ptrPointer to the first 10 bytes of the ID3 tag

References ID3V2X_MASK, and ID3V2X_TAG.

Referenced by demux_mpgaudio_next(), detect_mpgaudio_file(), open_flac_file(), open_mpc_file(), and probe_aac_file().

◆ id3v2_parse_tag()

int id3v2_parse_tag ( input_plugin_t input,
xine_stream_t stream,
uint32_t  id3_signature 
)

Generic function for ID3v2 tags parsing.

Parameters
inputPointer to the input plugin used by the demuxer, used to access the tag's data.
streamPointer to the xine stream currently being read.
mp3_frame_headerHeader of the MP3 frame carrying the tag.
Note
This function will take care of calling the proper function for parsing ID3v2.2, ID3v2.3 or ID3v2.4 tags.

References _x_assert, be2me_32, id3v22_parse_tag(), ID3V22_TAG, id3v23_parse_tag(), ID3V23_TAG, id3v24_parse_tag(), ID3V24_TAG, ID3V2X_MASK, ID3V2X_TAG, input(), LOG_MODULE, xine_stream_s::xine, XINE_VERBOSITY_LOG, and xprintf.

Referenced by demux_mpgaudio_next(), open_flac_file(), and probe_aac_file().