FFmpeg
Functions | Variables
vorbiscomment.c File Reference
#include "avio.h"
#include "avformat.h"
#include "metadata.h"
#include "vorbiscomment.h"
#include "libavutil/dict.h"

Go to the source code of this file.

Functions

int64_t ff_vorbiscomment_length (const AVDictionary *m, const char *vendor_string, AVChapter **chapters, unsigned int nb_chapters)
 Calculate the length in bytes of a VorbisComment. More...
 
int ff_vorbiscomment_write (AVIOContext *pb, const AVDictionary *m, const char *vendor_string, AVChapter **chapters, unsigned int nb_chapters)
 Write a VorbisComment into an AVIOContext. More...
 

Variables

const AVMetadataConv ff_vorbiscomment_metadata_conv []
 VorbisComment metadata conversion mapping. More...
 

Function Documentation

◆ ff_vorbiscomment_length()

int64_t ff_vorbiscomment_length ( const AVDictionary m,
const char *  vendor_string,
AVChapter **  chapters,
unsigned int  nb_chapters 
)

Calculate the length in bytes of a VorbisComment.

This is the minimum size required by ff_vorbiscomment_write().

Parameters
mThe metadata structure to be parsed. For no metadata, set to NULL.
vendor_stringThe vendor string to be added into the VorbisComment. For no string, set to an empty string.
Returns
The length in bytes.

Definition at line 41 of file vorbiscomment.c.

Referenced by flac_write_block_comment(), and ogg_write_vorbiscomment().

◆ ff_vorbiscomment_write()

int ff_vorbiscomment_write ( AVIOContext pb,
const AVDictionary m,
const char *  vendor_string,
AVChapter **  chapters,
unsigned int  nb_chapters 
)

Write a VorbisComment into an AVIOContext.

The output size can be obtained in advance by passing the same chapters, AVDictionary and vendor_string to ff_vorbiscomment_length()

Parameters
pbThe AVIOContext to write the output.
mThe metadata struct to write.
vendor_stringThe vendor string to write.
chaptersThe chapters to write.
nb_chaptersThe number of chapters to write.

Definition at line 65 of file vorbiscomment.c.

Referenced by flac_write_block_comment(), and ogg_write_vorbiscomment().

Variable Documentation

◆ ff_vorbiscomment_metadata_conv

const AVMetadataConv ff_vorbiscomment_metadata_conv[]
Initial value:
= {
{ "ALBUMARTIST", "album_artist"},
{ "TRACKNUMBER", "track" },
{ "DISCNUMBER", "disc" },
{ "DESCRIPTION", "comment" },
{ 0 }
}

VorbisComment metadata conversion mapping.

from Ogg Vorbis I format specification: comment field and header specification http://xiph.org/vorbis/doc/v-comment.html

Definition at line 33 of file vorbiscomment.c.

Referenced by ff_vorbis_comment(), flac_write_block_comment(), and ogg_write_vorbiscomment().