Blame gst-libs/gst/tag/id3v2.h

Packit 971217
/* Copyright 2005 Jan Schmidt <thaytan@mad.scientist.com>
Packit 971217
 *
Packit 971217
 * This library is free software; you can redistribute it and/or
Packit 971217
 * modify it under the terms of the GNU Library General Public
Packit 971217
 * License as published by the Free Software Foundation; either
Packit 971217
 * version 2 of the License, or (at your option) any later version.
Packit 971217
 *
Packit 971217
 * This library is distributed in the hope that it will be useful,
Packit 971217
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 971217
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 971217
 * Library General Public License for more details.
Packit 971217
 *
Packit 971217
 * You should have received a copy of the GNU Library General Public
Packit 971217
 * License along with this library; if not, write to the
Packit 971217
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Packit 971217
 * Boston, MA 02110-1301, USA.
Packit 971217
 */
Packit 971217
Packit 971217
#ifndef __ID3TAGS_H__
Packit 971217
#define __ID3TAGS_H__
Packit 971217
Packit 971217
#include <gst/gst.h>
Packit 971217
#include <gst/tag/tag-prelude.h>
Packit 971217
Packit 971217
G_BEGIN_DECLS
Packit 971217
Packit 971217
#define ID3V2_MARK_SIZE 3
Packit 971217
#define ID3V2_HDR_SIZE GST_TAG_ID3V2_HEADER_SIZE
Packit 971217
Packit 971217
/* From id3v2.c */
Packit 971217
guint id3v2_read_synch_uint (const guint8 * data, guint size);
Packit 971217
Packit 971217
/* Things shared by id3tags.c and id3v2frames.c */
Packit 971217
#define ID3V2_VERSION 0x0400
Packit 971217
#define ID3V2_VER_MAJOR(v) ((v) >> 8)
Packit 971217
#define ID3V2_VER_MINOR(v) ((v) & 0xff)
Packit 971217
   
Packit 971217
typedef struct {
Packit 971217
  guint16 version;
Packit 971217
  guint8 flags;
Packit 971217
  guint32 size;
Packit 971217
    
Packit 971217
  guint8 *frame_data;
Packit 971217
  guint32 frame_data_size;
Packit 971217
Packit 971217
  guint32 ext_hdr_size;
Packit 971217
  guint8 ext_flag_bytes;
Packit 971217
  guint8 *ext_flag_data;  
Packit 971217
} ID3v2Header;
Packit 971217
Packit 971217
typedef struct {
Packit 971217
  ID3v2Header hdr;
Packit 971217
  
Packit 971217
  GstBuffer *buffer;
Packit 971217
  GstTagList *tags;
Packit 971217
Packit 971217
  /* Current frame decoding */
Packit 971217
  guint cur_frame_size;
Packit 971217
  gchar *frame_id;
Packit 971217
  guint16 frame_flags;
Packit 971217
  
Packit 971217
  guint8 *parse_data;
Packit 971217
  guint parse_size;
Packit 971217
  
Packit 971217
  /* To collect day/month from obsolete TDAT frame if it exists */
Packit 971217
  guint pending_month;
Packit 971217
  guint pending_day;
Packit 971217
} ID3TagsWorking;
Packit 971217
Packit 971217
enum {
Packit 971217
  ID3V2_HDR_FLAG_UNSYNC       = 0x80,
Packit 971217
  ID3V2_HDR_FLAG_EXTHDR       = 0x40,
Packit 971217
  ID3V2_HDR_FLAG_EXPERIMENTAL = 0x20,
Packit 971217
  ID3V2_HDR_FLAG_FOOTER       = 0x10
Packit 971217
};
Packit 971217
Packit 971217
enum {
Packit 971217
  ID3V2_EXT_FLAG_UPDATE     = 0x80,
Packit 971217
  ID3V2_EXT_FLAG_CRC        = 0x40,
Packit 971217
  ID3V2_EXT_FLAG_RESTRICTED = 0x20
Packit 971217
};
Packit 971217
Packit 971217
enum {
Packit 971217
  ID3V2_FRAME_STATUS_FRAME_ALTER_PRESERVE  = 0x4000,
Packit 971217
  ID3V2_FRAME_STATUS_FILE_ALTER_PRESERVE   = 0x2000,
Packit 971217
  ID3V2_FRAME_STATUS_READONLY              = 0x1000,
Packit 971217
  ID3V2_FRAME_FORMAT_GROUPING_ID           = 0x0040,
Packit 971217
  ID3V2_FRAME_FORMAT_COMPRESSION           = 0x0008,
Packit 971217
  ID3V2_FRAME_FORMAT_ENCRYPTION            = 0x0004,
Packit 971217
  ID3V2_FRAME_FORMAT_UNSYNCHRONISATION     = 0x0002,
Packit 971217
  ID3V2_FRAME_FORMAT_DATA_LENGTH_INDICATOR = 0x0001
Packit 971217
};
Packit 971217
Packit 971217
#define ID3V2_3_FRAME_FLAGS_MASK              \
Packit 971217
  (ID3V2_FRAME_STATUS_FRAME_ALTER_PRESERVE |  \
Packit 971217
   ID3V2_FRAME_STATUS_FILE_ALTER_PRESERVE  |  \
Packit 971217
   ID3V2_FRAME_STATUS_READONLY |              \
Packit 971217
   ID3V2_FRAME_FORMAT_GROUPING_ID |           \
Packit 971217
   ID3V2_FRAME_FORMAT_COMPRESSION |           \
Packit 971217
   ID3V2_FRAME_FORMAT_ENCRYPTION)
Packit 971217
Packit 971217
/* FIXME 0.11: remove 'private' bit from GST_TAG_ID3V2_FRAME */
Packit 971217
/**
Packit 971217
 * GST_TAG_ID3V2_FRAME:
Packit 971217
 *
Packit 971217
 * Contains a single unprocessed ID3v2 frame. (buffer)
Packit 971217
 *
Packit 971217
 * (Not public API for now)
Packit 971217
 */
Packit 971217
#define GST_TAG_ID3V2_FRAME                  "private-id3v2-frame"
Packit 971217
Packit 971217
/* From id3v2frames.c */
Packit 971217
gboolean id3v2_parse_frame (ID3TagsWorking *work);
Packit 971217
Packit 971217
guint8 * id3v2_ununsync_data (const guint8 * unsync_data, guint32 * size);
Packit 971217
Packit 971217
GstDebugCategory * id3v2_ensure_debug_category (void);
Packit 971217
Packit 971217
G_END_DECLS
Packit 971217
Packit 971217
#endif