* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "avformat.h"
-#include "parser.h"
+#include "ac3_parser.h"
#ifdef CONFIG_MUXERS
/* simple formats */
return 0;
}
+
+static int roq_write_header(struct AVFormatContext *s)
+{
+ static const uint8_t header[] = {
+ 0x84, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0x1E, 0x00
+ };
+
+ put_buffer(&s->pb, header, 8);
+ put_flush_packet(&s->pb);
+
+ return 0;
+}
+
static int raw_write_packet(struct AVFormatContext *s, AVPacket *pkt)
{
put_buffer(&s->pb, pkt->data, pkt->size);
st->codec->codec_type = CODEC_TYPE_AUDIO;
st->codec->codec_id = CODEC_ID_AC3;
- st->need_parsing = 1;
+ st->need_parsing = AVSTREAM_PARSE_FULL;
/* the parameters will be extracted from the compressed bitstream */
return 0;
}
return AVERROR_NOMEM;
st->codec->codec_type = CODEC_TYPE_AUDIO;
st->codec->codec_id = CODEC_ID_SHORTEN;
- st->need_parsing = 1;
+ st->need_parsing = AVSTREAM_PARSE_FULL;
/* the parameters will be extracted from the compressed bitstream */
return 0;
}
return AVERROR_NOMEM;
st->codec->codec_type = CODEC_TYPE_AUDIO;
st->codec->codec_id = CODEC_ID_FLAC;
- st->need_parsing = 1;
+ st->need_parsing = AVSTREAM_PARSE_FULL;
/* the parameters will be extracted from the compressed bitstream */
return 0;
}
st->codec->codec_type = CODEC_TYPE_AUDIO;
st->codec->codec_id = CODEC_ID_DTS;
- st->need_parsing = 1;
+ st->need_parsing = AVSTREAM_PARSE_FULL;
/* the parameters will be extracted from the compressed bitstream */
return 0;
}
st->codec->codec_type = CODEC_TYPE_AUDIO;
st->codec->codec_id = CODEC_ID_AAC;
- st->need_parsing = 1;
+ st->need_parsing = AVSTREAM_PARSE_FULL;
/* the parameters will be extracted from the compressed bitstream */
return 0;
}
st->codec->codec_type = CODEC_TYPE_VIDEO;
st->codec->codec_id = s->iformat->value;
- st->need_parsing = 1;
+ st->need_parsing = AVSTREAM_PARSE_FULL;
/* for mjpeg, specify frame rate */
/* for mpeg4 specify it too (most mpeg4 streams dont have the fixed_vop_rate set ...)*/
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 VO=0, VOL=0, VOP = 0, VISO = 0, res=0;
int i;
for(i=0; i<probe_packet->buf_size; i++){
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;
+ case 0x100 ... 0x11F: VO++; break;
+ case 0x120 ... 0x12F: VOL++; break;
+ case 0x130 ... 0x1AF:
+ case 0x1B7 ... 0x1B9:
+ case 0x1C4 ... 0x1FF: res++; break;
}
}
}
- if ( VOP >= VISO && VOP >= VOL && VO >= VOL && VOL > 0)
+ if ( VOP >= VISO && VOP >= VOL && VO >= VOL && VOL > 0 && res==0)
return AVPROBE_SCORE_MAX/2;
return 0;
}
.extensions = "aac",
};
+#ifdef CONFIG_ROQ_MUXER
+AVOutputFormat roq_muxer =
+{
+ "RoQ",
+ "Id RoQ format",
+ NULL,
+ "roq",
+ 0,
+ CODEC_ID_ROQ_DPCM,
+ CODEC_ID_ROQ,
+ roq_write_header,
+ raw_write_packet,
+ raw_write_trailer,
+};
+#endif //CONFIG_ROQ_MUXER
+
AVInputFormat h261_demuxer = {
"h261",
"raw h261",
rawvideo_read_packet,
raw_read_close,
.flags= AVFMT_GENERIC_INDEX,
- .extensions = "yuv,cif,qcif",
+ .extensions = "yuv,cif,qcif,rgb",
.value = CODEC_ID_RAWVIDEO,
};
"rawvideo",
"raw video format",
NULL,
- "yuv",
+ "yuv,rgb",
0,
CODEC_ID_NONE,
CODEC_ID_RAWVIDEO,