00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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 #include "metadata.h"
00035
00036 extern const AVMetadataConv ff_riff_info_conv[];
00037 extern const char ff_riff_tags[][5];
00038
00039 int64_t ff_start_tag(AVIOContext *pb, const char *tag);
00040 void ff_end_tag(AVIOContext *pb, int64_t start);
00041
00047 int ff_get_bmp_header(AVIOContext *pb, AVStream *st, unsigned *esize);
00048
00049 void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf);
00050 int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc);
00051 enum AVCodecID ff_wav_codec_get_id(unsigned int tag, int bps);
00052 int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size);
00053
00054 extern const AVCodecTag ff_codec_bmp_tags[];
00055 extern const AVCodecTag ff_codec_wav_tags[];
00056
00057 void ff_parse_specific_params(AVCodecContext *stream, int *au_rate, int *au_ssize, int *au_scale);
00058
00059 typedef uint8_t ff_asf_guid[16];
00060
00061 int ff_read_riff_info(AVFormatContext *s, int64_t size);
00062
00063 #define FF_PRI_GUID \
00064 "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
00065 #define FF_ARG_GUID(g) \
00066 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]
00067
00068 static av_always_inline int ff_guidcmp(const void *g1, const void *g2)
00069 {
00070 return memcmp(g1, g2, sizeof(ff_asf_guid));
00071 }
00072
00073 void ff_get_guid(AVIOContext *s, ff_asf_guid *g);
00074
00075 typedef struct {
00076 enum AVCodecID id;
00077 ff_asf_guid guid;
00078 } AVCodecGuid;
00079
00080 enum AVCodecID ff_codec_guid_get_id(const AVCodecGuid *guids, ff_asf_guid guid);
00081
00082 extern const AVCodecGuid ff_codec_wav_guids[];
00083
00084 #define FF_MEDIASUBTYPE_BASE_GUID \
00085 0x00,0x00,0x10,0x00,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71
00086
00090 void ff_riff_write_info(AVFormatContext *s);
00091
00095 void ff_riff_write_info_tag(AVIOContext *pb, const char *tag, const char *str);
00096
00097 #endif