chromium/third_party/ffmpeg/libavformat/id3v2.c

/*
 * Copyright (c) 2003 Fabrice Bellard
 *
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * FFmpeg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with FFmpeg; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

/**
 * @file
 * ID3v2 header parser
 *
 * Specifications available at:
 * http://id3.org/Developer_Information
 */

#include "config.h"

#if CONFIG_ZLIB
#include <zlib.h>
#endif

#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/dict.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "libavcodec/png.h"
#include "avio_internal.h"
#include "demux.h"
#include "id3v1.h"
#include "id3v2.h"

const AVMetadataConv ff_id3v2_34_metadata_conv[] =;

const AVMetadataConv ff_id3v2_4_metadata_conv[] =;

static const AVMetadataConv id3v2_2_metadata_conv[] =;

const char ff_id3v2_tags[][4] =;

const char ff_id3v2_4_tags[][4] =;

const char ff_id3v2_3_tags[][4] =;

const char * const ff_id3v2_picture_types[21] =;

const CodecMime ff_id3v2_mime_tags[] =;

int ff_id3v2_match(const uint8_t *buf, const char *magic)
{}

int ff_id3v2_tag_len(const uint8_t *buf)
{}

static unsigned int get_size(AVIOContext *s, int len)
{}

static unsigned int size_to_syncsafe(unsigned int size)
{}

/* No real verification, only check that the tag consists of
 * a combination of capital alpha-numerical characters */
static int is_tag(const char *buf, unsigned int len)
{}

/**
 * Return 1 if the tag of length len at the given offset is valid, 0 if not, -1 on error
 */
static int check_tag(AVIOContext *s, int offset, unsigned int len)
{}

/**
 * Free GEOB type extra metadata.
 */
static void free_geobtag(void *obj)
{}

/**
 * Decode characters to UTF-8 according to encoding type. The decoded buffer is
 * always null terminated. Stop reading when either *maxread bytes are read from
 * pb or U+0000 character is found.
 *
 * @param dst Pointer where the address of the buffer with the decoded bytes is
 * stored. Buffer must be freed by caller.
 * @param maxread Pointer to maximum number of characters to read from the
 * AVIOContext. After execution the value is decremented by the number of bytes
 * actually read.
 * @returns 0 if no error occurred, dst is uninitialized on error
 */
static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
                      uint8_t **dst, int *maxread)
{}

/**
 * Parse a text tag.
 */
static void read_ttag(AVFormatContext *s, AVIOContext *pb, int taglen,
                      AVDictionary **metadata, const char *key)
{}

static void read_uslt(AVFormatContext *s, AVIOContext *pb, int taglen,
                      AVDictionary **metadata)
{}

/**
 * Parse a comment tag.
 */
static void read_comment(AVFormatContext *s, AVIOContext *pb, int taglen,
                      AVDictionary **metadata)
{}

ExtraMetaList;

static void list_append(ID3v2ExtraMeta *new_elem, ExtraMetaList *list)
{}

/**
 * Parse GEOB tag into a ID3v2ExtraMetaGEOB struct.
 */
static void read_geobtag(AVFormatContext *s, AVIOContext *pb, int taglen,
                         const char *tag, ExtraMetaList *extra_meta, int isv34)
{}

static int is_number(const char *str)
{}

static AVDictionaryEntry *get_date_tag(AVDictionary *m, const char *tag)
{}

static void merge_date(AVDictionary **m)
{}

static void free_apic(void *obj)
{}

static void rstrip_spaces(char *buf)
{}

static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen,
                      const char *tag, ExtraMetaList *extra_meta, int isv34)
{}

static void free_chapter(void *obj)
{}

static void read_chapter(AVFormatContext *s, AVIOContext *pb, int len,
                         const char *ttag, ExtraMetaList *extra_meta, int isv34)
{}

static void free_priv(void *obj)
{}

static void read_priv(AVFormatContext *s, AVIOContext *pb, int taglen,
                      const char *tag, ExtraMetaList *extra_meta, int isv34)
{}

ID3v2EMFunc;

static const ID3v2EMFunc id3v2_extra_meta_funcs[] =;

/**
 * Get the corresponding ID3v2EMFunc struct for a tag.
 * @param isv34 Determines if v2.2 or v2.3/4 strings are used
 * @return A pointer to the ID3v2EMFunc struct if found, NULL otherwise.
 */
static const ID3v2EMFunc *get_extra_meta_func(const char *tag, int isv34)
{}

static void id3v2_parse(AVIOContext *pb, AVDictionary **metadata,
                        AVFormatContext *s, int len, uint8_t version,
                        uint8_t flags, ExtraMetaList *extra_meta)
{}

static void id3v2_read_internal(AVIOContext *pb, AVDictionary **metadata,
                                AVFormatContext *s, const char *magic,
                                ID3v2ExtraMeta **extra_metap, int64_t max_search_size)
{}

void ff_id3v2_read_dict(AVIOContext *pb, AVDictionary **metadata,
                        const char *magic, ID3v2ExtraMeta **extra_meta)
{}

void ff_id3v2_read(AVFormatContext *s, const char *magic,
                   ID3v2ExtraMeta **extra_meta, unsigned int max_search_size)
{}

void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)
{}

int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta *extra_meta)
{}

int ff_id3v2_parse_chapters(AVFormatContext *s, ID3v2ExtraMeta *cur)
{}

int ff_id3v2_parse_priv_dict(AVDictionary **metadata, ID3v2ExtraMeta *extra_meta)
{}

int ff_id3v2_parse_priv(AVFormatContext *s, ID3v2ExtraMeta *extra_meta)
{}