Libav 0.7.1
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 
00028 typedef struct RawAudioDemuxerContext {
00029     AVClass *class;
00030     int sample_rate;
00031     int channels;
00032 } RawAudioDemuxerContext;
00033 
00034 typedef struct FFRawVideoDemuxerContext {
00035     const AVClass *class;     
00036     char *video_size;         
00037     char *pixel_format;       
00038     char *framerate;          
00039 } FFRawVideoDemuxerContext;
00040 
00041 extern const AVClass ff_rawaudio_demuxer_class;
00042 extern const AVClass ff_rawvideo_demuxer_class;
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_DEF_RAWVIDEO_DEMUXER(shortname, longname, probe, ext, id)\
00053 AVInputFormat ff_ ## shortname ## _demuxer = {\
00054     .name           = #shortname,\
00055     .long_name      = NULL_IF_CONFIG_SMALL(longname),\
00056     .read_probe     = probe,\
00057     .read_header    = ff_raw_video_read_header,\
00058     .read_packet    = ff_raw_read_partial_packet,\
00059     .extensions     = ext,\
00060     .flags          = AVFMT_GENERIC_INDEX,\
00061     .value          = id,\
00062     .priv_data_size = sizeof(FFRawVideoDemuxerContext),\
00063     .priv_class     = &ff_rawvideo_demuxer_class,\
00064 };
00065 
00066 #endif /* AVFORMAT_RAWDEC_H */