libavformat/rawdec.h
Go to the documentation of this file.
00001 /*
00002  * RAW demuxers
00003  * Copyright (C) 2007  Aurelien Jacobs <aurel@gnuage.org>
00004  *
00005  * This file is part of Libav.
00006  *
00007  * Libav 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  * Libav 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 Libav; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
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 /* AVFORMAT_RAWDEC_H */