*/
#include "avformat.h"
+#ifdef CONFIG_ENCODERS
/* simple formats */
static int raw_write_header(struct AVFormatContext *s)
{
{
return 0;
}
+#endif //CONFIG_ENCODERS
/* raw input */
static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
.extensions = "ac3",
};
+#ifdef CONFIG_ENCODERS
AVOutputFormat ac3_oformat = {
"ac3",
"raw ac3",
raw_write_packet,
raw_write_trailer,
};
+#endif //CONFIG_ENCODERS
AVInputFormat h263_iformat = {
"h263",
.value = CODEC_ID_H263,
};
+#ifdef CONFIG_ENCODERS
AVOutputFormat h263_oformat = {
"h263",
"raw h263",
raw_write_packet,
raw_write_trailer,
};
+#endif //CONFIG_ENCODERS
AVInputFormat m4v_iformat = {
"m4v",
.value = CODEC_ID_MPEG4,
};
+#ifdef CONFIG_ENCODERS
AVOutputFormat m4v_oformat = {
"m4v",
"raw MPEG4 video format",
raw_write_packet,
raw_write_trailer,
};
+#endif //CONFIG_ENCODERS
AVInputFormat h264_iformat = {
"h264",
.value = CODEC_ID_H264,
};
+#ifdef CONFIG_ENCODERS
AVOutputFormat h264_oformat = {
"h264",
"raw H264 video format",
raw_write_packet,
raw_write_trailer,
};
+#endif //CONFIG_ENCODERS
AVInputFormat mpegvideo_iformat = {
"mpegvideo",
.value = CODEC_ID_MPEG1VIDEO,
};
+#ifdef CONFIG_ENCODERS
AVOutputFormat mpeg1video_oformat = {
"mpeg1video",
"MPEG video",
raw_write_packet,
raw_write_trailer,
};
+#endif //CONFIG_ENCODERS
AVInputFormat mjpeg_iformat = {
"mjpeg",
.value = CODEC_ID_MJPEG,
};
+#ifdef CONFIG_ENCODERS
AVOutputFormat mjpeg_oformat = {
"mjpeg",
"MJPEG video",
raw_write_packet,
raw_write_trailer,
};
+#endif //CONFIG_ENCODERS
/* pcm formats */
+#if !defined(CONFIG_ENCODERS) && defined(CONFIG_DECODERS)
+
+#define PCMDEF(name, long_name, ext, codec) \
+AVInputFormat pcm_ ## name ## _iformat = {\
+ #name,\
+ long_name,\
+ 0,\
+ NULL,\
+ raw_read_header,\
+ raw_read_packet,\
+ raw_read_close,\
+ .extensions = ext,\
+ .value = codec,\
+};
+
+#else
#define PCMDEF(name, long_name, ext, codec) \
AVInputFormat pcm_ ## name ## _iformat = {\
raw_write_packet,\
raw_write_trailer,\
};
+#endif //CONFIG_ENCODERS
#ifdef WORDS_BIGENDIAN
#define BE_DEF(s) s
.value = CODEC_ID_RAWVIDEO,
};
+#ifdef CONFIG_ENCODERS
AVOutputFormat rawvideo_oformat = {
"rawvideo",
"raw video format",
raw_write_packet,
raw_write_trailer,
};
+#endif //CONFIG_ENCODERS
+#ifdef CONFIG_ENCODERS
static int null_write_packet(struct AVFormatContext *s,
int stream_index,
const uint8_t *buf, int size, int64_t pts)
raw_write_trailer,
.flags = AVFMT_NOFILE | AVFMT_RAWPICTURE,
};
+#endif //CONFIG_ENCODERS
+
+#ifndef CONFIG_ENCODERS
+#define av_register_output_format(format)
+#endif
+#ifndef CONFIG_DECODERS
+#define av_register_input_format(format)
+#endif
int raw_init(void)
{