~ubuntu-branches/ubuntu/saucy/gst-libav1.0/saucy-proposed

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavformat/id3v2.h

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-07-30 09:00:15 UTC
  • mfrom: (1.1.16) (7.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20130730090015-sc1ou2yssu7q5w4e
Tags: 1.1.3-1
* New upstream development snapshot:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.1.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
#include <stdint.h>
26
26
#include "avformat.h"
 
27
#include "internal.h"
27
28
#include "metadata.h"
28
29
 
29
30
#define ID3v2_HEADER_SIZE 10
45
46
    ID3v2_ENCODING_UTF8     = 3,
46
47
};
47
48
 
 
49
typedef struct ID3v2EncContext {
 
50
    int      version;       ///< ID3v2 minor version, either 3 or 4
 
51
    int64_t size_pos;       ///< offset of the tag total size
 
52
    int          len;       ///< size of the tag written so far
 
53
} ID3v2EncContext;
 
54
 
48
55
typedef struct ID3v2ExtraMeta {
49
56
    const char *tag;
50
57
    void *data;
59
66
    uint8_t *data;
60
67
} ID3v2ExtraMetaGEOB;
61
68
 
 
69
typedef struct ID3v2ExtraMetaAPIC {
 
70
    uint8_t     *data;
 
71
    int          len;
 
72
    const char  *type;
 
73
    uint8_t     *description;
 
74
    enum AVCodecID id;
 
75
} ID3v2ExtraMetaAPIC;
 
76
 
62
77
/**
63
78
 * Detect ID3v2 Header.
64
79
 * @param buf   must be ID3v2_HEADER_SIZE byte long
75
90
int ff_id3v2_tag_len(const uint8_t *buf);
76
91
 
77
92
/**
78
 
 * Read an ID3v2 tag (text tags only)
79
 
 */
80
 
void ff_id3v2_read(AVFormatContext *s, const char *magic);
81
 
 
82
 
/**
83
 
 * Read an ID3v2 tag, including supported extra metadata (currently only GEOB)
 
93
 * Read an ID3v2 tag, including supported extra metadata
84
94
 * @param extra_meta If not NULL, extra metadata is parsed into a list of
85
95
 * ID3v2ExtraMeta structs and *extra_meta points to the head of the list
86
96
 */
87
 
void ff_id3v2_read_all(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta);
88
 
 
89
 
/**
90
 
 * Write an ID3v2 tag.
 
97
void ff_id3v2_read(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta);
 
98
 
 
99
/**
 
100
 * Initialize an ID3v2 tag.
 
101
 */
 
102
void ff_id3v2_start(ID3v2EncContext *id3, AVIOContext *pb, int id3v2_version,
 
103
                    const char *magic);
 
104
 
 
105
/**
 
106
 * Convert and write all global metadata from s into an ID3v2 tag.
 
107
 */
 
108
int ff_id3v2_write_metadata(AVFormatContext *s, ID3v2EncContext *id3);
 
109
 
 
110
/**
 
111
 * Write an attached picture from pkt into an ID3v2 tag.
 
112
 */
 
113
int ff_id3v2_write_apic(AVFormatContext *s, ID3v2EncContext *id3, AVPacket *pkt);
 
114
 
 
115
/**
 
116
 * Finalize an opened ID3v2 tag.
 
117
 */
 
118
void ff_id3v2_finish(ID3v2EncContext *id3, AVIOContext *pb);
 
119
 
 
120
/**
 
121
 * Write an ID3v2 tag containing all global metadata from s.
91
122
 * @param id3v2_version Subversion of ID3v2; supported values are 3 and 4
92
123
 * @param magic magic bytes to identify the header
93
124
 * If in doubt, use ID3v2_DEFAULT_MAGIC.
94
125
 */
95
 
int ff_id3v2_write(struct AVFormatContext *s, int id3v2_version, const char *magic);
 
126
int ff_id3v2_write_simple(struct AVFormatContext *s, int id3v2_version, const char *magic);
96
127
 
97
128
/**
98
129
 * Free memory allocated parsing special (non-text) metadata.
100
131
 */
101
132
void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta);
102
133
 
 
134
/**
 
135
 * Create a stream for each APIC (attached picture) extracted from the
 
136
 * ID3v2 header.
 
137
 */
 
138
int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta);
 
139
 
103
140
extern const AVMetadataConv ff_id3v2_34_metadata_conv[];
104
141
extern const AVMetadataConv ff_id3v2_4_metadata_conv[];
105
142
 
120
157
 */
121
158
extern const char ff_id3v2_3_tags[][4];
122
159
 
 
160
extern const CodecMime ff_id3v2_mime_tags[];
 
161
 
 
162
extern const char *ff_id3v2_picture_types[21];
 
163
 
123
164
#endif /* AVFORMAT_ID3V2_H */