/*
- * RAW encoder and decoder
+ * RAW muxer and demuxer
* Copyright (c) 2001 Fabrice Bellard.
* Copyright (c) 2005 Alex Beregszaszi
*
return 0;
}
+#define VIDEO_OBJECT_START_CODE 0x00000100
+#define VIDEO_OBJECT_LAYER_START_CODE 0x00000120
+#define VISUAL_OBJECT_START_CODE 0x000001b5
+#define VOP_START_CODE 0x000001b6
+
+static int mpeg4video_probe(AVProbeData *probe_packet)
+{
+ uint32_t temp_buffer= -1;
+ int VO=0, VOL=0, VOP = 0, VISO = 0;
+ int i;
+
+ for(i=0; i<probe_packet->buf_size; i++){
+ temp_buffer = (temp_buffer<<8) + probe_packet->buf[i];
+ if ((temp_buffer & 0xffffff00) == 0x100) {
+ switch(temp_buffer){
+ case VOP_START_CODE: VOP++; break;
+ case VISUAL_OBJECT_START_CODE: VISO++; break;
+ }
+ switch(temp_buffer & 0xfffffff0){
+ case VIDEO_OBJECT_START_CODE: VO++; break;
+ case VIDEO_OBJECT_LAYER_START_CODE: VOL++; break;
+ }
+ }
+ }
+
+ if ( VOP >= VISO && VOP >= VOL && VO >= VOL && VOL > 0)
+ return AVPROBE_SCORE_MAX/2;
+ return 0;
+}
+
static int h263_probe(AVProbeData *p)
{
int code;
return 0;
}
+static int ac3_probe(AVProbeData *p)
+{
+ int score=0;
+
+ if(p->buf_size < 6)
+ return 0;
+
+ if((p->buf[0] == 0x0B) && (p->buf[1] == 0x77) && // sync word
+ ((p->buf[4] >> 6) != 3) && // fscod
+ ((p->buf[5] >> 3) <= 16)) { // bsid
+ score = AVPROBE_SCORE_MAX / 2 + 10;
+ }
+
+ return score;
+}
+
AVInputFormat shorten_demuxer = {
"shn",
"raw shorten",
shorten_read_header,
raw_read_partial_packet,
raw_read_close,
+ .flags= AVFMT_GENERIC_INDEX,
.extensions = "shn",
};
flac_read_header,
raw_read_partial_packet,
raw_read_close,
+ .flags= AVFMT_GENERIC_INDEX,
.extensions = "flac",
};
"ac3",
"raw ac3",
0,
- NULL,
+ ac3_probe,
ac3_read_header,
raw_read_partial_packet,
raw_read_close,
+ .flags= AVFMT_GENERIC_INDEX,
.extensions = "ac3",
};
dts_read_header,
raw_read_partial_packet,
raw_read_close,
+ .flags= AVFMT_GENERIC_INDEX,
.extensions = "dts",
};
aac_read_header,
raw_read_partial_packet,
raw_read_close,
+ .flags= AVFMT_GENERIC_INDEX,
.extensions = "aac",
};
video_read_header,
raw_read_partial_packet,
raw_read_close,
+ .flags= AVFMT_GENERIC_INDEX,
.extensions = "h261",
.value = CODEC_ID_H261,
};
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,
};
"m4v",
"raw MPEG4 video format",
0,
- NULL /*mpegvideo_probe*/,
+ mpeg4video_probe, /** probing for mpeg4 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,
};
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,
};
video_read_header,
raw_read_partial_packet,
raw_read_close,
+ .flags= AVFMT_GENERIC_INDEX,
.value = CODEC_ID_MPEG1VIDEO,
};
video_read_header,
raw_read_partial_packet,
raw_read_close,
+ .flags= AVFMT_GENERIC_INDEX,
.extensions = "mjpg,mjpeg",
.value = CODEC_ID_MJPEG,
};
video_read_header,
ingenient_read_packet,
raw_read_close,
+ .flags= AVFMT_GENERIC_INDEX,
.extensions = "cgi", // FIXME
.value = CODEC_ID_MJPEG,
};
};
#endif //CONFIG_MUXERS
+AVInputFormat vc1_demuxer = {
+ "vc1",
+ "raw vc1",
+ 0,
+ NULL /* vc1_probe */,
+ video_read_header,
+ raw_read_partial_packet,
+ raw_read_close,
+ .extensions = "vc1",
+ .value = CODEC_ID_VC1,
+};
+
/* pcm formats */
#define PCMINPUTDEF(name, long_name, ext, codec) \
raw_read_packet,\
raw_read_close,\
pcm_read_seek,\
+ .flags= AVFMT_GENERIC_INDEX,\
.extensions = ext,\
.value = codec,\
};
raw_read_header,
rawvideo_read_packet,
raw_read_close,
+ .flags= AVFMT_GENERIC_INDEX,
.extensions = "yuv,cif,qcif",
.value = CODEC_ID_RAWVIDEO,
};