return 0;
}
+static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt)
+{
+ return 0;
+}
+
static int raw_write_packet(struct AVFormatContext *s, AVPacket *pkt)
{
put_buffer(s->pb, pkt->data, pkt->size);
return ret;
}
+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;
+ }
+}
+
// http://www.artificis.hu/files/texts/ingenient.txt
static int ingenient_read_packet(AVFormatContext *s, AVPacket *pkt)
{
/* Note: Do not forget to add new entries to the Makefile as well. */
-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,
-};
-
-AVInputFormat mlp_demuxer = {
- "mlp",
- NULL_IF_CONFIG_SMALL("raw MLP"),
+AVInputFormat aac_demuxer = {
+ "aac",
+ NULL_IF_CONFIG_SMALL("ADTS AAC"),
0,
NULL,
audio_read_header,
raw_read_partial_packet,
.flags= AVFMT_GENERIC_INDEX,
- .extensions = "mlp",
- .value = CODEC_ID_MLP,
-};
-
-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,
-};
-
-#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
#ifdef CONFIG_AC3_DEMUXER
AVInputFormat ac3_demuxer = {
raw_write_packet,
.flags= AVFMT_NOTIMESTAMPS,
};
-
-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
AVInputFormat dirac_demuxer = {
.value = CODEC_ID_DTS,
};
-AVInputFormat aac_demuxer = {
- "aac",
- NULL_IF_CONFIG_SMALL("ADTS AAC"),
+#ifdef CONFIG_MUXERS
+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
+
+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 = "aac",
- .value = CODEC_ID_AAC,
+ .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,
};
+#endif //CONFIG_MUXERS
AVInputFormat gsm_demuxer = {
"gsm",
.value = CODEC_ID_GSM,
};
-#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
-
AVInputFormat h261_demuxer = {
"h261",
NULL_IF_CONFIG_SMALL("raw H.261"),
};
#endif //CONFIG_MUXERS
+AVInputFormat h264_demuxer = {
+ "h264",
+ NULL_IF_CONFIG_SMALL("raw H.264 video format"),
+ 0,
+ NULL /*mpegvideo_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,
+};
+
+#ifdef CONFIG_MUXERS
+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 //CONFIG_MUXERS
+
+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,
+};
+
AVInputFormat m4v_demuxer = {
"m4v",
NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"),
};
#endif //CONFIG_MUXERS
-AVInputFormat h264_demuxer = {
- "h264",
- NULL_IF_CONFIG_SMALL("raw H.264 video format"),
+AVInputFormat mjpeg_demuxer = {
+ "mjpeg",
+ NULL_IF_CONFIG_SMALL("MJPEG video"),
0,
- NULL /*mpegvideo_probe*/,
+ NULL,
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,
+ .extensions = "mjpg,mjpeg",
+ .value = CODEC_ID_MJPEG,
};
#ifdef CONFIG_MUXERS
-AVOutputFormat h264_muxer = {
- "h264",
- NULL_IF_CONFIG_SMALL("raw H.264 video format"),
- NULL,
- "h264",
+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
-AVInputFormat mpegvideo_demuxer = {
- "mpegvideo",
- NULL_IF_CONFIG_SMALL("MPEG video"),
+AVInputFormat mlp_demuxer = {
+ "mlp",
+ NULL_IF_CONFIG_SMALL("raw MLP"),
0,
- mpegvideo_probe,
- video_read_header,
+ NULL,
+ audio_read_header,
raw_read_partial_packet,
.flags= AVFMT_GENERIC_INDEX,
- .value = CODEC_ID_MPEG1VIDEO,
+ .extensions = "mlp",
+ .value = CODEC_ID_MLP,
};
#ifdef CONFIG_MUXERS
};
#endif //CONFIG_MUXERS
-AVInputFormat mjpeg_demuxer = {
- "mjpeg",
- NULL_IF_CONFIG_SMALL("MJPEG video"),
+AVInputFormat mpegvideo_demuxer = {
+ "mpegvideo",
+ NULL_IF_CONFIG_SMALL("MPEG video"),
0,
- NULL,
+ mpegvideo_probe,
video_read_header,
raw_read_partial_packet,
.flags= AVFMT_GENERIC_INDEX,
- .extensions = "mjpg,mjpeg",
- .value = CODEC_ID_MJPEG,
+ .value = CODEC_ID_MPEG1VIDEO,
};
-AVInputFormat ingenient_demuxer = {
- "ingenient",
- NULL_IF_CONFIG_SMALL("Ingenient MJPEG"),
+#ifdef CONFIG_MUXERS
+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,
+ null_write_packet,
+ .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE | AVFMT_NOTIMESTAMPS,
+};
+#endif //CONFIG_MUXERS
+
+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,
};
#ifdef CONFIG_MUXERS
-AVOutputFormat mjpeg_muxer = {
- "mjpeg",
- NULL_IF_CONFIG_SMALL("MJPEG video"),
- "video/x-mjpeg",
- "mjpg,mjpeg",
+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
+#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
+
+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,
+};
+
AVInputFormat vc1_demuxer = {
"vc1",
NULL_IF_CONFIG_SMALL("raw VC-1"),
#endif
-PCMDEF(s16le, "PCM signed 16 bit little-endian format",
- LE_DEF("sw"), CODEC_ID_PCM_S16LE)
-
PCMDEF(s16be, "PCM signed 16 bit big-endian format",
BE_DEF("sw"), CODEC_ID_PCM_S16BE)
-PCMDEF(u16le, "PCM unsigned 16 bit little-endian format",
- LE_DEF("uw"), CODEC_ID_PCM_U16LE)
+PCMDEF(s16le, "PCM signed 16 bit little-endian format",
+ LE_DEF("sw"), CODEC_ID_PCM_S16LE)
+
+PCMDEF(s8, "PCM signed 8 bit format",
+ "sb", CODEC_ID_PCM_S8)
PCMDEF(u16be, "PCM unsigned 16 bit big-endian format",
BE_DEF("uw"), CODEC_ID_PCM_U16BE)
-PCMDEF(s8, "PCM signed 8 bit format",
- "sb", CODEC_ID_PCM_S8)
+PCMDEF(u16le, "PCM unsigned 16 bit little-endian format",
+ LE_DEF("uw"), CODEC_ID_PCM_U16LE)
PCMDEF(u8, "PCM unsigned 8 bit format",
"ub", CODEC_ID_PCM_U8)
-PCMDEF(mulaw, "PCM mu-law format",
- "ul", CODEC_ID_PCM_MULAW)
-
PCMDEF(alaw, "PCM A-law format",
"al", CODEC_ID_PCM_ALAW)
-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;
- }
-}
-
-AVInputFormat rawvideo_demuxer = {
- "rawvideo",
- NULL_IF_CONFIG_SMALL("raw video format"),
- 0,
- NULL,
- raw_read_header,
- rawvideo_read_packet,
- .flags= AVFMT_GENERIC_INDEX,
- .extensions = "yuv,cif,qcif,rgb",
- .value = CODEC_ID_RAWVIDEO,
-};
-
-#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
-
-#ifdef CONFIG_MUXERS
-static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt)
-{
- return 0;
-}
-
-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(mulaw, "PCM mu-law format",
+ "ul", CODEC_ID_PCM_MULAW)