[FFmpeg-soc] [soc]: r4754 - in rtmp: rtmppkt.c rtmppkt.h rtmpproto.c

kostya subversion at mplayerhq.hu
Wed Jul 22 07:58:31 CEST 2009


Author: kostya
Date: Wed Jul 22 07:58:31 2009
New Revision: 4754

Log:
Rename rtmp_amf_*() to ff_amf_*()

Modified:
   rtmp/rtmppkt.c
   rtmp/rtmppkt.h
   rtmp/rtmpproto.c

Modified: rtmp/rtmppkt.c
==============================================================================
--- rtmp/rtmppkt.c	Wed Jul 22 07:56:50 2009	(r4753)
+++ rtmp/rtmppkt.c	Wed Jul 22 07:58:31 2009	(r4754)
@@ -28,7 +28,7 @@
 
 #include "rtmppkt.h"
 
-void rtmp_amf_write_tag(uint8_t **dst, AMFType type, const void *data)
+void ff_amf_write_tag(uint8_t **dst, AMFType type, const void *data)
 {
     if (type != AMF_OBJECT_END && type != AMF_STRING_IN_OBJECT)
         bytestream_put_byte(dst, type);
@@ -173,7 +173,7 @@ void ff_rtmp_packet_destroy(RTMPPacket *
     pkt->data_size = 0;
 }
 
-int rtmp_amf_skip_data(const uint8_t *data)
+int ff_amf_skip_data(const uint8_t *data)
 {
     const uint8_t *base = data;
 
@@ -193,7 +193,7 @@ int rtmp_amf_skip_data(const uint8_t *da
                 break;
             }
             data += size;
-            data += rtmp_amf_skip_data(data);
+            data += ff_amf_skip_data(data);
         }
         return data - base;
     case AMF_OBJECT_END:  return 1;
@@ -201,7 +201,7 @@ int rtmp_amf_skip_data(const uint8_t *da
     }
 }
 
-int rtmp_amf_find_field(const uint8_t *data, const uint8_t *name,
+int ff_amf_find_field(const uint8_t *data, const uint8_t *name,
                         uint8_t *dst, int dst_size)
 {
     int namelen = strlen(name);
@@ -230,7 +230,7 @@ int rtmp_amf_find_field(const uint8_t *d
                 return -1;
             }
         }
-        len = rtmp_amf_skip_data(data);
+        len = ff_amf_skip_data(data);
         if (len < 0)
             return -1;
         data += len;

Modified: rtmp/rtmppkt.h
==============================================================================
--- rtmp/rtmppkt.h	Wed Jul 22 07:56:50 2009	(r4753)
+++ rtmp/rtmppkt.h	Wed Jul 22 07:58:31 2009	(r4754)
@@ -157,7 +157,7 @@ int ff_rtmp_packet_write(URLContext *h, 
  * @param data input data
  * @return number of bytes used by first AMF entry
  */
-int rtmp_amf_skip_data(const uint8_t *data);
+int ff_amf_skip_data(const uint8_t *data);
 
 /**
  * Retrieves value of given AMF object field in string form.
@@ -168,7 +168,7 @@ int rtmp_amf_skip_data(const uint8_t *da
  * @param dst_size output buffer size
  * @return 0 if search and retrieval succeeded, -1 otherwise
  */
-int rtmp_amf_find_field(const uint8_t *data, const uint8_t *name,
+int ff_amf_find_field(const uint8_t *data, const uint8_t *name,
                         uint8_t *dst, int dst_size);
 
 /**
@@ -178,6 +178,6 @@ int rtmp_amf_find_field(const uint8_t *d
  * @param type tag type
  * @param data optional tag value
  */
-void rtmp_amf_write_tag(uint8_t **dst, AMFType type, const void *data);
+void ff_amf_write_tag(uint8_t **dst, AMFType type, const void *data);
 
 #endif /* AVFORMAT_RTMPPKT_H */

Modified: rtmp/rtmpproto.c
==============================================================================
--- rtmp/rtmpproto.c	Wed Jul 22 07:56:50 2009	(r4753)
+++ rtmp/rtmpproto.c	Wed Jul 22 07:58:31 2009	(r4754)
@@ -102,34 +102,34 @@ static void gen_connect(URLContext *s, R
     p = pkt.data;
 
     snprintf(tcurl, sizeof(tcurl), "%s://%s:%d/%s", proto, host, port, app);
-    rtmp_amf_write_tag(&p, AMF_STRING, "connect");
-    rtmp_amf_write_tag(&p, AMF_NUMBER, &num);
-    rtmp_amf_write_tag(&p, AMF_OBJECT, NULL);
-    rtmp_amf_write_tag(&p, AMF_STRING_IN_OBJECT, "app");
-    rtmp_amf_write_tag(&p, AMF_STRING, app);
+    ff_amf_write_tag(&p, AMF_STRING, "connect");
+    ff_amf_write_tag(&p, AMF_NUMBER, &num);
+    ff_amf_write_tag(&p, AMF_OBJECT, NULL);
+    ff_amf_write_tag(&p, AMF_STRING_IN_OBJECT, "app");
+    ff_amf_write_tag(&p, AMF_STRING, app);
 
     snprintf(ver, sizeof(ver), "%s %d,%d,%d,%d", RTMP_CLIENT_PLATFORM, RTMP_CLIENT_VER1,
              RTMP_CLIENT_VER2, RTMP_CLIENT_VER3, RTMP_CLIENT_VER4);
-    rtmp_amf_write_tag(&p, AMF_STRING_IN_OBJECT, "flashVer");
-    rtmp_amf_write_tag(&p, AMF_STRING, ver);
-    rtmp_amf_write_tag(&p, AMF_STRING_IN_OBJECT, "tcUrl");
-    rtmp_amf_write_tag(&p, AMF_STRING, tcurl);
+    ff_amf_write_tag(&p, AMF_STRING_IN_OBJECT, "flashVer");
+    ff_amf_write_tag(&p, AMF_STRING, ver);
+    ff_amf_write_tag(&p, AMF_STRING_IN_OBJECT, "tcUrl");
+    ff_amf_write_tag(&p, AMF_STRING, tcurl);
     bool = 0;
-    rtmp_amf_write_tag(&p, AMF_STRING_IN_OBJECT, "fpad");
-    rtmp_amf_write_tag(&p, AMF_NUMBER, &bool);
+    ff_amf_write_tag(&p, AMF_STRING_IN_OBJECT, "fpad");
+    ff_amf_write_tag(&p, AMF_NUMBER, &bool);
     num = 15.0;
-    rtmp_amf_write_tag(&p, AMF_STRING_IN_OBJECT, "capabilities");
-    rtmp_amf_write_tag(&p, AMF_NUMBER, &num);
+    ff_amf_write_tag(&p, AMF_STRING_IN_OBJECT, "capabilities");
+    ff_amf_write_tag(&p, AMF_NUMBER, &num);
     num = 1639.0;
-    rtmp_amf_write_tag(&p, AMF_STRING_IN_OBJECT, "audioCodecs");
-    rtmp_amf_write_tag(&p, AMF_NUMBER, &num);
+    ff_amf_write_tag(&p, AMF_STRING_IN_OBJECT, "audioCodecs");
+    ff_amf_write_tag(&p, AMF_NUMBER, &num);
     num = 252.0;
-    rtmp_amf_write_tag(&p, AMF_STRING_IN_OBJECT, "videoCodecs");
-    rtmp_amf_write_tag(&p, AMF_NUMBER, &num);
+    ff_amf_write_tag(&p, AMF_STRING_IN_OBJECT, "videoCodecs");
+    ff_amf_write_tag(&p, AMF_NUMBER, &num);
     num = 1.0;
-    rtmp_amf_write_tag(&p, AMF_STRING_IN_OBJECT, "videoFunction");
-    rtmp_amf_write_tag(&p, AMF_NUMBER, &num);
-    rtmp_amf_write_tag(&p, AMF_OBJECT_END, NULL);
+    ff_amf_write_tag(&p, AMF_STRING_IN_OBJECT, "videoFunction");
+    ff_amf_write_tag(&p, AMF_NUMBER, &num);
+    ff_amf_write_tag(&p, AMF_OBJECT_END, NULL);
 
     pkt.data_size = p - pkt.data;
 
@@ -147,9 +147,9 @@ static void gen_create_stream(URLContext
 
     num = 3.0;
     p = pkt.data;
-    rtmp_amf_write_tag(&p, AMF_STRING, "createStream");
-    rtmp_amf_write_tag(&p, AMF_NUMBER, &num);
-    rtmp_amf_write_tag(&p, AMF_NULL, NULL);
+    ff_amf_write_tag(&p, AMF_STRING, "createStream");
+    ff_amf_write_tag(&p, AMF_NUMBER, &num);
+    ff_amf_write_tag(&p, AMF_NULL, NULL);
 
     ff_rtmp_packet_write(rt->stream, &pkt, rt->chunk_size, rt->prev_pkt[1]);
     ff_rtmp_packet_destroy(&pkt);
@@ -168,12 +168,12 @@ static void gen_play(URLContext *s, RTMP
 
     num = 0.0;
     p = pkt.data;
-    rtmp_amf_write_tag(&p, AMF_STRING, "play");
-    rtmp_amf_write_tag(&p, AMF_NUMBER, &num);
-    rtmp_amf_write_tag(&p, AMF_NULL, NULL);
-    rtmp_amf_write_tag(&p, AMF_STRING, rt->playpath);
+    ff_amf_write_tag(&p, AMF_STRING, "play");
+    ff_amf_write_tag(&p, AMF_NUMBER, &num);
+    ff_amf_write_tag(&p, AMF_NULL, NULL);
+    ff_amf_write_tag(&p, AMF_STRING, rt->playpath);
     num = 0.0;
-    rtmp_amf_write_tag(&p, AMF_NUMBER, &num);
+    ff_amf_write_tag(&p, AMF_NUMBER, &num);
 
     ff_rtmp_packet_write(rt->stream, &pkt, rt->chunk_size, rt->prev_pkt[1]);
     ff_rtmp_packet_destroy(&pkt);
@@ -397,18 +397,18 @@ static int rtmp_parse_result(URLContext 
             int t;
 
             for (i = 0; i < 2; i++) {
-                t = rtmp_amf_skip_data(ptr);
+                t = ff_amf_skip_data(ptr);
                 if (t < 0)
                     return 1;
                 ptr += t;
             }
-            t = rtmp_amf_find_field(ptr, "level", tmpstr, sizeof(tmpstr));
+            t = ff_amf_find_field(ptr, "level", tmpstr, sizeof(tmpstr));
             if (!t && !strcmp(tmpstr, "error")) {
-                if (!rtmp_amf_find_field(ptr, "description", tmpstr, sizeof(tmpstr)))
+                if (!ff_amf_find_field(ptr, "description", tmpstr, sizeof(tmpstr)))
                     av_log(NULL/*s*/, AV_LOG_ERROR, "Server error: %s\n",tmpstr);
                 return -1;
             }
-            t = rtmp_amf_find_field(ptr, "code", tmpstr, sizeof(tmpstr));
+            t = ff_amf_find_field(ptr, "code", tmpstr, sizeof(tmpstr));
             if (!t && !strcmp(tmpstr, "NetStream.Play.Start")) {
                 rt->state = STATE_PLAYING;
                 return 0;


More information about the FFmpeg-soc mailing list