Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
bd556c95
Commit
bd556c95
authored
Apr 03, 2008
by
Olivier Crete
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to port part of the tests
darcs-hash:20080403231650-3e2dc-89b97d0ae63757c342e98ac68f5afa864ac0ebc2.gz
parent
b049f47b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
gst/jingle-gst-test-server.c
gst/jingle-gst-test-server.c
+15
-9
No files found.
gst/jingle-gst-test-server.c
View file @
bd556c95
...
...
@@ -80,7 +80,8 @@ handle_signal (
if
(
!
nice_address_set_from_string
(
&
addr
,
bits
[
3
]))
g_assert_not_reached
();
addr
.
port
=
atoi
(
bits
[
4
]);
nice_address_set_port
(
&
addr
,
atoi
(
bits
[
4
]));
nice_agent_add_remote_candidate
(
agent
,
1
,
1
,
NICE_CANDIDATE_TYPE_HOST
,
&
addr
,
bits
[
5
],
bits
[
6
]);
return
TRUE
;
...
...
@@ -93,7 +94,7 @@ main (gint argc, gchar *argv[])
GstElement
*
pipeline
;
NiceUDPSocketFactory
factory
;
NiceUDPSocket
sock
;
NiceAddress
addr
=
{
0
,}
;
NiceAddress
*
addr
=
nice_address_new
()
;
NiceAddress
recv_addr
;
NiceAddress
send_addr
;
guint
stream_id
=
1
;
...
...
@@ -103,23 +104,27 @@ main (gint argc, gchar *argv[])
gst_init
(
&
argc
,
&
argv
);
if
(
!
nice_address_set_from_string
(
&
addr
,
"127.0.0.1"
))
if
(
!
nice_address_set_from_string
(
addr
,
"127.0.0.1"
))
return
1
;
addr
.
port
=
1234
;
nice_address_set_port
(
addr
,
1234
)
;
nice_udp_bsd_socket_factory_init
(
&
factory
);
if
(
!
nice_udp_socket_factory_make
(
&
factory
,
&
sock
,
&
addr
))
if
(
!
nice_udp_socket_factory_make
(
&
factory
,
&
sock
,
addr
))
return
1
;
// set up agent
agent
=
nice_agent_new
(
&
factory
);
// remove
addr
.
port
=
0
;
nice_agent_add_local_address
(
agent
,
&
addr
);
nice_address_set_port
(
addr
,
0
);
nice_agent_add_local_address
(
agent
,
addr
);
nice_agent_add_stream
(
agent
,
1
);
nice_address_free
(
addr
);
addr
=
NULL
;
// accept incoming handshake
len
=
nice_udp_socket_recv
(
&
sock
,
&
recv_addr
,
1
,
buf
);
...
...
@@ -143,7 +148,7 @@ main (gint argc, gchar *argv[])
// send handshake reply
send_addr
=
recv_addr
;
send_addr
.
port
=
1235
;
nice_address_set_port
(
&
send_addr
,
1235
)
;
nice_udp_socket_send
(
&
sock
,
&
send_addr
,
1
,
buf
);
// send codec
...
...
@@ -163,7 +168,8 @@ main (gint argc, gchar *argv[])
g_assert
(
candidates
);
candidate
=
candidates
->
data
;
len
=
g_snprintf
(
buf
,
1024
,
"0 0 X1 127.0.0.1 %d %s %s"
,
candidate
->
addr
.
port
,
candidate
->
username
,
candidate
->
password
);
nice_address_get_port
(
&
candidate
->
addr
),
candidate
->
username
,
candidate
->
password
);
nice_udp_socket_send
(
&
sock
,
&
send_addr
,
len
,
buf
);
g_slist_free
(
candidates
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment