changeset 473:e0a66a870b7f libavformat

h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
author michael
date Sun, 30 May 2004 20:37:15 +0000
parents fd31daf8df85
children 2846bb67dd8f
files raw.c
diffstat 1 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/raw.c	Sun May 30 01:04:50 2004 +0000
+++ b/raw.c	Sun May 30 20:37:15 2004 +0000
@@ -259,6 +259,21 @@
     return 0;
 }
 
+static int h261_probe(AVProbeData *p)
+{
+    int code;
+    const uint8_t *d;
+
+    if (p->buf_size < 6)
+        return 0;
+    d = p->buf;
+    code = (d[0] << 12) | (d[1] << 4) | (d[2] >> 4);
+    if (code == 0x10) {
+        return 50;
+    }
+    return 0;
+}
+
 AVInputFormat ac3_iformat = {
     "ac3",
     "raw ac3",
@@ -285,6 +300,18 @@
 };
 #endif //CONFIG_ENCODERS
 
+AVInputFormat h261_iformat = {
+    "h261",
+    "raw h261",
+    0,
+    h261_probe,
+    video_read_header,
+    raw_read_partial_packet,
+    raw_read_close,
+    .extensions = "h261",
+    .value = CODEC_ID_H261,
+};
+
 AVInputFormat h263_iformat = {
     "h263",
     "raw h263",
@@ -586,6 +613,8 @@
     av_register_input_format(&ac3_iformat);
     av_register_output_format(&ac3_oformat);
 
+    av_register_input_format(&h261_iformat);
+
     av_register_input_format(&h263_iformat);
     av_register_output_format(&h263_oformat);