00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AVFORMAT_RAWDEC_H
00023 #define AVFORMAT_RAWDEC_H
00024
00025 #include "avformat.h"
00026 #include "libavutil/log.h"
00027 #include "libavutil/opt.h"
00028
00029 typedef struct RawAudioDemuxerContext {
00030 AVClass *class;
00031 int sample_rate;
00032 int channels;
00033 } RawAudioDemuxerContext;
00034
00035 typedef struct FFRawVideoDemuxerContext {
00036 const AVClass *class;
00037 char *video_size;
00038 char *pixel_format;
00039 char *framerate;
00040 } FFRawVideoDemuxerContext;
00041
00042 extern const AVOption ff_rawvideo_options[];
00043
00044 int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap);
00045
00046 int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt);
00047
00048 int ff_raw_audio_read_header(AVFormatContext *s, AVFormatParameters *ap);
00049
00050 int ff_raw_video_read_header(AVFormatContext *s, AVFormatParameters *ap);
00051
00052 #define FF_RAWVIDEO_DEMUXER_CLASS(name)\
00053 static const AVClass name ## _demuxer_class = {\
00054 .class_name = #name " demuxer",\
00055 .item_name = av_default_item_name,\
00056 .option = ff_rawvideo_options,\
00057 .version = LIBAVUTIL_VERSION_INT,\
00058 };
00059
00060 #define FF_DEF_RAWVIDEO_DEMUXER(shortname, longname, probe, ext, id)\
00061 FF_RAWVIDEO_DEMUXER_CLASS(shortname)\
00062 AVInputFormat ff_ ## shortname ## _demuxer = {\
00063 .name = #shortname,\
00064 .long_name = NULL_IF_CONFIG_SMALL(longname),\
00065 .read_probe = probe,\
00066 .read_header = ff_raw_video_read_header,\
00067 .read_packet = ff_raw_read_partial_packet,\
00068 .extensions = ext,\
00069 .flags = AVFMT_GENERIC_INDEX,\
00070 .value = id,\
00071 .priv_data_size = sizeof(FFRawVideoDemuxerContext),\
00072 .priv_class = &shortname ## _demuxer_class,\
00073 };
00074
00075 #endif