13
13
// limitations under the License.
14
14
//
15
15
16
- // Copyright 2015 Ansersion
17
- //
18
- // Licensed under the Apache License, Version 2.0 (the "License");
19
- // you may not use this file except in compliance with the License.
20
- // You may obtain a copy of the License at
21
- //
22
- // http://www.apache.org/licenses/LICENSE-2.0
23
- //
24
- // Unless required by applicable law or agreed to in writing, software
25
- // distributed under the License is distributed on an "AS IS" BASIS,
26
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27
- // See the License for the specific language governing permissions and
28
- // limitations under the License.
29
16
#include < iostream>
30
17
#include " rtspClient.h"
31
18
#include < stdio.h>
@@ -39,7 +26,8 @@ using std::endl;
39
26
40
27
int main (int argc, char *argv[])
41
28
{
42
- string RtspUri (" rtsp://127.0.0.1/ansersion" );
29
+ // string RtspUri("rtsp://127.0.0.1/ansersion");
30
+ string RtspUri (" rtsp://192.168.81.145/ansersion" );
43
31
RtspClient Client;
44
32
45
33
/* Set up rtsp server resource URI */
@@ -68,12 +56,12 @@ int main(int argc, char *argv[])
68
56
* refered in SDP, only receive packets of the first
69
57
* 'video' session, the same as 'audio'.*/
70
58
int packet_num = 0 ;
71
- uint8_t buf[8192 ];
59
+ uint8_t buf[65534 ];
72
60
size_t size = 0 ;
73
61
74
62
/* Write h264 video data to file "test_packet_recv.h264"
75
63
* Then it could be played by ffplay */
76
- int fd = open (" test_packet_recv.h264" , O_CREAT | O_RDWR, 0 );
64
+ int fd = open (" test_packet_recv.h264" , O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR | S_IXUSR );
77
65
if (Client.GetSPSNalu (buf, &size)) {
78
66
if (write (fd, buf, size) < 0 ) {
79
67
perror (" write" );
0 commit comments