changeset 6448:4775a49a6045 libavformat

split raw.c into rawdec.c and rawenc.c
author aurel
date Mon, 30 Aug 2010 23:16:35 +0000
parents ef0ad6df55b2
children 3a28e6827095
files Makefile aacdec.c ac3dec.c cavsvideodec.c diracdec.c dnxhddec.c dtsdec.c flacdec.c h261dec.c h263dec.c h264dec.c idroqenc.c ingenientdec.c m4vdec.c mpegvideodec.c pcmdec.c pcmenc.c raw.c raw.h rawdec.c rawdec.h rawenc.c rawenc.h rawvideodec.c
diffstat 24 files changed, 665 insertions(+), 618 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Mon Aug 30 22:53:16 2010 +0000
+++ b/Makefile	Mon Aug 30 23:16:35 2010 +0000
@@ -17,9 +17,9 @@
 
 # muxers/demuxers
 OBJS-$(CONFIG_A64_MUXER)                 += a64.o
-OBJS-$(CONFIG_AAC_DEMUXER)               += aacdec.o id3v1.o id3v2.o raw.o
-OBJS-$(CONFIG_AC3_DEMUXER)               += ac3dec.o raw.o
-OBJS-$(CONFIG_AC3_MUXER)                 += raw.o
+OBJS-$(CONFIG_AAC_DEMUXER)               += aacdec.o id3v1.o id3v2.o rawdec.o
+OBJS-$(CONFIG_AC3_DEMUXER)               += ac3dec.o rawdec.o
+OBJS-$(CONFIG_AC3_MUXER)                 += rawenc.o
 OBJS-$(CONFIG_ADTS_MUXER)                += adtsenc.o
 OBJS-$(CONFIG_AEA_DEMUXER)               += aea.o pcm.o
 OBJS-$(CONFIG_AIFF_DEMUXER)              += aiffdec.o riff.o pcm.o
@@ -47,30 +47,30 @@
 OBJS-$(CONFIG_BINK_DEMUXER)              += bink.o
 OBJS-$(CONFIG_C93_DEMUXER)               += c93.o vocdec.o voc.o
 OBJS-$(CONFIG_CAF_DEMUXER)               += cafdec.o caf.o mov.o riff.o isom.o
-OBJS-$(CONFIG_CAVSVIDEO_DEMUXER)         += cavsvideodec.o raw.o
+OBJS-$(CONFIG_CAVSVIDEO_DEMUXER)         += cavsvideodec.o rawdec.o
 OBJS-$(CONFIG_CDG_DEMUXER)               += cdg.o
 OBJS-$(CONFIG_CRC_MUXER)                 += crcenc.o
 OBJS-$(CONFIG_DAUD_DEMUXER)              += daud.o
 OBJS-$(CONFIG_DAUD_MUXER)                += daud.o
-OBJS-$(CONFIG_DIRAC_DEMUXER)             += diracdec.o raw.o
-OBJS-$(CONFIG_DIRAC_MUXER)               += raw.o
-OBJS-$(CONFIG_DNXHD_DEMUXER)             += dnxhddec.o raw.o
-OBJS-$(CONFIG_DNXHD_MUXER)               += raw.o
+OBJS-$(CONFIG_DIRAC_DEMUXER)             += diracdec.o rawdec.o
+OBJS-$(CONFIG_DIRAC_MUXER)               += rawenc.o
+OBJS-$(CONFIG_DNXHD_DEMUXER)             += dnxhddec.o rawdec.o
+OBJS-$(CONFIG_DNXHD_MUXER)               += rawenc.o
 OBJS-$(CONFIG_DSICIN_DEMUXER)            += dsicin.o
-OBJS-$(CONFIG_DTS_DEMUXER)               += dtsdec.o raw.o
-OBJS-$(CONFIG_DTS_MUXER)                 += raw.o
+OBJS-$(CONFIG_DTS_DEMUXER)               += dtsdec.o rawdec.o
+OBJS-$(CONFIG_DTS_MUXER)                 += rawenc.o
 OBJS-$(CONFIG_DV_DEMUXER)                += dv.o
 OBJS-$(CONFIG_DV_MUXER)                  += dvenc.o
 OBJS-$(CONFIG_DXA_DEMUXER)               += dxa.o riff.o
 OBJS-$(CONFIG_EA_CDATA_DEMUXER)          += eacdata.o
 OBJS-$(CONFIG_EA_DEMUXER)                += electronicarts.o
-OBJS-$(CONFIG_EAC3_DEMUXER)              += ac3dec.o raw.o
-OBJS-$(CONFIG_EAC3_MUXER)                += raw.o
+OBJS-$(CONFIG_EAC3_DEMUXER)              += ac3dec.o rawdec.o
+OBJS-$(CONFIG_EAC3_MUXER)                += rawenc.o
 OBJS-$(CONFIG_FFM_DEMUXER)               += ffmdec.o
 OBJS-$(CONFIG_FFM_MUXER)                 += ffmenc.o
 OBJS-$(CONFIG_FILMSTRIP_DEMUXER)         += filmstripdec.o
 OBJS-$(CONFIG_FILMSTRIP_MUXER)           += filmstripenc.o
-OBJS-$(CONFIG_FLAC_DEMUXER)              += flacdec.o raw.o id3v1.o \
+OBJS-$(CONFIG_FLAC_DEMUXER)              += flacdec.o rawdec.o id3v1.o \
                                             id3v2.o oggparsevorbis.o \
                                             vorbiscomment.o
 OBJS-$(CONFIG_FLAC_MUXER)                += flacenc.o flacenc_header.o \
@@ -82,39 +82,39 @@
 OBJS-$(CONFIG_FRAMECRC_MUXER)            += framecrcenc.o
 OBJS-$(CONFIG_FRAMEMD5_MUXER)            += md5enc.o
 OBJS-$(CONFIG_GIF_MUXER)                 += gif.o
-OBJS-$(CONFIG_GSM_DEMUXER)               += raw.o
+OBJS-$(CONFIG_GSM_DEMUXER)               += rawdec.o
 OBJS-$(CONFIG_GXF_DEMUXER)               += gxf.o
 OBJS-$(CONFIG_GXF_MUXER)                 += gxfenc.o audiointerleave.o
-OBJS-$(CONFIG_H261_DEMUXER)              += h261dec.o raw.o
-OBJS-$(CONFIG_H261_MUXER)                += raw.o
-OBJS-$(CONFIG_H263_DEMUXER)              += h263dec.o raw.o
-OBJS-$(CONFIG_H263_MUXER)                += raw.o
-OBJS-$(CONFIG_H264_DEMUXER)              += h264dec.o raw.o
-OBJS-$(CONFIG_H264_MUXER)                += raw.o
+OBJS-$(CONFIG_H261_DEMUXER)              += h261dec.o rawdec.o
+OBJS-$(CONFIG_H261_MUXER)                += rawenc.o
+OBJS-$(CONFIG_H263_DEMUXER)              += h263dec.o rawdec.o
+OBJS-$(CONFIG_H263_MUXER)                += rawenc.o
+OBJS-$(CONFIG_H264_DEMUXER)              += h264dec.o rawdec.o
+OBJS-$(CONFIG_H264_MUXER)                += rawenc.o
 OBJS-$(CONFIG_IDCIN_DEMUXER)             += idcin.o
 OBJS-$(CONFIG_IFF_DEMUXER)               += iff.o
 OBJS-$(CONFIG_IMAGE2_DEMUXER)            += img2.o
 OBJS-$(CONFIG_IMAGE2_MUXER)              += img2.o
 OBJS-$(CONFIG_IMAGE2PIPE_DEMUXER)        += img2.o
 OBJS-$(CONFIG_IMAGE2PIPE_MUXER)          += img2.o
-OBJS-$(CONFIG_INGENIENT_DEMUXER)         += ingenientdec.o raw.o
+OBJS-$(CONFIG_INGENIENT_DEMUXER)         += ingenientdec.o rawdec.o
 OBJS-$(CONFIG_IPMOVIE_DEMUXER)           += ipmovie.o
 OBJS-$(CONFIG_ISS_DEMUXER)               += iss.o
 OBJS-$(CONFIG_IV8_DEMUXER)               += iv8.o
 OBJS-$(CONFIG_IVF_DEMUXER)               += ivfdec.o riff.o
 OBJS-$(CONFIG_LMLM4_DEMUXER)             += lmlm4.o
-OBJS-$(CONFIG_M4V_DEMUXER)               += m4vdec.o raw.o
-OBJS-$(CONFIG_M4V_MUXER)                 += raw.o
+OBJS-$(CONFIG_M4V_DEMUXER)               += m4vdec.o rawdec.o
+OBJS-$(CONFIG_M4V_MUXER)                 += rawenc.o
 OBJS-$(CONFIG_MATROSKA_DEMUXER)          += matroskadec.o matroska.o \
                                             riff.o isom.o rmdec.o rm.o
 OBJS-$(CONFIG_MATROSKA_MUXER)            += matroskaenc.o matroska.o \
                                             riff.o isom.o avc.o \
                                             flacenc_header.o
 OBJS-$(CONFIG_MD5_MUXER)                 += md5enc.o
-OBJS-$(CONFIG_MJPEG_DEMUXER)             += raw.o
-OBJS-$(CONFIG_MJPEG_MUXER)               += raw.o
-OBJS-$(CONFIG_MLP_DEMUXER)               += raw.o
-OBJS-$(CONFIG_MLP_MUXER)                 += raw.o
+OBJS-$(CONFIG_MJPEG_DEMUXER)             += rawdec.o
+OBJS-$(CONFIG_MJPEG_MUXER)               += rawenc.o
+OBJS-$(CONFIG_MLP_DEMUXER)               += rawdec.o
+OBJS-$(CONFIG_MLP_MUXER)                 += rawenc.o
 OBJS-$(CONFIG_MM_DEMUXER)                += mm.o
 OBJS-$(CONFIG_MMF_DEMUXER)               += mmf.o pcm.o
 OBJS-$(CONFIG_MMF_MUXER)                 += mmf.o riff.o
@@ -130,12 +130,12 @@
 OBJS-$(CONFIG_MPEG2DVD_MUXER)            += mpegenc.o
 OBJS-$(CONFIG_MPEG2VOB_MUXER)            += mpegenc.o
 OBJS-$(CONFIG_MPEG2SVCD_MUXER)           += mpegenc.o
-OBJS-$(CONFIG_MPEG1VIDEO_MUXER)          += raw.o
-OBJS-$(CONFIG_MPEG2VIDEO_MUXER)          += raw.o
+OBJS-$(CONFIG_MPEG1VIDEO_MUXER)          += rawenc.o
+OBJS-$(CONFIG_MPEG2VIDEO_MUXER)          += rawenc.o
 OBJS-$(CONFIG_MPEGPS_DEMUXER)            += mpeg.o
 OBJS-$(CONFIG_MPEGTS_DEMUXER)            += mpegts.o
 OBJS-$(CONFIG_MPEGTS_MUXER)              += mpegtsenc.o adtsenc.o
-OBJS-$(CONFIG_MPEGVIDEO_DEMUXER)         += mpegvideodec.o raw.o
+OBJS-$(CONFIG_MPEGVIDEO_DEMUXER)         += mpegvideodec.o rawdec.o
 OBJS-$(CONFIG_MPJPEG_MUXER)              += mpjpeg.o
 OBJS-$(CONFIG_MSNWC_TCP_DEMUXER)         += msnwc_tcp.o
 OBJS-$(CONFIG_MTV_DEMUXER)               += mtv.o
@@ -161,56 +161,56 @@
 OBJS-$(CONFIG_OGG_MUXER)                 += oggenc.o \
                                             vorbiscomment.o
 OBJS-$(CONFIG_OMA_DEMUXER)               += oma.o pcm.o id3v2.o id3v1.o
-OBJS-$(CONFIG_PCM_ALAW_DEMUXER)          += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_ALAW_MUXER)            += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_F32BE_DEMUXER)         += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_F32BE_MUXER)           += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_F32LE_DEMUXER)         += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_F32LE_MUXER)           += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_F64BE_DEMUXER)         += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_F64BE_MUXER)           += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_F64LE_DEMUXER)         += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_F64LE_MUXER)           += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_MULAW_DEMUXER)         += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_MULAW_MUXER)           += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_S16BE_DEMUXER)         += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_S16BE_MUXER)           += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_S16LE_DEMUXER)         += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_S16LE_MUXER)           += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_S24BE_DEMUXER)         += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_S24BE_MUXER)           += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_S24LE_DEMUXER)         += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_S24LE_MUXER)           += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_S32BE_DEMUXER)         += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_S32BE_MUXER)           += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_S32LE_DEMUXER)         += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_S32LE_MUXER)           += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_S8_DEMUXER)            += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_S8_MUXER)              += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_U16BE_DEMUXER)         += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_U16BE_MUXER)           += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_U16LE_DEMUXER)         += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_U16LE_MUXER)           += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_U24BE_DEMUXER)         += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_U24BE_MUXER)           += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_U24LE_DEMUXER)         += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_U24LE_MUXER)           += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_U32BE_DEMUXER)         += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_U32BE_MUXER)           += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_U32LE_DEMUXER)         += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_U32LE_MUXER)           += pcmenc.o raw.o
-OBJS-$(CONFIG_PCM_U8_DEMUXER)            += pcmdec.o pcm.o raw.o
-OBJS-$(CONFIG_PCM_U8_MUXER)              += pcmenc.o raw.o
+OBJS-$(CONFIG_PCM_ALAW_DEMUXER)          += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_ALAW_MUXER)            += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_F32BE_DEMUXER)         += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_F32BE_MUXER)           += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_F32LE_DEMUXER)         += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_F32LE_MUXER)           += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_F64BE_DEMUXER)         += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_F64BE_MUXER)           += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_F64LE_DEMUXER)         += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_F64LE_MUXER)           += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_MULAW_DEMUXER)         += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_MULAW_MUXER)           += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_S16BE_DEMUXER)         += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_S16BE_MUXER)           += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_S16LE_DEMUXER)         += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_S16LE_MUXER)           += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_S24BE_DEMUXER)         += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_S24BE_MUXER)           += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_S24LE_DEMUXER)         += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_S24LE_MUXER)           += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_S32BE_DEMUXER)         += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_S32BE_MUXER)           += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_S32LE_DEMUXER)         += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_S32LE_MUXER)           += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_S8_DEMUXER)            += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_S8_MUXER)              += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_U16BE_DEMUXER)         += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_U16BE_MUXER)           += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_U16LE_DEMUXER)         += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_U16LE_MUXER)           += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_U24BE_DEMUXER)         += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_U24BE_MUXER)           += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_U24LE_DEMUXER)         += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_U24LE_MUXER)           += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_U32BE_DEMUXER)         += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_U32BE_MUXER)           += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_U32LE_DEMUXER)         += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_U32LE_MUXER)           += pcmenc.o rawenc.o
+OBJS-$(CONFIG_PCM_U8_DEMUXER)            += pcmdec.o pcm.o rawdec.o
+OBJS-$(CONFIG_PCM_U8_MUXER)              += pcmenc.o rawenc.o
 OBJS-$(CONFIG_PVA_DEMUXER)               += pva.o
 OBJS-$(CONFIG_QCP_DEMUXER)               += qcp.o
 OBJS-$(CONFIG_R3D_DEMUXER)               += r3d.o
-OBJS-$(CONFIG_RAWVIDEO_DEMUXER)          += rawvideodec.o raw.o
-OBJS-$(CONFIG_RAWVIDEO_MUXER)            += raw.o
+OBJS-$(CONFIG_RAWVIDEO_DEMUXER)          += rawvideodec.o rawdec.o
+OBJS-$(CONFIG_RAWVIDEO_MUXER)            += rawenc.o
 OBJS-$(CONFIG_RL2_DEMUXER)               += rl2.o
 OBJS-$(CONFIG_RM_DEMUXER)                += rmdec.o rm.o
 OBJS-$(CONFIG_RM_MUXER)                  += rmenc.o rm.o
 OBJS-$(CONFIG_ROQ_DEMUXER)               += idroqdec.o
-OBJS-$(CONFIG_ROQ_MUXER)                 += idroqenc.o raw.o
+OBJS-$(CONFIG_ROQ_MUXER)                 += idroqenc.o rawenc.o
 OBJS-$(CONFIG_RSO_DEMUXER)               += rsodec.o rso.o pcm.o
 OBJS-$(CONFIG_RSO_MUXER)                 += rsoenc.o rso.o
 OBJS-$(CONFIG_RPL_DEMUXER)               += rpl.o
@@ -241,7 +241,7 @@
                                             rtpdec_vp8.o  \
                                             rtpdec_xiph.o
 OBJS-$(CONFIG_SEGAFILM_DEMUXER)          += segafilm.o
-OBJS-$(CONFIG_SHORTEN_DEMUXER)           += raw.o
+OBJS-$(CONFIG_SHORTEN_DEMUXER)           += rawdec.o
 OBJS-$(CONFIG_SIFF_DEMUXER)              += siff.o
 OBJS-$(CONFIG_SMACKER_DEMUXER)           += smacker.o
 OBJS-$(CONFIG_SOL_DEMUXER)               += sol.o pcm.o
@@ -249,19 +249,19 @@
 OBJS-$(CONFIG_SOX_MUXER)                 += soxenc.o
 OBJS-$(CONFIG_SPDIF_MUXER)               += spdif.o
 OBJS-$(CONFIG_SRT_DEMUXER)               += srtdec.o
-OBJS-$(CONFIG_SRT_MUXER)                 += raw.o
+OBJS-$(CONFIG_SRT_MUXER)                 += rawenc.o
 OBJS-$(CONFIG_STR_DEMUXER)               += psxstr.o
 OBJS-$(CONFIG_SWF_DEMUXER)               += swfdec.o
 OBJS-$(CONFIG_SWF_MUXER)                 += swfenc.o
 OBJS-$(CONFIG_THP_DEMUXER)               += thp.o
 OBJS-$(CONFIG_TIERTEXSEQ_DEMUXER)        += tiertexseq.o
 OBJS-$(CONFIG_TMV_DEMUXER)               += tmv.o
-OBJS-$(CONFIG_TRUEHD_DEMUXER)            += raw.o
-OBJS-$(CONFIG_TRUEHD_MUXER)              += raw.o
+OBJS-$(CONFIG_TRUEHD_DEMUXER)            += rawdec.o
+OBJS-$(CONFIG_TRUEHD_MUXER)              += rawenc.o
 OBJS-$(CONFIG_TTA_DEMUXER)               += tta.o id3v1.o id3v2.o
 OBJS-$(CONFIG_TTY_DEMUXER)               += tty.o sauce.o
 OBJS-$(CONFIG_TXD_DEMUXER)               += txd.o
-OBJS-$(CONFIG_VC1_DEMUXER)               += raw.o
+OBJS-$(CONFIG_VC1_DEMUXER)               += rawdec.o
 OBJS-$(CONFIG_VC1T_DEMUXER)              += vc1test.o
 OBJS-$(CONFIG_VC1T_MUXER)                += vc1testenc.o
 OBJS-$(CONFIG_VMD_DEMUXER)               += sierravmd.o
--- a/aacdec.c	Mon Aug 30 22:53:16 2010 +0000
+++ b/aacdec.c	Mon Aug 30 23:16:35 2010 +0000
@@ -22,7 +22,7 @@
 
 #include "libavutil/intreadwrite.h"
 #include "avformat.h"
-#include "raw.h"
+#include "rawdec.h"
 #include "id3v2.h"
 #include "id3v1.h"
 
--- a/ac3dec.c	Mon Aug 30 22:53:16 2010 +0000
+++ b/ac3dec.c	Mon Aug 30 23:16:35 2010 +0000
@@ -22,7 +22,7 @@
 #include "libavutil/crc.h"
 #include "libavcodec/ac3_parser.h"
 #include "avformat.h"
-#include "raw.h"
+#include "rawdec.h"
 
 static int ac3_eac3_probe(AVProbeData *p, enum CodecID expected_codec_id)
 {
--- a/cavsvideodec.c	Mon Aug 30 22:53:16 2010 +0000
+++ b/cavsvideodec.c	Mon Aug 30 23:16:35 2010 +0000
@@ -20,7 +20,7 @@
  */
 
 #include "avformat.h"
-#include "raw.h"
+#include "rawdec.h"
 
 #define CAVS_SEQ_START_CODE       0x000001b0
 #define CAVS_PIC_I_START_CODE     0x000001b3
--- a/diracdec.c	Mon Aug 30 22:53:16 2010 +0000
+++ b/diracdec.c	Mon Aug 30 23:16:35 2010 +0000
@@ -21,7 +21,7 @@
 
 #include "libavutil/intreadwrite.h"
 #include "avformat.h"
-#include "raw.h"
+#include "rawdec.h"
 
 static int dirac_probe(AVProbeData *p)
 {
--- a/dnxhddec.c	Mon Aug 30 22:53:16 2010 +0000
+++ b/dnxhddec.c	Mon Aug 30 23:16:35 2010 +0000
@@ -22,7 +22,7 @@
 
 #include "libavutil/intreadwrite.h"
 #include "avformat.h"
-#include "raw.h"
+#include "rawdec.h"
 
 static int dnxhd_probe(AVProbeData *p)
 {
--- a/dtsdec.c	Mon Aug 30 22:53:16 2010 +0000
+++ b/dtsdec.c	Mon Aug 30 23:16:35 2010 +0000
@@ -21,7 +21,7 @@
 
 #include "libavcodec/bytestream.h"
 #include "avformat.h"
-#include "raw.h"
+#include "rawdec.h"
 
 #define DCA_MARKER_14B_BE 0x1FFFE800
 #define DCA_MARKER_14B_LE 0xFF1F00E8
--- a/flacdec.c	Mon Aug 30 22:53:16 2010 +0000
+++ b/flacdec.c	Mon Aug 30 23:16:35 2010 +0000
@@ -21,7 +21,7 @@
 
 #include "libavcodec/flac.h"
 #include "avformat.h"
-#include "raw.h"
+#include "rawdec.h"
 #include "id3v2.h"
 #include "oggdec.h"
 #include "vorbiscomment.h"
--- a/h261dec.c	Mon Aug 30 22:53:16 2010 +0000
+++ b/h261dec.c	Mon Aug 30 23:16:35 2010 +0000
@@ -21,7 +21,7 @@
 
 #include "libavcodec/get_bits.h"
 #include "avformat.h"
-#include "raw.h"
+#include "rawdec.h"
 
 static int h261_probe(AVProbeData *p)
 {
--- a/h263dec.c	Mon Aug 30 22:53:16 2010 +0000
+++ b/h263dec.c	Mon Aug 30 23:16:35 2010 +0000
@@ -20,7 +20,7 @@
  */
 
 #include "avformat.h"
-#include "raw.h"
+#include "rawdec.h"
 
 static int h263_probe(AVProbeData *p)
 {
--- a/h264dec.c	Mon Aug 30 22:53:16 2010 +0000
+++ b/h264dec.c	Mon Aug 30 23:16:35 2010 +0000
@@ -20,7 +20,7 @@
  */
 
 #include "avformat.h"
-#include "raw.h"
+#include "rawdec.h"
 
 static int h264_probe(AVProbeData *p)
 {
--- a/idroqenc.c	Mon Aug 30 22:53:16 2010 +0000
+++ b/idroqenc.c	Mon Aug 30 23:16:35 2010 +0000
@@ -20,7 +20,7 @@
  */
 
 #include "avformat.h"
-#include "raw.h"
+#include "rawenc.h"
 
 
 static int roq_write_header(struct AVFormatContext *s)
--- a/ingenientdec.c	Mon Aug 30 22:53:16 2010 +0000
+++ b/ingenientdec.c	Mon Aug 30 23:16:35 2010 +0000
@@ -20,7 +20,7 @@
  */
 
 #include "avformat.h"
-#include "raw.h"
+#include "rawdec.h"
 
 // http://www.artificis.hu/files/texts/ingenient.txt
 static int ingenient_read_packet(AVFormatContext *s, AVPacket *pkt)
--- a/m4vdec.c	Mon Aug 30 22:53:16 2010 +0000
+++ b/m4vdec.c	Mon Aug 30 23:16:35 2010 +0000
@@ -20,7 +20,7 @@
  */
 
 #include "avformat.h"
-#include "raw.h"
+#include "rawdec.h"
 
 #define VISUAL_OBJECT_START_CODE       0x000001b5
 #define VOP_START_CODE                 0x000001b6
--- a/mpegvideodec.c	Mon Aug 30 22:53:16 2010 +0000
+++ b/mpegvideodec.c	Mon Aug 30 23:16:35 2010 +0000
@@ -21,7 +21,7 @@
  */
 
 #include "avformat.h"
-#include "raw.h"
+#include "rawdec.h"
 
 #define SEQ_START_CODE          0x000001b3
 #define GOP_START_CODE          0x000001b8
--- a/pcmdec.c	Mon Aug 30 22:53:16 2010 +0000
+++ b/pcmdec.c	Mon Aug 30 23:16:35 2010 +0000
@@ -20,7 +20,7 @@
  */
 
 #include "avformat.h"
-#include "raw.h"
+#include "rawdec.h"
 #include "pcm.h"
 
 #define RAW_SAMPLES     1024
--- a/pcmenc.c	Mon Aug 30 22:53:16 2010 +0000
+++ b/pcmenc.c	Mon Aug 30 23:16:35 2010 +0000
@@ -20,7 +20,7 @@
  */
 
 #include "avformat.h"
-#include "raw.h"
+#include "rawenc.h"
 
 #define PCMDEF(name, long_name, ext, codec) \
 AVOutputFormat pcm_ ## name ## _muxer = {\
--- a/raw.c	Mon Aug 30 22:53:16 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,486 +0,0 @@
-/*
- * RAW muxer and demuxer
- * Copyright (c) 2001 Fabrice Bellard
- * Copyright (c) 2005 Alex Beregszaszi
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "raw.h"
-
-/* simple formats */
-
-#if CONFIG_MUXERS
-int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    put_buffer(s->pb, pkt->data, pkt->size);
-    put_flush_packet(s->pb);
-    return 0;
-}
-#endif
-
-#if CONFIG_DEMUXERS
-/* raw input */
-int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
-{
-    AVStream *st;
-    enum CodecID id;
-
-    st = av_new_stream(s, 0);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-        id = s->iformat->value;
-        if (id == CODEC_ID_RAWVIDEO) {
-            st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-        } else {
-            st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        }
-        st->codec->codec_id = id;
-
-        switch(st->codec->codec_type) {
-        case AVMEDIA_TYPE_AUDIO:
-            st->codec->sample_rate = ap->sample_rate;
-            if(ap->channels) st->codec->channels = ap->channels;
-            else             st->codec->channels = 1;
-            st->codec->bits_per_coded_sample = av_get_bits_per_sample(st->codec->codec_id);
-            assert(st->codec->bits_per_coded_sample > 0);
-            st->codec->block_align = st->codec->bits_per_coded_sample*st->codec->channels/8;
-            av_set_pts_info(st, 64, 1, st->codec->sample_rate);
-            break;
-        case AVMEDIA_TYPE_VIDEO:
-            if(ap->time_base.num)
-                av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);
-            else
-                av_set_pts_info(st, 64, 1, 25);
-            st->codec->width = ap->width;
-            st->codec->height = ap->height;
-            st->codec->pix_fmt = ap->pix_fmt;
-            if(st->codec->pix_fmt == PIX_FMT_NONE)
-                st->codec->pix_fmt= PIX_FMT_YUV420P;
-            break;
-        default:
-            return -1;
-        }
-    return 0;
-}
-
-#define RAW_PACKET_SIZE 1024
-
-int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret, size;
-
-    size = RAW_PACKET_SIZE;
-
-    if (av_new_packet(pkt, size) < 0)
-        return AVERROR(ENOMEM);
-
-    pkt->pos= url_ftell(s->pb);
-    pkt->stream_index = 0;
-    ret = get_partial_buffer(s->pb, pkt->data, size);
-    if (ret < 0) {
-        av_free_packet(pkt);
-        return ret;
-    }
-    pkt->size = ret;
-    return ret;
-}
-
-int ff_raw_audio_read_header(AVFormatContext *s,
-                             AVFormatParameters *ap)
-{
-    AVStream *st = av_new_stream(s, 0);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = s->iformat->value;
-    st->need_parsing = AVSTREAM_PARSE_FULL;
-    /* the parameters will be extracted from the compressed bitstream */
-
-    return 0;
-}
-
-/* MPEG-1/H.263 input */
-int ff_raw_video_read_header(AVFormatContext *s,
-                             AVFormatParameters *ap)
-{
-    AVStream *st;
-
-    st = av_new_stream(s, 0);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = s->iformat->value;
-    st->need_parsing = AVSTREAM_PARSE_FULL;
-
-    /* for MJPEG, specify frame rate */
-    /* for MPEG-4 specify it, too (most MPEG-4 streams do not have the fixed_vop_rate set ...)*/
-    if (ap->time_base.num) {
-        st->codec->time_base= ap->time_base;
-    } else if ( st->codec->codec_id == CODEC_ID_MJPEG ||
-                st->codec->codec_id == CODEC_ID_MPEG4 ||
-                st->codec->codec_id == CODEC_ID_DIRAC ||
-                st->codec->codec_id == CODEC_ID_DNXHD ||
-                st->codec->codec_id == CODEC_ID_VC1   ||
-                st->codec->codec_id == CODEC_ID_H264) {
-        st->codec->time_base= (AVRational){1,25};
-    }
-    av_set_pts_info(st, 64, 1, 1200000);
-
-    return 0;
-}
-#endif
-
-/* Note: Do not forget to add new entries to the Makefile as well. */
-
-#if CONFIG_AC3_MUXER
-AVOutputFormat ac3_muxer = {
-    "ac3",
-    NULL_IF_CONFIG_SMALL("raw AC-3"),
-    "audio/x-ac3",
-    "ac3",
-    0,
-    CODEC_ID_AC3,
-    CODEC_ID_NONE,
-    NULL,
-    ff_raw_write_packet,
-    .flags= AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_DIRAC_MUXER
-AVOutputFormat dirac_muxer = {
-    "dirac",
-    NULL_IF_CONFIG_SMALL("raw Dirac"),
-    NULL,
-    "drc",
-    0,
-    CODEC_ID_NONE,
-    CODEC_ID_DIRAC,
-    NULL,
-    ff_raw_write_packet,
-    .flags= AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_DNXHD_MUXER
-AVOutputFormat dnxhd_muxer = {
-    "dnxhd",
-    NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
-    NULL,
-    "dnxhd",
-    0,
-    CODEC_ID_NONE,
-    CODEC_ID_DNXHD,
-    NULL,
-    ff_raw_write_packet,
-    .flags= AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_DTS_MUXER
-AVOutputFormat dts_muxer = {
-    "dts",
-    NULL_IF_CONFIG_SMALL("raw DTS"),
-    "audio/x-dca",
-    "dts",
-    0,
-    CODEC_ID_DTS,
-    CODEC_ID_NONE,
-    NULL,
-    ff_raw_write_packet,
-    .flags= AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_EAC3_MUXER
-AVOutputFormat eac3_muxer = {
-    "eac3",
-    NULL_IF_CONFIG_SMALL("raw E-AC-3"),
-    "audio/x-eac3",
-    "eac3",
-    0,
-    CODEC_ID_EAC3,
-    CODEC_ID_NONE,
-    NULL,
-    ff_raw_write_packet,
-    .flags= AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_GSM_DEMUXER
-AVInputFormat gsm_demuxer = {
-    "gsm",
-    NULL_IF_CONFIG_SMALL("raw GSM"),
-    0,
-    NULL,
-    ff_raw_audio_read_header,
-    ff_raw_read_partial_packet,
-    .flags= AVFMT_GENERIC_INDEX,
-    .extensions = "gsm",
-    .value = CODEC_ID_GSM,
-};
-#endif
-
-#if CONFIG_H261_MUXER
-AVOutputFormat h261_muxer = {
-    "h261",
-    NULL_IF_CONFIG_SMALL("raw H.261"),
-    "video/x-h261",
-    "h261",
-    0,
-    CODEC_ID_NONE,
-    CODEC_ID_H261,
-    NULL,
-    ff_raw_write_packet,
-    .flags= AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_H263_MUXER
-AVOutputFormat h263_muxer = {
-    "h263",
-    NULL_IF_CONFIG_SMALL("raw H.263"),
-    "video/x-h263",
-    "h263",
-    0,
-    CODEC_ID_NONE,
-    CODEC_ID_H263,
-    NULL,
-    ff_raw_write_packet,
-    .flags= AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_H264_MUXER
-AVOutputFormat h264_muxer = {
-    "h264",
-    NULL_IF_CONFIG_SMALL("raw H.264 video format"),
-    NULL,
-    "h264",
-    0,
-    CODEC_ID_NONE,
-    CODEC_ID_H264,
-    NULL,
-    ff_raw_write_packet,
-    .flags= AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_CAVSVIDEO_MUXER
-AVOutputFormat cavsvideo_muxer = {
-    "cavsvideo",
-    NULL_IF_CONFIG_SMALL("raw Chinese AVS video"),
-    NULL,
-    "cavs",
-    0,
-    CODEC_ID_NONE,
-    CODEC_ID_CAVS,
-    NULL,
-    ff_raw_write_packet,
-    .flags= AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_M4V_MUXER
-AVOutputFormat m4v_muxer = {
-    "m4v",
-    NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"),
-    NULL,
-    "m4v",
-    0,
-    CODEC_ID_NONE,
-    CODEC_ID_MPEG4,
-    NULL,
-    ff_raw_write_packet,
-    .flags= AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_MJPEG_DEMUXER
-AVInputFormat mjpeg_demuxer = {
-    "mjpeg",
-    NULL_IF_CONFIG_SMALL("raw MJPEG video"),
-    0,
-    NULL,
-    ff_raw_video_read_header,
-    ff_raw_read_partial_packet,
-    .flags= AVFMT_GENERIC_INDEX,
-    .extensions = "mjpg,mjpeg",
-    .value = CODEC_ID_MJPEG,
-};
-#endif
-
-#if CONFIG_MJPEG_MUXER
-AVOutputFormat mjpeg_muxer = {
-    "mjpeg",
-    NULL_IF_CONFIG_SMALL("raw MJPEG video"),
-    "video/x-mjpeg",
-    "mjpg,mjpeg",
-    0,
-    CODEC_ID_NONE,
-    CODEC_ID_MJPEG,
-    NULL,
-    ff_raw_write_packet,
-    .flags= AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_MLP_DEMUXER
-AVInputFormat mlp_demuxer = {
-    "mlp",
-    NULL_IF_CONFIG_SMALL("raw MLP"),
-    0,
-    NULL,
-    ff_raw_audio_read_header,
-    ff_raw_read_partial_packet,
-    .flags= AVFMT_GENERIC_INDEX,
-    .extensions = "mlp",
-    .value = CODEC_ID_MLP,
-};
-#endif
-
-#if CONFIG_MLP_MUXER
-AVOutputFormat mlp_muxer = {
-    "mlp",
-    NULL_IF_CONFIG_SMALL("raw MLP"),
-    NULL,
-    "mlp",
-    0,
-    CODEC_ID_MLP,
-    CODEC_ID_NONE,
-    NULL,
-    ff_raw_write_packet,
-    .flags= AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_SRT_MUXER
-AVOutputFormat srt_muxer = {
-    .name           = "srt",
-    .long_name      = NULL_IF_CONFIG_SMALL("SubRip subtitle format"),
-    .mime_type      = "application/x-subrip",
-    .extensions     = "srt",
-    .write_packet   = ff_raw_write_packet,
-    .flags          = AVFMT_NOTIMESTAMPS,
-    .subtitle_codec = CODEC_ID_SRT,
-};
-#endif
-
-#if CONFIG_TRUEHD_DEMUXER
-AVInputFormat truehd_demuxer = {
-    "truehd",
-    NULL_IF_CONFIG_SMALL("raw TrueHD"),
-    0,
-    NULL,
-    ff_raw_audio_read_header,
-    ff_raw_read_partial_packet,
-    .flags= AVFMT_GENERIC_INDEX,
-    .extensions = "thd",
-    .value = CODEC_ID_TRUEHD,
-};
-#endif
-
-#if CONFIG_TRUEHD_MUXER
-AVOutputFormat truehd_muxer = {
-    "truehd",
-    NULL_IF_CONFIG_SMALL("raw TrueHD"),
-    NULL,
-    "thd",
-    0,
-    CODEC_ID_TRUEHD,
-    CODEC_ID_NONE,
-    NULL,
-    ff_raw_write_packet,
-    .flags= AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_MPEG1VIDEO_MUXER
-AVOutputFormat mpeg1video_muxer = {
-    "mpeg1video",
-    NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
-    "video/x-mpeg",
-    "mpg,mpeg,m1v",
-    0,
-    CODEC_ID_NONE,
-    CODEC_ID_MPEG1VIDEO,
-    NULL,
-    ff_raw_write_packet,
-    .flags= AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_MPEG2VIDEO_MUXER
-AVOutputFormat mpeg2video_muxer = {
-    "mpeg2video",
-    NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
-    NULL,
-    "m2v",
-    0,
-    CODEC_ID_NONE,
-    CODEC_ID_MPEG2VIDEO,
-    NULL,
-    ff_raw_write_packet,
-    .flags= AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_RAWVIDEO_MUXER
-AVOutputFormat rawvideo_muxer = {
-    "rawvideo",
-    NULL_IF_CONFIG_SMALL("raw video format"),
-    NULL,
-    "yuv,rgb",
-    0,
-    CODEC_ID_NONE,
-    CODEC_ID_RAWVIDEO,
-    NULL,
-    ff_raw_write_packet,
-    .flags= AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_SHORTEN_DEMUXER
-AVInputFormat shorten_demuxer = {
-    "shn",
-    NULL_IF_CONFIG_SMALL("raw Shorten"),
-    0,
-    NULL,
-    ff_raw_audio_read_header,
-    ff_raw_read_partial_packet,
-    .flags= AVFMT_GENERIC_INDEX,
-    .extensions = "shn",
-    .value = CODEC_ID_SHORTEN,
-};
-#endif
-
-#if CONFIG_VC1_DEMUXER
-AVInputFormat vc1_demuxer = {
-    "vc1",
-    NULL_IF_CONFIG_SMALL("raw VC-1"),
-    0,
-    NULL /* vc1_probe */,
-    ff_raw_video_read_header,
-    ff_raw_read_partial_packet,
-    .extensions = "vc1",
-    .value = CODEC_ID_VC1,
-};
-#endif
--- a/raw.h	Mon Aug 30 22:53:16 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * RAW muxer and demuxer
- * Copyright (C) 2007  Aurelien Jacobs <aurel@gnuage.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_RAW_H
-#define AVFORMAT_RAW_H
-
-#include "avformat.h"
-
-int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt);
-
-int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap);
-
-int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt);
-
-int ff_raw_audio_read_header(AVFormatContext *s, AVFormatParameters *ap);
-
-int ff_raw_video_read_header(AVFormatContext *s, AVFormatParameters *ap);
-
-#endif /* AVFORMAT_RAW_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rawdec.c	Mon Aug 30 23:16:35 2010 +0000
@@ -0,0 +1,221 @@
+/*
+ * RAW demuxers
+ * Copyright (c) 2001 Fabrice Bellard
+ * Copyright (c) 2005 Alex Beregszaszi
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avformat.h"
+#include "rawdec.h"
+
+/* raw input */
+int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
+{
+    AVStream *st;
+    enum CodecID id;
+
+    st = av_new_stream(s, 0);
+    if (!st)
+        return AVERROR(ENOMEM);
+
+        id = s->iformat->value;
+        if (id == CODEC_ID_RAWVIDEO) {
+            st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+        } else {
+            st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+        }
+        st->codec->codec_id = id;
+
+        switch(st->codec->codec_type) {
+        case AVMEDIA_TYPE_AUDIO:
+            st->codec->sample_rate = ap->sample_rate;
+            if(ap->channels) st->codec->channels = ap->channels;
+            else             st->codec->channels = 1;
+            st->codec->bits_per_coded_sample = av_get_bits_per_sample(st->codec->codec_id);
+            assert(st->codec->bits_per_coded_sample > 0);
+            st->codec->block_align = st->codec->bits_per_coded_sample*st->codec->channels/8;
+            av_set_pts_info(st, 64, 1, st->codec->sample_rate);
+            break;
+        case AVMEDIA_TYPE_VIDEO:
+            if(ap->time_base.num)
+                av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);
+            else
+                av_set_pts_info(st, 64, 1, 25);
+            st->codec->width = ap->width;
+            st->codec->height = ap->height;
+            st->codec->pix_fmt = ap->pix_fmt;
+            if(st->codec->pix_fmt == PIX_FMT_NONE)
+                st->codec->pix_fmt= PIX_FMT_YUV420P;
+            break;
+        default:
+            return -1;
+        }
+    return 0;
+}
+
+#define RAW_PACKET_SIZE 1024
+
+int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt)
+{
+    int ret, size;
+
+    size = RAW_PACKET_SIZE;
+
+    if (av_new_packet(pkt, size) < 0)
+        return AVERROR(ENOMEM);
+
+    pkt->pos= url_ftell(s->pb);
+    pkt->stream_index = 0;
+    ret = get_partial_buffer(s->pb, pkt->data, size);
+    if (ret < 0) {
+        av_free_packet(pkt);
+        return ret;
+    }
+    pkt->size = ret;
+    return ret;
+}
+
+int ff_raw_audio_read_header(AVFormatContext *s,
+                             AVFormatParameters *ap)
+{
+    AVStream *st = av_new_stream(s, 0);
+    if (!st)
+        return AVERROR(ENOMEM);
+    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+    st->codec->codec_id = s->iformat->value;
+    st->need_parsing = AVSTREAM_PARSE_FULL;
+    /* the parameters will be extracted from the compressed bitstream */
+
+    return 0;
+}
+
+/* MPEG-1/H.263 input */
+int ff_raw_video_read_header(AVFormatContext *s,
+                             AVFormatParameters *ap)
+{
+    AVStream *st;
+
+    st = av_new_stream(s, 0);
+    if (!st)
+        return AVERROR(ENOMEM);
+
+    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
+    st->codec->codec_id = s->iformat->value;
+    st->need_parsing = AVSTREAM_PARSE_FULL;
+
+    /* for MJPEG, specify frame rate */
+    /* for MPEG-4 specify it, too (most MPEG-4 streams do not have the fixed_vop_rate set ...)*/
+    if (ap->time_base.num) {
+        st->codec->time_base= ap->time_base;
+    } else if ( st->codec->codec_id == CODEC_ID_MJPEG ||
+                st->codec->codec_id == CODEC_ID_MPEG4 ||
+                st->codec->codec_id == CODEC_ID_DIRAC ||
+                st->codec->codec_id == CODEC_ID_DNXHD ||
+                st->codec->codec_id == CODEC_ID_VC1   ||
+                st->codec->codec_id == CODEC_ID_H264) {
+        st->codec->time_base= (AVRational){1,25};
+    }
+    av_set_pts_info(st, 64, 1, 1200000);
+
+    return 0;
+}
+
+/* Note: Do not forget to add new entries to the Makefile as well. */
+
+#if CONFIG_GSM_DEMUXER
+AVInputFormat gsm_demuxer = {
+    "gsm",
+    NULL_IF_CONFIG_SMALL("raw GSM"),
+    0,
+    NULL,
+    ff_raw_audio_read_header,
+    ff_raw_read_partial_packet,
+    .flags= AVFMT_GENERIC_INDEX,
+    .extensions = "gsm",
+    .value = CODEC_ID_GSM,
+};
+#endif
+
+#if CONFIG_MJPEG_DEMUXER
+AVInputFormat mjpeg_demuxer = {
+    "mjpeg",
+    NULL_IF_CONFIG_SMALL("raw MJPEG video"),
+    0,
+    NULL,
+    ff_raw_video_read_header,
+    ff_raw_read_partial_packet,
+    .flags= AVFMT_GENERIC_INDEX,
+    .extensions = "mjpg,mjpeg",
+    .value = CODEC_ID_MJPEG,
+};
+#endif
+
+#if CONFIG_MLP_DEMUXER
+AVInputFormat mlp_demuxer = {
+    "mlp",
+    NULL_IF_CONFIG_SMALL("raw MLP"),
+    0,
+    NULL,
+    ff_raw_audio_read_header,
+    ff_raw_read_partial_packet,
+    .flags= AVFMT_GENERIC_INDEX,
+    .extensions = "mlp",
+    .value = CODEC_ID_MLP,
+};
+#endif
+
+#if CONFIG_TRUEHD_DEMUXER
+AVInputFormat truehd_demuxer = {
+    "truehd",
+    NULL_IF_CONFIG_SMALL("raw TrueHD"),
+    0,
+    NULL,
+    ff_raw_audio_read_header,
+    ff_raw_read_partial_packet,
+    .flags= AVFMT_GENERIC_INDEX,
+    .extensions = "thd",
+    .value = CODEC_ID_TRUEHD,
+};
+#endif
+
+#if CONFIG_SHORTEN_DEMUXER
+AVInputFormat shorten_demuxer = {
+    "shn",
+    NULL_IF_CONFIG_SMALL("raw Shorten"),
+    0,
+    NULL,
+    ff_raw_audio_read_header,
+    ff_raw_read_partial_packet,
+    .flags= AVFMT_GENERIC_INDEX,
+    .extensions = "shn",
+    .value = CODEC_ID_SHORTEN,
+};
+#endif
+
+#if CONFIG_VC1_DEMUXER
+AVInputFormat vc1_demuxer = {
+    "vc1",
+    NULL_IF_CONFIG_SMALL("raw VC-1"),
+    0,
+    NULL /* vc1_probe */,
+    ff_raw_video_read_header,
+    ff_raw_read_partial_packet,
+    .extensions = "vc1",
+    .value = CODEC_ID_VC1,
+};
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rawdec.h	Mon Aug 30 23:16:35 2010 +0000
@@ -0,0 +1,35 @@
+/*
+ * RAW demuxers
+ * Copyright (C) 2007  Aurelien Jacobs <aurel@gnuage.org>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVFORMAT_RAWDEC_H
+#define AVFORMAT_RAWDEC_H
+
+#include "avformat.h"
+
+int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap);
+
+int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt);
+
+int ff_raw_audio_read_header(AVFormatContext *s, AVFormatParameters *ap);
+
+int ff_raw_video_read_header(AVFormatContext *s, AVFormatParameters *ap);
+
+#endif /* AVFORMAT_RAWDEC_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rawenc.c	Mon Aug 30 23:16:35 2010 +0000
@@ -0,0 +1,285 @@
+/*
+ * RAW muxers
+ * Copyright (c) 2001 Fabrice Bellard
+ * Copyright (c) 2005 Alex Beregszaszi
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avformat.h"
+#include "rawenc.h"
+
+int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt)
+{
+    put_buffer(s->pb, pkt->data, pkt->size);
+    put_flush_packet(s->pb);
+    return 0;
+}
+
+/* Note: Do not forget to add new entries to the Makefile as well. */
+
+#if CONFIG_AC3_MUXER
+AVOutputFormat ac3_muxer = {
+    "ac3",
+    NULL_IF_CONFIG_SMALL("raw AC-3"),
+    "audio/x-ac3",
+    "ac3",
+    0,
+    CODEC_ID_AC3,
+    CODEC_ID_NONE,
+    NULL,
+    ff_raw_write_packet,
+    .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_DIRAC_MUXER
+AVOutputFormat dirac_muxer = {
+    "dirac",
+    NULL_IF_CONFIG_SMALL("raw Dirac"),
+    NULL,
+    "drc",
+    0,
+    CODEC_ID_NONE,
+    CODEC_ID_DIRAC,
+    NULL,
+    ff_raw_write_packet,
+    .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_DNXHD_MUXER
+AVOutputFormat dnxhd_muxer = {
+    "dnxhd",
+    NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
+    NULL,
+    "dnxhd",
+    0,
+    CODEC_ID_NONE,
+    CODEC_ID_DNXHD,
+    NULL,
+    ff_raw_write_packet,
+    .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_DTS_MUXER
+AVOutputFormat dts_muxer = {
+    "dts",
+    NULL_IF_CONFIG_SMALL("raw DTS"),
+    "audio/x-dca",
+    "dts",
+    0,
+    CODEC_ID_DTS,
+    CODEC_ID_NONE,
+    NULL,
+    ff_raw_write_packet,
+    .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_EAC3_MUXER
+AVOutputFormat eac3_muxer = {
+    "eac3",
+    NULL_IF_CONFIG_SMALL("raw E-AC-3"),
+    "audio/x-eac3",
+    "eac3",
+    0,
+    CODEC_ID_EAC3,
+    CODEC_ID_NONE,
+    NULL,
+    ff_raw_write_packet,
+    .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_H261_MUXER
+AVOutputFormat h261_muxer = {
+    "h261",
+    NULL_IF_CONFIG_SMALL("raw H.261"),
+    "video/x-h261",
+    "h261",
+    0,
+    CODEC_ID_NONE,
+    CODEC_ID_H261,
+    NULL,
+    ff_raw_write_packet,
+    .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_H263_MUXER
+AVOutputFormat h263_muxer = {
+    "h263",
+    NULL_IF_CONFIG_SMALL("raw H.263"),
+    "video/x-h263",
+    "h263",
+    0,
+    CODEC_ID_NONE,
+    CODEC_ID_H263,
+    NULL,
+    ff_raw_write_packet,
+    .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_H264_MUXER
+AVOutputFormat h264_muxer = {
+    "h264",
+    NULL_IF_CONFIG_SMALL("raw H.264 video format"),
+    NULL,
+    "h264",
+    0,
+    CODEC_ID_NONE,
+    CODEC_ID_H264,
+    NULL,
+    ff_raw_write_packet,
+    .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_CAVSVIDEO_MUXER
+AVOutputFormat cavsvideo_muxer = {
+    "cavsvideo",
+    NULL_IF_CONFIG_SMALL("raw Chinese AVS video"),
+    NULL,
+    "cavs",
+    0,
+    CODEC_ID_NONE,
+    CODEC_ID_CAVS,
+    NULL,
+    ff_raw_write_packet,
+    .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_M4V_MUXER
+AVOutputFormat m4v_muxer = {
+    "m4v",
+    NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"),
+    NULL,
+    "m4v",
+    0,
+    CODEC_ID_NONE,
+    CODEC_ID_MPEG4,
+    NULL,
+    ff_raw_write_packet,
+    .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_MJPEG_MUXER
+AVOutputFormat mjpeg_muxer = {
+    "mjpeg",
+    NULL_IF_CONFIG_SMALL("raw MJPEG video"),
+    "video/x-mjpeg",
+    "mjpg,mjpeg",
+    0,
+    CODEC_ID_NONE,
+    CODEC_ID_MJPEG,
+    NULL,
+    ff_raw_write_packet,
+    .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_MLP_MUXER
+AVOutputFormat mlp_muxer = {
+    "mlp",
+    NULL_IF_CONFIG_SMALL("raw MLP"),
+    NULL,
+    "mlp",
+    0,
+    CODEC_ID_MLP,
+    CODEC_ID_NONE,
+    NULL,
+    ff_raw_write_packet,
+    .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_SRT_MUXER
+AVOutputFormat srt_muxer = {
+    .name           = "srt",
+    .long_name      = NULL_IF_CONFIG_SMALL("SubRip subtitle format"),
+    .mime_type      = "application/x-subrip",
+    .extensions     = "srt",
+    .write_packet   = ff_raw_write_packet,
+    .flags          = AVFMT_NOTIMESTAMPS,
+    .subtitle_codec = CODEC_ID_SRT,
+};
+#endif
+
+#if CONFIG_TRUEHD_MUXER
+AVOutputFormat truehd_muxer = {
+    "truehd",
+    NULL_IF_CONFIG_SMALL("raw TrueHD"),
+    NULL,
+    "thd",
+    0,
+    CODEC_ID_TRUEHD,
+    CODEC_ID_NONE,
+    NULL,
+    ff_raw_write_packet,
+    .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_MPEG1VIDEO_MUXER
+AVOutputFormat mpeg1video_muxer = {
+    "mpeg1video",
+    NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
+    "video/x-mpeg",
+    "mpg,mpeg,m1v",
+    0,
+    CODEC_ID_NONE,
+    CODEC_ID_MPEG1VIDEO,
+    NULL,
+    ff_raw_write_packet,
+    .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_MPEG2VIDEO_MUXER
+AVOutputFormat mpeg2video_muxer = {
+    "mpeg2video",
+    NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
+    NULL,
+    "m2v",
+    0,
+    CODEC_ID_NONE,
+    CODEC_ID_MPEG2VIDEO,
+    NULL,
+    ff_raw_write_packet,
+    .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#if CONFIG_RAWVIDEO_MUXER
+AVOutputFormat rawvideo_muxer = {
+    "rawvideo",
+    NULL_IF_CONFIG_SMALL("raw video format"),
+    NULL,
+    "yuv,rgb",
+    0,
+    CODEC_ID_NONE,
+    CODEC_ID_RAWVIDEO,
+    NULL,
+    ff_raw_write_packet,
+    .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rawenc.h	Mon Aug 30 23:16:35 2010 +0000
@@ -0,0 +1,29 @@
+/*
+ * RAW muxers
+ * Copyright (C) 2007  Aurelien Jacobs <aurel@gnuage.org>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVFORMAT_RAWENC_H
+#define AVFORMAT_RAWENC_H
+
+#include "avformat.h"
+
+int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt);
+
+#endif /* AVFORMAT_RAWENC_H */
--- a/rawvideodec.c	Mon Aug 30 22:53:16 2010 +0000
+++ b/rawvideodec.c	Mon Aug 30 23:16:35 2010 +0000
@@ -20,7 +20,7 @@
  */
 
 #include "avformat.h"
-#include "raw.h"
+#include "rawdec.h"
 
 static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
 {