1cabdff1aSopenharmony_ci/* 2cabdff1aSopenharmony_ci * VorbisComment writer 3cabdff1aSopenharmony_ci * Copyright (c) 2009 James Darnley 4cabdff1aSopenharmony_ci * 5cabdff1aSopenharmony_ci * This file is part of FFmpeg. 6cabdff1aSopenharmony_ci * 7cabdff1aSopenharmony_ci * FFmpeg is free software; you can redistribute it and/or 8cabdff1aSopenharmony_ci * modify it under the terms of the GNU Lesser General Public 9cabdff1aSopenharmony_ci * License as published by the Free Software Foundation; either 10cabdff1aSopenharmony_ci * version 2.1 of the License, or (at your option) any later version. 11cabdff1aSopenharmony_ci * 12cabdff1aSopenharmony_ci * FFmpeg is distributed in the hope that it will be useful, 13cabdff1aSopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of 14cabdff1aSopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15cabdff1aSopenharmony_ci * Lesser General Public License for more details. 16cabdff1aSopenharmony_ci * 17cabdff1aSopenharmony_ci * You should have received a copy of the GNU Lesser General Public 18cabdff1aSopenharmony_ci * License along with FFmpeg; if not, write to the Free Software 19cabdff1aSopenharmony_ci * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20cabdff1aSopenharmony_ci */ 21cabdff1aSopenharmony_ci 22cabdff1aSopenharmony_ci#ifndef AVFORMAT_VORBISCOMMENT_H 23cabdff1aSopenharmony_ci#define AVFORMAT_VORBISCOMMENT_H 24cabdff1aSopenharmony_ci 25cabdff1aSopenharmony_ci#include "avformat.h" 26cabdff1aSopenharmony_ci#include "metadata.h" 27cabdff1aSopenharmony_ci 28cabdff1aSopenharmony_ci/** 29cabdff1aSopenharmony_ci * Calculate the length in bytes of a VorbisComment. This is the minimum 30cabdff1aSopenharmony_ci * size required by ff_vorbiscomment_write(). 31cabdff1aSopenharmony_ci * 32cabdff1aSopenharmony_ci * @param m The metadata structure to be parsed. For no metadata, set to NULL. 33cabdff1aSopenharmony_ci * @param vendor_string The vendor string to be added into the VorbisComment. 34cabdff1aSopenharmony_ci * For no string, set to an empty string. 35cabdff1aSopenharmony_ci * @return The length in bytes. 36cabdff1aSopenharmony_ci */ 37cabdff1aSopenharmony_ciint64_t ff_vorbiscomment_length(const AVDictionary *m, const char *vendor_string, 38cabdff1aSopenharmony_ci AVChapter **chapters, unsigned int nb_chapters); 39cabdff1aSopenharmony_ci 40cabdff1aSopenharmony_ci/** 41cabdff1aSopenharmony_ci * Write a VorbisComment into an AVIOContext. The output size can be obtained 42cabdff1aSopenharmony_ci * in advance by passing the same chapters, AVDictionary and vendor_string to 43cabdff1aSopenharmony_ci * ff_vorbiscomment_length() 44cabdff1aSopenharmony_ci * 45cabdff1aSopenharmony_ci * @param pb The AVIOContext to write the output. 46cabdff1aSopenharmony_ci * @param m The metadata struct to write. 47cabdff1aSopenharmony_ci * @param vendor_string The vendor string to write. 48cabdff1aSopenharmony_ci * @param chapters The chapters to write. 49cabdff1aSopenharmony_ci * @param nb_chapters The number of chapters to write. 50cabdff1aSopenharmony_ci */ 51cabdff1aSopenharmony_ciint ff_vorbiscomment_write(AVIOContext *pb, const AVDictionary *m, 52cabdff1aSopenharmony_ci const char *vendor_string, 53cabdff1aSopenharmony_ci AVChapter **chapters, unsigned int nb_chapters); 54cabdff1aSopenharmony_ci 55cabdff1aSopenharmony_ciextern const AVMetadataConv ff_vorbiscomment_metadata_conv[]; 56cabdff1aSopenharmony_ci 57cabdff1aSopenharmony_ci#endif /* AVFORMAT_VORBISCOMMENT_H */ 58