00001 /* 00002 * RIFF codec tags 00003 * copyright (c) 2000 Fabrice Bellard 00004 * 00005 * This file is part of FFmpeg. 00006 * 00007 * FFmpeg is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * FFmpeg is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with FFmpeg; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 00028 #ifndef AVFORMAT_RIFF_H 00029 #define AVFORMAT_RIFF_H 00030 00031 #include "libavcodec/avcodec.h" 00032 #include "avio.h" 00033 #include "internal.h" 00034 00035 int64_t ff_start_tag(AVIOContext *pb, const char *tag); 00036 void ff_end_tag(AVIOContext *pb, int64_t start); 00037 00043 int ff_get_bmp_header(AVIOContext *pb, AVStream *st); 00044 00045 void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf); 00046 int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc); 00047 enum CodecID ff_wav_codec_get_id(unsigned int tag, int bps); 00048 int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size); 00049 00050 extern const AVCodecTag ff_codec_bmp_tags[]; 00051 extern const AVCodecTag ff_codec_wav_tags[]; 00052 00053 unsigned int ff_codec_get_tag(const AVCodecTag *tags, enum CodecID id); 00054 enum CodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag); 00055 void ff_parse_specific_params(AVCodecContext *stream, int *au_rate, int *au_ssize, int *au_scale); 00056 00057 typedef uint8_t ff_asf_guid[16]; 00058 00059 #define FF_PRI_GUID \ 00060 "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" 00061 #define FF_ARG_GUID(g) \ 00062 g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15] 00063 00064 static av_always_inline int ff_guidcmp(const void *g1, const void *g2) 00065 { 00066 return memcmp(g1, g2, sizeof(ff_asf_guid)); 00067 } 00068 00069 void ff_get_guid(AVIOContext *s, ff_asf_guid *g); 00070 00071 typedef struct { 00072 enum CodecID id; 00073 ff_asf_guid guid; 00074 } AVCodecGuid; 00075 00076 enum CodecID ff_codec_guid_get_id(const AVCodecGuid *guids, ff_asf_guid guid); 00077 00078 extern const AVCodecGuid ff_codec_wav_guids[]; 00079 00080 #define FF_MEDIASUBTYPE_BASE_GUID \ 00081 0x00,0x00,0x10,0x00,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71 00082 00083 #endif /* AVFORMAT_RIFF_H */