Browse code

Prefix non-static RTSP functions with ff_.

Originally committed as revision 21974 to svn://svn.ffmpeg.org/ffmpeg/trunk

Ronald S. Bultje authored on 2010/02/23 09:35:50
Showing 7 changed files
... ...
@@ -2693,7 +2693,7 @@ static int rtsp_parse_request(HTTPContext *c)
2693 2693
             len = sizeof(line) - 1;
2694 2694
         memcpy(line, p, len);
2695 2695
         line[len] = '\0';
2696
-        rtsp_parse_line(header, line);
2696
+        ff_rtsp_parse_line(header, line);
2697 2697
         p = p1 + 1;
2698 2698
     }
2699 2699
 
... ...
@@ -388,7 +388,7 @@ static int parse_h264_sdp_line(AVFormatContext *s, int st_index,
388 388
         while (*p && *p == ' ') p++; // strip trailing spaces.
389 389
 
390 390
         /* loop on each attribute */
391
-        while (rtsp_next_attr_and_value
391
+        while (ff_rtsp_next_attr_and_value
392 392
                (&p, attr, sizeof(attr), value, sizeof(value))) {
393 393
             /* grab the codec extra_data from the config parameter of the fmtp line */
394 394
             sdp_parse_fmtp_config_h264(stream, h264_data, attr, value);
... ...
@@ -192,7 +192,7 @@ struct RTPDemuxContext {
192 192
 extern RTPDynamicProtocolHandler *RTPFirstDynamicPayloadHandler;
193 193
 void ff_register_dynamic_payload_handler(RTPDynamicProtocolHandler *handler);
194 194
 
195
-int rtsp_next_attr_and_value(const char **p, char *attr, int attr_size, char *value, int value_size); ///< from rtsp.c, but used by rtp dynamic protocol handlers.
195
+int ff_rtsp_next_attr_and_value(const char **p, char *attr, int attr_size, char *value, int value_size); ///< from rtsp.c, but used by rtp dynamic protocol handlers.
196 196
 
197 197
 void av_register_rtp_dynamic_payload_handlers(void);
198 198
 
... ...
@@ -141,7 +141,7 @@ static int amr_parse_sdp_line(AVFormatContext *s, int st_index,
141 141
         while (*p && *p != ' ') p++; /* eat protocol identifier */
142 142
         while (*p && *p == ' ') p++; /* strip trailing spaces */
143 143
 
144
-        while (rtsp_next_attr_and_value(&p, attr, sizeof(attr), value, sizeof(value))) {
144
+        while (ff_rtsp_next_attr_and_value(&p, attr, sizeof(attr), value, sizeof(value))) {
145 145
             if (!strcmp(attr, "octet-align"))
146 146
                 octet_align = atoi(value);
147 147
             else if (!strcmp(attr, "crc"))
... ...
@@ -250,7 +250,7 @@ static const AttrNameMap attr_names[]=
250 250
 /* parse the attribute line from the fmtp a line of an sdp resonse. This
251 251
  * is broken out as a function because it is used in rtp_h264.c, which is
252 252
  * forthcoming. */
253
-int rtsp_next_attr_and_value(const char **p, char *attr, int attr_size,
253
+int ff_rtsp_next_attr_and_value(const char **p, char *attr, int attr_size,
254 254
                              char *value, int value_size)
255 255
 {
256 256
     skip_spaces(p);
... ...
@@ -279,7 +279,7 @@ static void sdp_parse_fmtp(AVStream *st, const char *p)
279 279
     RTPPayloadData *rtp_payload_data = &rtsp_st->rtp_payload_data;
280 280
 
281 281
     /* loop on each attribute */
282
-    while (rtsp_next_attr_and_value(&p, attr, sizeof(attr),
282
+    while (ff_rtsp_next_attr_and_value(&p, attr, sizeof(attr),
283 283
                                     value, sizeof(value))) {
284 284
         /* grab the codec extra_data from the config parameter of the fmtp
285 285
          * line */
... ...
@@ -572,7 +572,7 @@ static int sdp_parse(AVFormatContext *s, const char *content)
572 572
 }
573 573
 
574 574
 /* close and free RTSP streams */
575
-void rtsp_close_streams(AVFormatContext *s)
575
+void ff_rtsp_close_streams(AVFormatContext *s)
576 576
 {
577 577
     RTSPState *rt = s->priv_data;
578 578
     int i;
... ...
@@ -819,7 +819,7 @@ static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p)
819 819
     }
820 820
 }
821 821
 
822
-void rtsp_parse_line(RTSPMessageHeader *reply, const char *buf)
822
+void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf)
823 823
 {
824 824
     const char *p;
825 825
 
... ...
@@ -881,7 +881,7 @@ static void rtsp_skip_packet(AVFormatContext *s)
881 881
     }
882 882
 }
883 883
 
884
-int rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
884
+int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
885 885
                     unsigned char **content_ptr,
886 886
                     int return_on_interleaved_data)
887 887
 {
... ...
@@ -932,7 +932,7 @@ int rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
932 932
             get_word(buf1, sizeof(buf1), &p);
933 933
             reply->status_code = atoi(buf1);
934 934
         } else {
935
-            rtsp_parse_line(reply, p);
935
+            ff_rtsp_parse_line(reply, p);
936 936
             av_strlcat(rt->last_reply, p,    sizeof(rt->last_reply));
937 937
             av_strlcat(rt->last_reply, "\n", sizeof(rt->last_reply));
938 938
         }
... ...
@@ -968,7 +968,7 @@ int rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
968 968
     return 0;
969 969
 }
970 970
 
971
-void rtsp_send_cmd_with_content_async(AVFormatContext *s,
971
+void ff_rtsp_send_cmd_with_content_async(AVFormatContext *s,
972 972
                                       const char *cmd,
973 973
                                       const unsigned char *send_content,
974 974
                                       int send_content_length)
... ...
@@ -1000,30 +1000,30 @@ void rtsp_send_cmd_with_content_async(AVFormatContext *s,
1000 1000
     rt->last_cmd_time = av_gettime();
1001 1001
 }
1002 1002
 
1003
-void rtsp_send_cmd_async(AVFormatContext *s, const char *cmd)
1003
+void ff_rtsp_send_cmd_async(AVFormatContext *s, const char *cmd)
1004 1004
 {
1005
-    rtsp_send_cmd_with_content_async(s, cmd, NULL, 0);
1005
+    ff_rtsp_send_cmd_with_content_async(s, cmd, NULL, 0);
1006 1006
 }
1007 1007
 
1008
-void rtsp_send_cmd(AVFormatContext *s,
1008
+void ff_rtsp_send_cmd(AVFormatContext *s,
1009 1009
                    const char *cmd, RTSPMessageHeader *reply,
1010 1010
                    unsigned char **content_ptr)
1011 1011
 {
1012
-    rtsp_send_cmd_async(s, cmd);
1012
+    ff_rtsp_send_cmd_async(s, cmd);
1013 1013
 
1014
-    rtsp_read_reply(s, reply, content_ptr, 0);
1014
+    ff_rtsp_read_reply(s, reply, content_ptr, 0);
1015 1015
 }
1016 1016
 
1017
-void rtsp_send_cmd_with_content(AVFormatContext *s,
1017
+void ff_rtsp_send_cmd_with_content(AVFormatContext *s,
1018 1018
                                 const char *cmd,
1019 1019
                                 RTSPMessageHeader *reply,
1020 1020
                                 unsigned char **content_ptr,
1021 1021
                                 const unsigned char *send_content,
1022 1022
                                 int send_content_length)
1023 1023
 {
1024
-    rtsp_send_cmd_with_content_async(s, cmd, send_content, send_content_length);
1024
+    ff_rtsp_send_cmd_with_content_async(s, cmd, send_content, send_content_length);
1025 1025
 
1026
-    rtsp_read_reply(s, reply, content_ptr, 0);
1026
+    ff_rtsp_read_reply(s, reply, content_ptr, 0);
1027 1027
 }
1028 1028
 
1029 1029
 /**
... ...
@@ -1162,7 +1162,7 @@ static int make_setup_request(AVFormatContext *s, const char *host, int port,
1162 1162
                         "RealChallenge2: %s, sd=%s\r\n",
1163 1163
                         rt->session_id, real_res, real_csum);
1164 1164
         }
1165
-        rtsp_send_cmd(s, cmd, reply, NULL);
1165
+        ff_rtsp_send_cmd(s, cmd, reply, NULL);
1166 1166
         if (reply->status_code == 461 /* Unsupported protocol */ && i == 0) {
1167 1167
             err = 1;
1168 1168
             goto fail;
... ...
@@ -1282,7 +1282,7 @@ static int rtsp_read_play(AVFormatContext *s)
1282 1282
                      rt->control_uri,
1283 1283
                      (double)rt->seek_timestamp / AV_TIME_BASE);
1284 1284
         }
1285
-        rtsp_send_cmd(s, cmd, reply, NULL);
1285
+        ff_rtsp_send_cmd(s, cmd, reply, NULL);
1286 1286
         if (reply->status_code != RTSP_STATUS_OK) {
1287 1287
             return -1;
1288 1288
         }
... ...
@@ -1313,7 +1313,7 @@ static int rtsp_setup_input_streams(AVFormatContext *s)
1313 1313
                    "Require: com.real.retain-entity-for-setup\r\n",
1314 1314
                    sizeof(cmd));
1315 1315
     }
1316
-    rtsp_send_cmd(s, cmd, reply, &content);
1316
+    ff_rtsp_send_cmd(s, cmd, reply, &content);
1317 1317
     if (!content)
1318 1318
         return AVERROR_INVALIDDATA;
1319 1319
     if (reply->status_code != RTSP_STATUS_OK) {
... ...
@@ -1351,7 +1351,7 @@ static int rtsp_setup_output_streams(AVFormatContext *s)
1351 1351
         return AVERROR_INVALIDDATA;
1352 1352
     }
1353 1353
     av_log(s, AV_LOG_INFO, "SDP:\n%s\n", sdp);
1354
-    rtsp_send_cmd_with_content(s, cmd, reply, NULL, sdp, strlen(sdp));
1354
+    ff_rtsp_send_cmd_with_content(s, cmd, reply, NULL, sdp, strlen(sdp));
1355 1355
     av_free(sdp);
1356 1356
     if (reply->status_code != RTSP_STATUS_OK)
1357 1357
         return AVERROR_INVALIDDATA;
... ...
@@ -1378,7 +1378,7 @@ static int rtsp_setup_output_streams(AVFormatContext *s)
1378 1378
     return 0;
1379 1379
 }
1380 1380
 
1381
-int rtsp_connect(AVFormatContext *s)
1381
+int ff_rtsp_connect(AVFormatContext *s)
1382 1382
 {
1383 1383
     RTSPState *rt = s->priv_data;
1384 1384
     char host[1024], path[1024], tcpname[1024], cmd[2048], auth[128];
... ...
@@ -1478,7 +1478,7 @@ redirect:
1478 1478
                        "CompanyID: KnKV4M4I/B2FjJ1TToLycw==\r\n"
1479 1479
                        "GUID: 00000000-0000-0000-0000-000000000000\r\n",
1480 1480
                        sizeof(cmd));
1481
-        rtsp_send_cmd(s, cmd, reply, NULL);
1481
+        ff_rtsp_send_cmd(s, cmd, reply, NULL);
1482 1482
         if (reply->status_code != RTSP_STATUS_OK) {
1483 1483
             err = AVERROR_INVALIDDATA;
1484 1484
             goto fail;
... ...
@@ -1522,7 +1522,7 @@ redirect:
1522 1522
     rt->seek_timestamp = 0; /* default is to start stream at position zero */
1523 1523
     return 0;
1524 1524
  fail:
1525
-    rtsp_close_streams(s);
1525
+    ff_rtsp_close_streams(s);
1526 1526
     url_close(rt->rtsp_hd);
1527 1527
     if (reply->status_code >=300 && reply->status_code < 400 && s->iformat) {
1528 1528
         av_strlcpy(s->filename, reply->location, sizeof(s->filename));
... ...
@@ -1542,7 +1542,7 @@ static int rtsp_read_header(AVFormatContext *s,
1542 1542
     RTSPState *rt = s->priv_data;
1543 1543
     int ret;
1544 1544
 
1545
-    ret = rtsp_connect(s);
1545
+    ret = ff_rtsp_connect(s);
1546 1546
     if (ret)
1547 1547
         return ret;
1548 1548
 
... ...
@@ -1550,7 +1550,7 @@ static int rtsp_read_header(AVFormatContext *s,
1550 1550
          /* do not start immediately */
1551 1551
     } else {
1552 1552
          if (rtsp_read_play(s) < 0) {
1553
-            rtsp_close_streams(s);
1553
+            ff_rtsp_close_streams(s);
1554 1554
             url_close(rt->rtsp_hd);
1555 1555
             return AVERROR_INVALIDDATA;
1556 1556
         }
... ...
@@ -1611,7 +1611,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
1611 1611
             if (tcp_fd != -1 && FD_ISSET(tcp_fd, &rfds)) {
1612 1612
                 RTSPMessageHeader reply;
1613 1613
 
1614
-                rtsp_read_reply(s, &reply, NULL, 0);
1614
+                ff_rtsp_read_reply(s, &reply, NULL, 0);
1615 1615
                 /* XXX: parse message */
1616 1616
                 if (rt->state != RTSP_STATE_STREAMING)
1617 1617
                     return 0;
... ...
@@ -1635,7 +1635,7 @@ redo:
1635 1635
     for (;;) {
1636 1636
         RTSPMessageHeader reply;
1637 1637
 
1638
-        ret = rtsp_read_reply(s, &reply, NULL, 1);
1638
+        ret = ff_rtsp_read_reply(s, &reply, NULL, 1);
1639 1639
         if (ret == -1)
1640 1640
             return -1;
1641 1641
         if (ret == 1) /* received '$' */
... ...
@@ -1751,7 +1751,7 @@ static int rtsp_read_packet(AVFormatContext *s, AVPacket *pkt)
1751 1751
                          "SET_PARAMETER %s RTSP/1.0\r\n"
1752 1752
                          "Unsubscribe: %s\r\n",
1753 1753
                          rt->control_uri, rt->last_subscription);
1754
-                rtsp_send_cmd(s, cmd, reply, NULL);
1754
+                ff_rtsp_send_cmd(s, cmd, reply, NULL);
1755 1755
                 if (reply->status_code != RTSP_STATUS_OK)
1756 1756
                     return AVERROR_INVALIDDATA;
1757 1757
                 rt->need_subscription = 1;
... ...
@@ -1787,7 +1787,7 @@ static int rtsp_read_packet(AVFormatContext *s, AVPacket *pkt)
1787 1787
                 }
1788 1788
             }
1789 1789
             av_strlcatf(cmd, sizeof(cmd), "%s\r\n", rt->last_subscription);
1790
-            rtsp_send_cmd(s, cmd, reply, NULL);
1790
+            ff_rtsp_send_cmd(s, cmd, reply, NULL);
1791 1791
             if (reply->status_code != RTSP_STATUS_OK)
1792 1792
                 return AVERROR_INVALIDDATA;
1793 1793
             rt->need_subscription = 0;
... ...
@@ -1809,9 +1809,9 @@ static int rtsp_read_packet(AVFormatContext *s, AVPacket *pkt)
1809 1809
             snprintf(cmd, sizeof(cmd) - 1,
1810 1810
                      "GET_PARAMETER %s RTSP/1.0\r\n",
1811 1811
                      rt->control_uri);
1812
-            rtsp_send_cmd_async(s, cmd);
1812
+            ff_rtsp_send_cmd_async(s, cmd);
1813 1813
         } else {
1814
-            rtsp_send_cmd_async(s, "OPTIONS * RTSP/1.0\r\n");
1814
+            ff_rtsp_send_cmd_async(s, "OPTIONS * RTSP/1.0\r\n");
1815 1815
         }
1816 1816
     }
1817 1817
 
... ...
@@ -1833,7 +1833,7 @@ static int rtsp_read_pause(AVFormatContext *s)
1833 1833
         snprintf(cmd, sizeof(cmd),
1834 1834
                  "PAUSE %s RTSP/1.0\r\n",
1835 1835
                  rt->control_uri);
1836
-        rtsp_send_cmd(s, cmd, reply, NULL);
1836
+        ff_rtsp_send_cmd(s, cmd, reply, NULL);
1837 1837
         if (reply->status_code != RTSP_STATUS_OK) {
1838 1838
             return -1;
1839 1839
         }
... ...
@@ -1882,9 +1882,9 @@ static int rtsp_read_close(AVFormatContext *s)
1882 1882
     snprintf(cmd, sizeof(cmd),
1883 1883
              "TEARDOWN %s RTSP/1.0\r\n",
1884 1884
              s->filename);
1885
-    rtsp_send_cmd_async(s, cmd);
1885
+    ff_rtsp_send_cmd_async(s, cmd);
1886 1886
 
1887
-    rtsp_close_streams(s);
1887
+    ff_rtsp_close_streams(s);
1888 1888
     url_close(rt->rtsp_hd);
1889 1889
     return 0;
1890 1890
 }
... ...
@@ -1964,13 +1964,13 @@ static int sdp_read_header(AVFormatContext *s, AVFormatParameters *ap)
1964 1964
     }
1965 1965
     return 0;
1966 1966
 fail:
1967
-    rtsp_close_streams(s);
1967
+    ff_rtsp_close_streams(s);
1968 1968
     return err;
1969 1969
 }
1970 1970
 
1971 1971
 static int sdp_read_close(AVFormatContext *s)
1972 1972
 {
1973
-    rtsp_close_streams(s);
1973
+    ff_rtsp_close_streams(s);
1974 1974
     return 0;
1975 1975
 }
1976 1976
 
... ...
@@ -315,7 +315,7 @@ typedef struct RTSPStream {
315 315
     //@}
316 316
 } RTSPStream;
317 317
 
318
-void rtsp_parse_line(RTSPMessageHeader *reply, const char *buf);
318
+void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf);
319 319
 
320 320
 #if LIBAVFORMAT_VERSION_INT < (53 << 16)
321 321
 extern int rtsp_default_protocols;
... ...
@@ -323,9 +323,6 @@ extern int rtsp_default_protocols;
323 323
 extern int rtsp_rtp_port_min;
324 324
 extern int rtsp_rtp_port_max;
325 325
 
326
-int rtsp_pause(AVFormatContext *s);
327
-int rtsp_resume(AVFormatContext *s);
328
-
329 326
 /**
330 327
  * Send a command to the RTSP server without waiting for the reply.
331 328
  *
... ...
@@ -335,7 +332,7 @@ int rtsp_resume(AVFormatContext *s);
335 335
  * @param send_content_length the length of the send_content data, or 0 if
336 336
  *                            send_content is null
337 337
  */
338
-void rtsp_send_cmd_with_content_async(AVFormatContext *s,
338
+void ff_rtsp_send_cmd_with_content_async(AVFormatContext *s,
339 339
                                       const char *cmd,
340 340
                                       const unsigned char *send_content,
341 341
                                       int send_content_length);
... ...
@@ -344,7 +341,7 @@ void rtsp_send_cmd_with_content_async(AVFormatContext *s,
344 344
  *
345 345
  * @see rtsp_send_cmd_with_content_async
346 346
  */
347
-void rtsp_send_cmd_async(AVFormatContext *s, const char *cmd);
347
+void ff_rtsp_send_cmd_async(AVFormatContext *s, const char *cmd);
348 348
 
349 349
 /**
350 350
  * Send a command to the RTSP server and wait for the reply.
... ...
@@ -358,7 +355,7 @@ void rtsp_send_cmd_async(AVFormatContext *s, const char *cmd);
358 358
  * @param send_content_length the length of the send_content data, or 0 if
359 359
  *                            send_content is null
360 360
  */
361
-void rtsp_send_cmd_with_content(AVFormatContext *s,
361
+void ff_rtsp_send_cmd_with_content(AVFormatContext *s,
362 362
                                 const char *cmd,
363 363
                                 RTSPMessageHeader *reply,
364 364
                                 unsigned char **content_ptr,
... ...
@@ -370,7 +367,7 @@ void rtsp_send_cmd_with_content(AVFormatContext *s,
370 370
  *
371 371
  * @see rtsp_send_cmd_with_content
372 372
  */
373
-void rtsp_send_cmd(AVFormatContext *s, const char *cmd,
373
+void ff_rtsp_send_cmd(AVFormatContext *s, const char *cmd,
374 374
                    RTSPMessageHeader *reply, unsigned char **content_ptr);
375 375
 
376 376
 /**
... ...
@@ -394,7 +391,7 @@ void rtsp_send_cmd(AVFormatContext *s, const char *cmd,
394 394
  * @returns 1 if a data packets is ready to be received, -1 on error,
395 395
  *          and 0 on success.
396 396
  */
397
-int rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
397
+int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
398 398
                     unsigned char **content_ptr,
399 399
                     int return_on_interleaved_data);
400 400
 
... ...
@@ -407,13 +404,13 @@ int rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
407 407
  * @returns 0 on success, < 0 on error. Cleans up all allocations done
408 408
  *          within the function on error.
409 409
  */
410
-int rtsp_connect(AVFormatContext *s);
410
+int ff_rtsp_connect(AVFormatContext *s);
411 411
 
412 412
 /**
413 413
  * Close and free all streams within the RTSP (de)muxer
414 414
  *
415 415
  * @param s RTSP (de)muxer context
416 416
  */
417
-void rtsp_close_streams(AVFormatContext *s);
417
+void ff_rtsp_close_streams(AVFormatContext *s);
418 418
 
419 419
 #endif /* AVFORMAT_RTSP_H */
... ...
@@ -39,7 +39,7 @@ static int rtsp_write_record(AVFormatContext *s)
39 39
              "Range: npt=%0.3f-\r\n",
40 40
              s->filename,
41 41
              (double) 0);
42
-    rtsp_send_cmd(s, cmd, reply, NULL);
42
+    ff_rtsp_send_cmd(s, cmd, reply, NULL);
43 43
     if (reply->status_code != RTSP_STATUS_OK)
44 44
         return -1;
45 45
     rt->state = RTSP_STATE_STREAMING;
... ...
@@ -51,12 +51,12 @@ static int rtsp_write_header(AVFormatContext *s)
51 51
     RTSPState *rt = s->priv_data;
52 52
     int ret;
53 53
 
54
-    ret = rtsp_connect(s);
54
+    ret = ff_rtsp_connect(s);
55 55
     if (ret)
56 56
         return ret;
57 57
 
58 58
     if (rtsp_write_record(s) < 0) {
59
-        rtsp_close_streams(s);
59
+        ff_rtsp_close_streams(s);
60 60
         url_close(rt->rtsp_hd);
61 61
         return AVERROR_INVALIDDATA;
62 62
     }
... ...
@@ -83,7 +83,7 @@ static int rtsp_write_packet(AVFormatContext *s, AVPacket *pkt)
83 83
         if (FD_ISSET(tcp_fd, &rfds)) {
84 84
             RTSPMessageHeader reply;
85 85
 
86
-            if (rtsp_read_reply(s, &reply, NULL, 0) < 0)
86
+            if (ff_rtsp_read_reply(s, &reply, NULL, 0) < 0)
87 87
                 return AVERROR(EPIPE);
88 88
             /* XXX: parse message */
89 89
             if (rt->state != RTSP_STATE_STREAMING)
... ...
@@ -108,9 +108,9 @@ static int rtsp_write_close(AVFormatContext *s)
108 108
     snprintf(cmd, sizeof(cmd),
109 109
              "TEARDOWN %s RTSP/1.0\r\n",
110 110
              s->filename);
111
-    rtsp_send_cmd_async(s, cmd);
111
+    ff_rtsp_send_cmd_async(s, cmd);
112 112
 
113
-    rtsp_close_streams(s);
113
+    ff_rtsp_close_streams(s);
114 114
     url_close(rt->rtsp_hd);
115 115
     return 0;
116 116
 }