Author: rizzo
Date: Thu Jul 26 00:44:25 2007
New Revision: 77249

URL: http://svn.digium.com/view/asterisk?view=rev&rev=77249
Log:
update the video support code

Modified:
    team/rizzo/astobj2/channels/chan_oss.c

Modified: team/rizzo/astobj2/channels/chan_oss.c
URL: 
http://svn.digium.com/view/asterisk/team/rizzo/astobj2/channels/chan_oss.c?view=diff&rev=77249&r1=77248&r2=77249
==============================================================================
--- team/rizzo/astobj2/channels/chan_oss.c (original)
+++ team/rizzo/astobj2/channels/chan_oss.c Thu Jul 26 00:44:25 2007
@@ -322,16 +322,10 @@
        [general](+)
                allow=h263p
 
-and this one to main/rtp.c:
-
-@@ -1509,5 +1511,6 @@
-        [31] = {1, AST_FORMAT_H261},
-        [34] = {1, AST_FORMAT_H263},
-        [97] = {1, AST_FORMAT_ILBC},
-+       [98] = {1, AST_FORMAT_H263_PLUS},
-        [99] = {1, AST_FORMAT_H264},
-        [101] = {0, AST_RTP_DTMF},
-
+ */
+/*
+ * Examples for video encoding are at
+http://www.irisa.fr/texmex/people/dufouil/ffmpegdoxy/apiexample_8c-source.html
  */
 
 /* Structures for ffmpeg processing */
@@ -368,7 +362,7 @@
 static void ffmpeg_init(struct video_desc *);
 /* Uninitialize the decoding structure */
 static void ffmpeg_uninit(struct video_desc *);
-/* Clean the bitstream in the RTP payload */
+/* Extract the bitstream from the RTP payload */
 static uint8_t *pre_process_data(uint8_t *, int *);
 /* Decode video frame once completed */
 static int decode_video(struct video_desc *);
@@ -495,9 +489,31 @@
 return (ntohs(p[0])>>3) & MAKE_MASK(6);
 }
 
-/*
- * It skips the extra header in the bitstream and constructs a valid
- * H.263+ bitstream start code (see RFC 2429).
+/*! \brief extract the bitstreem from the RTP payload.
+ * This is format dependent.
+ * For h261, the format is defined in RFC 4587
+ * and basically has a fixed 4-byte header as follows:
+ * 3 bits      SBIT    start bit, how many msbits to ignore in first byte
+ * 3 bits      EBIT    end bit, how many lsbits to ignore in last byte
+ * 1 bit       I       1 if frame only contain INTRA blocks
+ * 1 bit       V       0 if motion vector not used, 1 if may be used
+ * 4 bits      GOBN    gob number at start of packet (0 for gob header)
+ * 5 bits      MBAP    macroblock address predictor
+ * 5 bits      QUANT   quantizer value
+ * 5 bits      HMVD    horiz motion vector
+ * 5 bits      VMVD    vert. motion vector
+ *
+ * For h263, the format is defined in RFC 2429
+ * and basically has a fixed 2-byte header as follows:
+ * 5 bits      RR      reserved, shall be 0
+ * 1 bit       P       indicate a start/end condition,
+ *                     in which case the payload should be prepended
+ *                     by two zero-valued bytes.
+ * 1 bit       V       there is an additional VRC header after this header
+ * 6 bits      PLEN    length in bytes of extra picture header
+ * 3 bits      PEBIT   how many bits to be ignored in the last byte
+ *
+ * XXX the code below is not complete.
  */
 static uint8_t *pre_process_data(uint8_t *data, int *len)
 {
@@ -629,9 +645,12 @@
        }
 #endif
        /*
-       * If there is the discard flag, every packet must be discarded.
-       * When a marked packet arrive we can restart the decoding.
-       */
+        * If there is the discard flag, every packet must be discarded.
+        * When a marked packet arrive we can restart the decoding.
+        * XXX note that the RTP marker flag is sent as the LSB of the
+        * subclass. This is slightly annoying as it goes to overwrite
+        * the payload type entry.
+        */
        if(env->discard) {
                if(f->subclass & 0x01) {
                        free(env->data);


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to