#include "avformat.h"
#include "raw.h"
-#ifdef CONFIG_MUXERS
/* simple formats */
+#ifdef CONFIG_FLAC_MUXER
static int flac_write_header(struct AVFormatContext *s)
{
static const uint8_t header[8] = {
return 0;
}
+static int flac_write_trailer(struct AVFormatContext *s)
+{
+ ByteIOContext *pb = s->pb;
+ uint8_t *streaminfo = s->streams[0]->codec->extradata;
+ int len = s->streams[0]->codec->extradata_size;
+ int64_t file_size;
+
+ if (streaminfo && len > 0 && !url_is_streamed(s->pb)) {
+ file_size = url_ftell(pb);
+ url_fseek(pb, 8, SEEK_SET);
+ put_buffer(pb, streaminfo, len);
+ url_fseek(pb, file_size, SEEK_SET);
+ put_flush_packet(pb);
+ }
+ return 0;
+}
+#endif
+#ifdef CONFIG_ROQ_MUXER
static int roq_write_header(struct AVFormatContext *s)
{
static const uint8_t header[] = {
return 0;
}
+#endif
+
+#ifdef CONFIG_NULL_MUXER
+static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt)
+{
+ return 0;
+}
+#endif
+#ifdef CONFIG_MUXERS
static int raw_write_packet(struct AVFormatContext *s, AVPacket *pkt)
{
put_buffer(s->pb, pkt->data, pkt->size);
put_flush_packet(s->pb);
return 0;
}
-#endif //CONFIG_MUXERS
+#endif
+#ifdef CONFIG_DEMUXERS
/* raw input */
static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
switch(st->codec->codec_type) {
case CODEC_TYPE_AUDIO:
st->codec->sample_rate = ap->sample_rate;
- st->codec->channels = ap->channels;
+ if(ap->channels) st->codec->channels = ap->channels;
+ else st->codec->channels = 1;
av_set_pts_info(st, 64, 1, st->codec->sample_rate);
break;
case CODEC_TYPE_VIDEO:
pkt->size = ret;
return ret;
}
+#endif
+
+#ifdef CONFIG_RAWVIDEO_DEMUXER
+static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
+{
+ int packet_size, ret, width, height;
+ AVStream *st = s->streams[0];
+
+ width = st->codec->width;
+ height = st->codec->height;
+
+ packet_size = avpicture_get_size(st->codec->pix_fmt, width, height);
+ if (packet_size < 0)
+ return -1;
+
+ ret= av_get_packet(s->pb, pkt, packet_size);
+ pkt->pts=
+ pkt->dts= pkt->pos / packet_size;
+
+ pkt->stream_index = 0;
+ if (ret != packet_size) {
+ return AVERROR(EIO);
+ } else {
+ return 0;
+ }
+}
+#endif
+#ifdef CONFIG_INGENIENT_DEMUXER
// http://www.artificis.hu/files/texts/ingenient.txt
static int ingenient_read_packet(AVFormatContext *s, AVPacket *pkt)
{
url_fskip(s->pb, 2);
unk1 = get_le16(s->pb);
unk2 = get_le16(s->pb);
- url_fskip(s->pb, 22); // ascii timestamp
+ url_fskip(s->pb, 22); // ASCII timestamp
av_log(NULL, AV_LOG_DEBUG, "Ingenient packet: size=%d, width=%d, height=%d, unk1=%d unk2=%d\n",
size, w, h, unk1, unk2);
pkt->size = ret;
return ret;
}
+#endif
-static int raw_read_close(AVFormatContext *s)
-{
- return 0;
-}
-
+#ifdef CONFIG_DEMUXERS
int pcm_read_seek(AVFormatContext *s,
int stream_index, int64_t timestamp, int flags)
{
AVStream *st;
- int block_align, byte_rate;
+ int block_align, byte_rate, ret;
int64_t pos;
st = s->streams[0];
/* recompute exact position */
st->cur_dts = av_rescale(pos, st->time_base.den, byte_rate * (int64_t)st->time_base.num);
- url_fseek(s->pb, pos + s->data_offset, SEEK_SET);
+ if ((ret = url_fseek(s->pb, pos + s->data_offset, SEEK_SET)) < 0)
+ return ret;
return 0;
}
return 0;
}
-/* mpeg1/h263 input */
+/* MPEG-1/H.263 input */
static int video_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
st->codec->codec_id = s->iformat->value;
st->need_parsing = AVSTREAM_PARSE_FULL;
- /* for mjpeg, specify frame rate */
- /* for mpeg4 specify it too (most mpeg4 streams do not have the fixed_vop_rate set ...)*/
+ /* 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) {
av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);
} else if ( st->codec->codec_id == CODEC_ID_MJPEG ||
return 0;
}
+#endif
+#ifdef CONFIG_MPEGVIDEO_DEMUXER
#define SEQ_START_CODE 0x000001b3
#define GOP_START_CODE 0x000001b8
#define PICTURE_START_CODE 0x00000100
return AVPROBE_SCORE_MAX/2+1; // +1 for .mpg
return 0;
}
+#endif
+#ifdef CONFIG_M4V_DEMUXER
#define VISUAL_OBJECT_START_CODE 0x000001b5
#define VOP_START_CODE 0x000001b6
return AVPROBE_SCORE_MAX/2;
return 0;
}
+#endif
+
+#ifdef CONFIG_H264_DEMUXER
+static int h264_probe(AVProbeData *p)
+{
+ uint32_t code= -1;
+ int sps=0, pps=0, idr=0, res=0, sli=0;
+ int i;
+ for(i=0; i<p->buf_size; i++){
+ code = (code<<8) + p->buf[i];
+ if ((code & 0xffffff00) == 0x100) {
+ int ref_idc= (code>>5)&3;
+ int type = code & 0x1F;
+ static const int8_t ref_zero[32]={
+ 2, 0, 0, 0, 0,-1, 1,-1,
+ -1, 1, 1, 1, 1,-1, 2, 2,
+ 2, 2, 2, 0, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2
+ };
+
+ if(code & 0x80) //forbidden bit
+ return 0;
+
+ if(ref_zero[type] == 1 && ref_idc)
+ return 0;
+ if(ref_zero[type] ==-1 && !ref_idc)
+ return 0;
+ if(ref_zero[type] == 2)
+ res++;
+
+ switch(type){
+ case 1: sli++; break;
+ case 5: idr++; break;
+ case 7:
+ if(p->buf[i+2]&0x0F)
+ return 0;
+ sps++;
+ break;
+ case 8: pps++; break;
+ }
+ }
+ }
+ if(sps && pps && (idr||sli>3) && res<(sps+pps+idr))
+ return AVPROBE_SCORE_MAX/2+1; // +1 for .mpg
+ return 0;
+}
+#endif
+
+#ifdef CONFIG_H263_DEMUXER
static int h263_probe(AVProbeData *p)
{
int code;
}
return 0;
}
+#endif
+#ifdef CONFIG_H261_DEMUXER
static int h261_probe(AVProbeData *p)
{
int code;
}
return 0;
}
+#endif
+#ifdef CONFIG_DTS_DEMUXER
#define DCA_MARKER_14B_BE 0x1FFFE800
#define DCA_MARKER_14B_LE 0xFF1F00E8
#define DCA_MARKER_RAW_BE 0x7FFE8001
bufp = buf;
state = (state << 16) | bytestream_get_be16(&bufp);
- /* Regular bitstream */
+ /* regular bitstream */
if (state == DCA_MARKER_RAW_BE || state == DCA_MARKER_RAW_LE)
return AVPROBE_SCORE_MAX/2+1;
- /* 14 bits big endian bitstream */
+ /* 14 bits big-endian bitstream */
if (state == DCA_MARKER_14B_BE)
if ((bytestream_get_be16(&bufp) & 0xFFF0) == 0x07F0)
return AVPROBE_SCORE_MAX/2+1;
- /* 14 bits little endian bitstream */
+ /* 14 bits little-endian bitstream */
if (state == DCA_MARKER_14B_LE)
if ((bytestream_get_be16(&bufp) & 0xF0FF) == 0xF007)
return AVPROBE_SCORE_MAX/2+1;
return 0;
}
+#endif
+#ifdef CONFIG_DIRAC_DEMUXER
static int dirac_probe(AVProbeData *p)
{
if (AV_RL32(p->buf) == MKTAG('B', 'B', 'C', 'D'))
else
return 0;
}
+#endif
+
+#ifdef CONFIG_DNXHD_DEMUXER
+static int dnxhd_probe(AVProbeData *p)
+{
+ static const uint8_t header[] = {0x00,0x00,0x02,0x80,0x01};
+ if (!memcmp(p->buf, header, 5))
+ return AVPROBE_SCORE_MAX;
+ else
+ return 0;
+}
+#endif
-static int ac3_probe(AVProbeData *p)
+#if defined(CONFIG_AC3_DEMUXER) || defined(CONFIG_EAC3_DEMUXER)
+static int ac3_eac3_probe(AVProbeData *p, enum CodecID expected_codec_id)
{
int max_frames, first_frames = 0, frames;
uint8_t *buf, *buf2, *end;
AC3HeaderInfo hdr;
GetBitContext gbc;
+ enum CodecID codec_id = CODEC_ID_AC3;
max_frames = 0;
buf = p->buf;
if(buf2 + hdr.frame_size > end ||
av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, buf2 + 2, hdr.frame_size - 2))
break;
+ if (hdr.bitstream_id > 10)
+ codec_id = CODEC_ID_EAC3;
buf2 += hdr.frame_size;
}
max_frames = FFMAX(max_frames, frames);
if(buf == p->buf)
first_frames = frames;
}
+ if(codec_id != expected_codec_id) return 0;
if (first_frames>=3) return AVPROBE_SCORE_MAX * 3 / 4;
else if(max_frames>=3) return AVPROBE_SCORE_MAX / 2;
else if(max_frames>=1) return 1;
else return 0;
}
+#endif
+
+#ifdef CONFIG_AC3_DEMUXER
+static int ac3_probe(AVProbeData *p)
+{
+ return ac3_eac3_probe(p, CODEC_ID_AC3);
+}
+#endif
+
+#ifdef CONFIG_EAC3_DEMUXER
+static int eac3_probe(AVProbeData *p)
+{
+ return ac3_eac3_probe(p, CODEC_ID_EAC3);
+}
+#endif
+#ifdef CONFIG_FLAC_DEMUXER
static int flac_probe(AVProbeData *p)
{
if(memcmp(p->buf, "fLaC", 4)) return 0;
else return AVPROBE_SCORE_MAX / 2;
}
+#endif
-AVInputFormat shorten_demuxer = {
- "shn",
- NULL_IF_CONFIG_SMALL("raw Shorten"),
- 0,
- NULL,
- audio_read_header,
- raw_read_partial_packet,
- raw_read_close,
- .flags= AVFMT_GENERIC_INDEX,
- .extensions = "shn",
- .value = CODEC_ID_SHORTEN,
-};
-AVInputFormat mlp_demuxer = {
- "mlp",
- NULL_IF_CONFIG_SMALL("raw MLP"),
- 0,
- NULL,
- audio_read_header,
- raw_read_partial_packet,
- raw_read_close,
- .flags= AVFMT_GENERIC_INDEX,
- .extensions = "mlp",
- .value = CODEC_ID_MLP,
-};
+/* Note: Do not forget to add new entries to the Makefile as well. */
-AVInputFormat flac_demuxer = {
- "flac",
- NULL_IF_CONFIG_SMALL("raw FLAC"),
+#ifdef CONFIG_AAC_DEMUXER
+AVInputFormat aac_demuxer = {
+ "aac",
+ NULL_IF_CONFIG_SMALL("ADTS AAC"),
0,
- flac_probe,
+ NULL,
audio_read_header,
raw_read_partial_packet,
- raw_read_close,
.flags= AVFMT_GENERIC_INDEX,
- .extensions = "flac",
- .value = CODEC_ID_FLAC,
-};
-
-#ifdef CONFIG_MUXERS
-AVOutputFormat flac_muxer = {
- "flac",
- NULL_IF_CONFIG_SMALL("raw FLAC"),
- "audio/x-flac",
- "flac",
- 0,
- CODEC_ID_FLAC,
- CODEC_ID_NONE,
- flac_write_header,
- raw_write_packet,
- .flags= AVFMT_NOTIMESTAMPS,
+ .extensions = "aac",
+ .value = CODEC_ID_AAC,
};
-#endif //CONFIG_MUXERS
+#endif
#ifdef CONFIG_AC3_DEMUXER
AVInputFormat ac3_demuxer = {
ac3_probe,
audio_read_header,
raw_read_partial_packet,
- raw_read_close,
.flags= AVFMT_GENERIC_INDEX,
.extensions = "ac3",
.value = CODEC_ID_AC3,
};
#endif
-#ifdef CONFIG_MUXERS
+#ifdef CONFIG_AC3_MUXER
AVOutputFormat ac3_muxer = {
"ac3",
NULL_IF_CONFIG_SMALL("raw AC-3"),
raw_write_packet,
.flags= AVFMT_NOTIMESTAMPS,
};
+#endif
-AVOutputFormat dts_muxer = {
- "dts",
- NULL_IF_CONFIG_SMALL("raw DTS"),
- "audio/x-dca",
- "dts",
- 0,
- CODEC_ID_DTS,
- CODEC_ID_NONE,
- NULL,
- raw_write_packet,
- .flags= AVFMT_NOTIMESTAMPS,
-};
-
-#endif //CONFIG_MUXERS
-
+#ifdef CONFIG_DIRAC_DEMUXER
AVInputFormat dirac_demuxer = {
"dirac",
NULL_IF_CONFIG_SMALL("raw Dirac"),
dirac_probe,
video_read_header,
raw_read_partial_packet,
- raw_read_close,
.flags= AVFMT_GENERIC_INDEX,
.value = CODEC_ID_DIRAC,
};
+#endif
-#ifdef CONFIG_MUXERS
+#ifdef CONFIG_DIRAC_MUXER
AVOutputFormat dirac_muxer = {
"dirac",
NULL_IF_CONFIG_SMALL("raw Dirac"),
};
#endif
+#ifdef CONFIG_DNXHD_DEMUXER
+AVInputFormat dnxhd_demuxer = {
+ "dnxhd",
+ NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
+ 0,
+ dnxhd_probe,
+ video_read_header,
+ raw_read_partial_packet,
+ .flags= AVFMT_GENERIC_INDEX,
+ .value = CODEC_ID_DNXHD,
+};
+#endif
+
+#ifdef 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,
+ raw_write_packet,
+ .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#ifdef CONFIG_DTS_DEMUXER
AVInputFormat dts_demuxer = {
"dts",
NULL_IF_CONFIG_SMALL("raw DTS"),
dts_probe,
audio_read_header,
raw_read_partial_packet,
- raw_read_close,
.flags= AVFMT_GENERIC_INDEX,
.extensions = "dts",
.value = CODEC_ID_DTS,
};
+#endif
-AVInputFormat aac_demuxer = {
- "aac",
- NULL_IF_CONFIG_SMALL("ADTS AAC"),
+#ifdef 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,
+ raw_write_packet,
+ .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#ifdef CONFIG_EAC3_DEMUXER
+AVInputFormat eac3_demuxer = {
+ "eac3",
+ NULL_IF_CONFIG_SMALL("raw E-AC-3"),
+ 0,
+ eac3_probe,
audio_read_header,
raw_read_partial_packet,
- raw_read_close,
.flags= AVFMT_GENERIC_INDEX,
- .extensions = "aac",
- .value = CODEC_ID_AAC,
+ .extensions = "eac3",
+ .value = CODEC_ID_EAC3,
+};
+#endif
+
+#ifdef 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,
+ raw_write_packet,
+ .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#ifdef CONFIG_FLAC_DEMUXER
+AVInputFormat flac_demuxer = {
+ "flac",
+ NULL_IF_CONFIG_SMALL("raw FLAC"),
+ 0,
+ flac_probe,
+ audio_read_header,
+ raw_read_partial_packet,
+ .flags= AVFMT_GENERIC_INDEX,
+ .extensions = "flac",
+ .value = CODEC_ID_FLAC,
};
+#endif
+#ifdef CONFIG_FLAC_MUXER
+AVOutputFormat flac_muxer = {
+ "flac",
+ NULL_IF_CONFIG_SMALL("raw FLAC"),
+ "audio/x-flac",
+ "flac",
+ 0,
+ CODEC_ID_FLAC,
+ CODEC_ID_NONE,
+ flac_write_header,
+ raw_write_packet,
+ flac_write_trailer,
+ .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#ifdef CONFIG_GSM_DEMUXER
AVInputFormat gsm_demuxer = {
"gsm",
NULL_IF_CONFIG_SMALL("GSM"),
NULL,
audio_read_header,
raw_read_partial_packet,
- raw_read_close,
.flags= AVFMT_GENERIC_INDEX,
.extensions = "gsm",
.value = CODEC_ID_GSM,
};
+#endif
-#ifdef CONFIG_ROQ_MUXER
-AVOutputFormat roq_muxer =
-{
- "RoQ",
- NULL_IF_CONFIG_SMALL("id RoQ format"),
- NULL,
- "roq",
- 0,
- CODEC_ID_ROQ_DPCM,
- CODEC_ID_ROQ,
- roq_write_header,
- raw_write_packet,
-};
-#endif //CONFIG_ROQ_MUXER
-
+#ifdef CONFIG_H261_DEMUXER
AVInputFormat h261_demuxer = {
"h261",
NULL_IF_CONFIG_SMALL("raw H.261"),
h261_probe,
video_read_header,
raw_read_partial_packet,
- raw_read_close,
.flags= AVFMT_GENERIC_INDEX,
.extensions = "h261",
.value = CODEC_ID_H261,
};
+#endif
-#ifdef CONFIG_MUXERS
+#ifdef CONFIG_H261_MUXER
AVOutputFormat h261_muxer = {
"h261",
NULL_IF_CONFIG_SMALL("raw H.261"),
raw_write_packet,
.flags= AVFMT_NOTIMESTAMPS,
};
-#endif //CONFIG_MUXERS
+#endif
+#ifdef CONFIG_H263_DEMUXER
AVInputFormat h263_demuxer = {
"h263",
NULL_IF_CONFIG_SMALL("raw H.263"),
h263_probe,
video_read_header,
raw_read_partial_packet,
- raw_read_close,
.flags= AVFMT_GENERIC_INDEX,
// .extensions = "h263", //FIXME remove after writing mpeg4_probe
.value = CODEC_ID_H263,
};
+#endif
-#ifdef CONFIG_MUXERS
+#ifdef CONFIG_H263_MUXER
AVOutputFormat h263_muxer = {
"h263",
NULL_IF_CONFIG_SMALL("raw H.263"),
raw_write_packet,
.flags= AVFMT_NOTIMESTAMPS,
};
-#endif //CONFIG_MUXERS
+#endif
+
+#ifdef CONFIG_H264_DEMUXER
+AVInputFormat h264_demuxer = {
+ "h264",
+ NULL_IF_CONFIG_SMALL("raw H.264 video format"),
+ 0,
+ h264_probe,
+ video_read_header,
+ raw_read_partial_packet,
+ .flags= AVFMT_GENERIC_INDEX,
+ .extensions = "h26l,h264,264", //FIXME remove after writing mpeg4_probe
+ .value = CODEC_ID_H264,
+};
+#endif
+
+#ifdef 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,
+ raw_write_packet,
+ .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#ifdef CONFIG_INGENIENT_DEMUXER
+AVInputFormat ingenient_demuxer = {
+ "ingenient",
+ NULL_IF_CONFIG_SMALL("Ingenient MJPEG"),
+ 0,
+ NULL,
+ video_read_header,
+ ingenient_read_packet,
+ .flags= AVFMT_GENERIC_INDEX,
+ .extensions = "cgi", // FIXME
+ .value = CODEC_ID_MJPEG,
+};
+#endif
+#ifdef CONFIG_M4V_DEMUXER
AVInputFormat m4v_demuxer = {
"m4v",
NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"),
0,
- mpeg4video_probe, /** probing for mpeg4 data */
+ mpeg4video_probe, /** probing for MPEG-4 data */
video_read_header,
raw_read_partial_packet,
- raw_read_close,
.flags= AVFMT_GENERIC_INDEX,
.extensions = "m4v", //FIXME remove after writing mpeg4_probe
.value = CODEC_ID_MPEG4,
};
+#endif
-#ifdef CONFIG_MUXERS
+#ifdef CONFIG_M4V_MUXER
AVOutputFormat m4v_muxer = {
"m4v",
NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"),
raw_write_packet,
.flags= AVFMT_NOTIMESTAMPS,
};
-#endif //CONFIG_MUXERS
+#endif
-AVInputFormat h264_demuxer = {
- "h264",
- NULL_IF_CONFIG_SMALL("raw H.264 video format"),
+#ifdef CONFIG_MJPEG_DEMUXER
+AVInputFormat mjpeg_demuxer = {
+ "mjpeg",
+ NULL_IF_CONFIG_SMALL("MJPEG video"),
0,
- NULL /*mpegvideo_probe*/,
+ NULL,
video_read_header,
raw_read_partial_packet,
- raw_read_close,
.flags= AVFMT_GENERIC_INDEX,
- .extensions = "h26l,h264,264", //FIXME remove after writing mpeg4_probe
- .value = CODEC_ID_H264,
+ .extensions = "mjpg,mjpeg",
+ .value = CODEC_ID_MJPEG,
};
+#endif
-#ifdef CONFIG_MUXERS
-AVOutputFormat h264_muxer = {
- "h264",
- NULL_IF_CONFIG_SMALL("raw H.264 video format"),
- NULL,
- "h264",
+#ifdef CONFIG_MJPEG_MUXER
+AVOutputFormat mjpeg_muxer = {
+ "mjpeg",
+ NULL_IF_CONFIG_SMALL("MJPEG video"),
+ "video/x-mjpeg",
+ "mjpg,mjpeg",
0,
CODEC_ID_NONE,
- CODEC_ID_H264,
+ CODEC_ID_MJPEG,
NULL,
raw_write_packet,
.flags= AVFMT_NOTIMESTAMPS,
};
-#endif //CONFIG_MUXERS
+#endif
-AVInputFormat mpegvideo_demuxer = {
- "mpegvideo",
- NULL_IF_CONFIG_SMALL("MPEG video"),
+#ifdef CONFIG_MLP_DEMUXER
+AVInputFormat mlp_demuxer = {
+ "mlp",
+ NULL_IF_CONFIG_SMALL("raw MLP"),
0,
- mpegvideo_probe,
- video_read_header,
+ NULL,
+ audio_read_header,
raw_read_partial_packet,
- raw_read_close,
.flags= AVFMT_GENERIC_INDEX,
- .value = CODEC_ID_MPEG1VIDEO,
+ .extensions = "mlp",
+ .value = CODEC_ID_MLP,
};
+#endif
-#ifdef CONFIG_MUXERS
+#ifdef CONFIG_MPEG1VIDEO_MUXER
AVOutputFormat mpeg1video_muxer = {
"mpeg1video",
NULL_IF_CONFIG_SMALL("MPEG video"),
raw_write_packet,
.flags= AVFMT_NOTIMESTAMPS,
};
-#endif //CONFIG_MUXERS
+#endif
-#ifdef CONFIG_MUXERS
+#ifdef CONFIG_MPEG2VIDEO_MUXER
AVOutputFormat mpeg2video_muxer = {
"mpeg2video",
NULL_IF_CONFIG_SMALL("MPEG-2 video"),
raw_write_packet,
.flags= AVFMT_NOTIMESTAMPS,
};
-#endif //CONFIG_MUXERS
+#endif
-AVInputFormat mjpeg_demuxer = {
- "mjpeg",
- NULL_IF_CONFIG_SMALL("MJPEG video"),
+#ifdef CONFIG_MPEGVIDEO_DEMUXER
+AVInputFormat mpegvideo_demuxer = {
+ "mpegvideo",
+ NULL_IF_CONFIG_SMALL("MPEG video"),
0,
- NULL,
+ mpegvideo_probe,
video_read_header,
raw_read_partial_packet,
- raw_read_close,
.flags= AVFMT_GENERIC_INDEX,
- .extensions = "mjpg,mjpeg",
- .value = CODEC_ID_MJPEG,
+ .value = CODEC_ID_MPEG1VIDEO,
};
+#endif
-AVInputFormat ingenient_demuxer = {
- "ingenient",
- NULL_IF_CONFIG_SMALL("Ingenient MJPEG"),
+#ifdef CONFIG_NULL_MUXER
+AVOutputFormat null_muxer = {
+ "null",
+ NULL_IF_CONFIG_SMALL("null video format"),
+ NULL,
+ NULL,
0,
+#ifdef WORDS_BIGENDIAN
+ CODEC_ID_PCM_S16BE,
+#else
+ CODEC_ID_PCM_S16LE,
+#endif
+ CODEC_ID_RAWVIDEO,
NULL,
- video_read_header,
- ingenient_read_packet,
- raw_read_close,
+ null_write_packet,
+ .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE | AVFMT_NOTIMESTAMPS,
+};
+#endif
+
+#ifdef CONFIG_RAWVIDEO_DEMUXER
+AVInputFormat rawvideo_demuxer = {
+ "rawvideo",
+ NULL_IF_CONFIG_SMALL("raw video format"),
+ 0,
+ NULL,
+ raw_read_header,
+ rawvideo_read_packet,
.flags= AVFMT_GENERIC_INDEX,
- .extensions = "cgi", // FIXME
- .value = CODEC_ID_MJPEG,
+ .extensions = "yuv,cif,qcif,rgb",
+ .value = CODEC_ID_RAWVIDEO,
};
+#endif
-#ifdef CONFIG_MUXERS
-AVOutputFormat mjpeg_muxer = {
- "mjpeg",
- NULL_IF_CONFIG_SMALL("MJPEG video"),
- "video/x-mjpeg",
- "mjpg,mjpeg",
+#ifdef CONFIG_RAWVIDEO_MUXER
+AVOutputFormat rawvideo_muxer = {
+ "rawvideo",
+ NULL_IF_CONFIG_SMALL("raw video format"),
+ NULL,
+ "yuv,rgb",
0,
CODEC_ID_NONE,
- CODEC_ID_MJPEG,
+ CODEC_ID_RAWVIDEO,
NULL,
raw_write_packet,
.flags= AVFMT_NOTIMESTAMPS,
};
-#endif //CONFIG_MUXERS
+#endif
+
+#ifdef CONFIG_ROQ_MUXER
+AVOutputFormat roq_muxer =
+{
+ "RoQ",
+ NULL_IF_CONFIG_SMALL("id RoQ format"),
+ NULL,
+ "roq",
+ 0,
+ CODEC_ID_ROQ_DPCM,
+ CODEC_ID_ROQ,
+ roq_write_header,
+ raw_write_packet,
+};
+#endif
+
+#ifdef CONFIG_SHORTEN_DEMUXER
+AVInputFormat shorten_demuxer = {
+ "shn",
+ NULL_IF_CONFIG_SMALL("raw Shorten"),
+ 0,
+ NULL,
+ audio_read_header,
+ raw_read_partial_packet,
+ .flags= AVFMT_GENERIC_INDEX,
+ .extensions = "shn",
+ .value = CODEC_ID_SHORTEN,
+};
+#endif
+#ifdef CONFIG_VC1_DEMUXER
AVInputFormat vc1_demuxer = {
"vc1",
NULL_IF_CONFIG_SMALL("raw VC-1"),
NULL /* vc1_probe */,
video_read_header,
raw_read_partial_packet,
- raw_read_close,
.extensions = "vc1",
.value = CODEC_ID_VC1,
};
+#endif
-/* pcm formats */
+/* PCM formats */
#define PCMINPUTDEF(name, long_name, ext, codec) \
AVInputFormat pcm_ ## name ## _demuxer = {\
NULL,\
raw_read_header,\
raw_read_packet,\
- raw_read_close,\
+ NULL,\
pcm_read_seek,\
.flags= AVFMT_GENERIC_INDEX,\
.extensions = ext,\
#define LE_DEF(s) s
#endif
+PCMDEF(f64be, "PCM 64 bit floating-point big-endian format",
+ NULL, CODEC_ID_PCM_F64BE)
-PCMDEF(s16le, "pcm signed 16 bit little endian format",
- LE_DEF("sw"), CODEC_ID_PCM_S16LE)
+PCMDEF(f64le, "PCM 64 bit floating-point little-endian format",
+ NULL, CODEC_ID_PCM_F64LE)
-PCMDEF(s16be, "pcm signed 16 bit big endian format",
- BE_DEF("sw"), CODEC_ID_PCM_S16BE)
+PCMDEF(f32be, "PCM 32 bit floating-point big-endian format",
+ NULL, CODEC_ID_PCM_F32BE)
-PCMDEF(u16le, "pcm unsigned 16 bit little endian format",
- LE_DEF("uw"), CODEC_ID_PCM_U16LE)
+PCMDEF(f32le, "PCM 32 bit floating-point little-endian format",
+ NULL, CODEC_ID_PCM_F32LE)
-PCMDEF(u16be, "pcm unsigned 16 bit big endian format",
- BE_DEF("uw"), CODEC_ID_PCM_U16BE)
+PCMDEF(s32be, "PCM signed 32 bit big-endian format",
+ NULL, CODEC_ID_PCM_S32BE)
-PCMDEF(s8, "pcm signed 8 bit format",
- "sb", CODEC_ID_PCM_S8)
+PCMDEF(s32le, "PCM signed 32 bit little-endian format",
+ NULL, CODEC_ID_PCM_S32LE)
-PCMDEF(u8, "pcm unsigned 8 bit format",
- "ub", CODEC_ID_PCM_U8)
+PCMDEF(s24be, "PCM signed 24 bit big-endian format",
+ NULL, CODEC_ID_PCM_S24BE)
-PCMDEF(mulaw, "pcm mu law format",
- "ul", CODEC_ID_PCM_MULAW)
+PCMDEF(s24le, "PCM signed 24 bit little-endian format",
+ NULL, CODEC_ID_PCM_S24LE)
-PCMDEF(alaw, "pcm A law format",
- "al", CODEC_ID_PCM_ALAW)
+PCMDEF(s16be, "PCM signed 16 bit big-endian format",
+ BE_DEF("sw"), CODEC_ID_PCM_S16BE)
-static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
- int packet_size, ret, width, height;
- AVStream *st = s->streams[0];
+PCMDEF(s16le, "PCM signed 16 bit little-endian format",
+ LE_DEF("sw"), CODEC_ID_PCM_S16LE)
- width = st->codec->width;
- height = st->codec->height;
+PCMDEF(s8, "PCM signed 8 bit format",
+ "sb", CODEC_ID_PCM_S8)
- packet_size = avpicture_get_size(st->codec->pix_fmt, width, height);
- if (packet_size < 0)
- return -1;
+PCMDEF(u32be, "PCM unsigned 32 bit big-endian format",
+ NULL, CODEC_ID_PCM_U32BE)
- ret= av_get_packet(s->pb, pkt, packet_size);
- pkt->pts=
- pkt->dts= pkt->pos / packet_size;
+PCMDEF(u32le, "PCM unsigned 32 bit little-endian format",
+ NULL, CODEC_ID_PCM_U32LE)
- pkt->stream_index = 0;
- if (ret != packet_size) {
- return AVERROR(EIO);
- } else {
- return 0;
- }
-}
+PCMDEF(u24be, "PCM unsigned 24 bit big-endian format",
+ NULL, CODEC_ID_PCM_U24BE)
-AVInputFormat rawvideo_demuxer = {
- "rawvideo",
- NULL_IF_CONFIG_SMALL("raw video format"),
- 0,
- NULL,
- raw_read_header,
- rawvideo_read_packet,
- raw_read_close,
- .flags= AVFMT_GENERIC_INDEX,
- .extensions = "yuv,cif,qcif,rgb",
- .value = CODEC_ID_RAWVIDEO,
-};
+PCMDEF(u24le, "PCM unsigned 24 bit little-endian format",
+ NULL, CODEC_ID_PCM_U24LE)
-#ifdef CONFIG_MUXERS
-AVOutputFormat rawvideo_muxer = {
- "rawvideo",
- NULL_IF_CONFIG_SMALL("raw video format"),
- NULL,
- "yuv,rgb",
- 0,
- CODEC_ID_NONE,
- CODEC_ID_RAWVIDEO,
- NULL,
- raw_write_packet,
- .flags= AVFMT_NOTIMESTAMPS,
-};
-#endif //CONFIG_MUXERS
+PCMDEF(u16be, "PCM unsigned 16 bit big-endian format",
+ BE_DEF("uw"), CODEC_ID_PCM_U16BE)
-#ifdef CONFIG_MUXERS
-static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt)
-{
- return 0;
-}
+PCMDEF(u16le, "PCM unsigned 16 bit little-endian format",
+ LE_DEF("uw"), CODEC_ID_PCM_U16LE)
-AVOutputFormat null_muxer = {
- "null",
- NULL_IF_CONFIG_SMALL("null video format"),
- NULL,
- NULL,
- 0,
-#ifdef WORDS_BIGENDIAN
- CODEC_ID_PCM_S16BE,
-#else
- CODEC_ID_PCM_S16LE,
-#endif
- CODEC_ID_RAWVIDEO,
- NULL,
- null_write_packet,
- .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE | AVFMT_NOTIMESTAMPS,
-};
-#endif //CONFIG_MUXERS
+PCMDEF(u8, "PCM unsigned 8 bit format",
+ "ub", CODEC_ID_PCM_U8)
+
+PCMDEF(alaw, "PCM A-law format",
+ "al", CODEC_ID_PCM_ALAW)
+
+PCMDEF(mulaw, "PCM mu-law format",
+ "ul", CODEC_ID_PCM_MULAW)