Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-apps-astreamer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-apps-astreamer
Commits
3b899fc7
Commit
3b899fc7
authored
Mar 15, 2017
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assign default streamer ports depending on sensor port
parent
07e65a43
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
rtsp.cpp
src/rtsp.cpp
+1
-1
streamer.cpp
src/streamer.cpp
+6
-5
No files found.
src/rtsp.cpp
View file @
3b899fc7
...
...
@@ -468,7 +468,7 @@ string RTSP_Server::make_transport(string req) {
string
first
,
second
;
String
::
split
(
client_port
,
'-'
,
first
,
second
);
port_req
=
atol
(
first
.
c_str
());
//D(cerr << "client_port == |" << client_port << "|; first == |" << first << "|; second == |"
<< "|" << endl;)
D
(
cerr
<<
"client_port == |"
<<
client_port
<<
"|; first == |"
<<
first
<<
"|; second == |"
<<
second
<<
"|"
<<
endl
;)
// session->rtp_out.port = first;
}
...
...
src/streamer.cpp
View file @
3b899fc7
...
...
@@ -363,10 +363,12 @@ int Streamer::handler(RTSP_Server *rtsp_server, RTSP_Server::event event) {
static
bool
_play
=
false
;
D
(
sensor_port
,
cerr
<<
"event: running= "
<<
running
<<
" "
);
switch
(
event
)
{
case
RTSP_Server
:
:
DESCRIBE
:
/// Update frame size, fps before starting new stream (generating SDP file)
case
RTSP_Server
:
:
DESCRIBE
:
// update frame size, fps before starting new stream (generating SDP file)
update_settings
(
true
);
break
;
case
RTSP_Server
:
:
PARAMS_WAS_CHANGED
:
/// Update frame size, fps before starting new stream (generating SDP file)
case
RTSP_Server
:
:
PARAMS_WAS_CHANGED
:
// update frame size, fps before starting new stream (generating SDP file)
return
(
update_settings
(
false
)
||
!
(
params
->
daemon_enabled
()));
case
RTSP_Server
:
:
PLAY
:
D
(
sensor_port
,
cerr
<<
"==PLAY=="
);
...
...
@@ -374,8 +376,7 @@ int Streamer::handler(RTSP_Server *rtsp_server, RTSP_Server::event event) {
int
ttl
=
-
1
;
if
(
session
->
rtp_out
.
multicast
)
ttl
=
atoi
(
session
->
rtp_out
.
ttl
.
c_str
());
video
->
Start
(
session
->
rtp_out
.
ip
,
session
->
rtp_out
.
port_video
,
session
->
video
.
fps_scale
,
ttl
);
video
->
Start
(
session
->
rtp_out
.
ip
,
session
->
rtp_out
.
port_video
,
session
->
video
.
fps_scale
,
ttl
);
if
(
audio
!=
NULL
)
audio
->
Start
(
session
->
rtp_out
.
ip
,
session
->
rtp_out
.
port_audio
,
ttl
);
}
...
...
@@ -440,7 +441,7 @@ int Streamer::handler(RTSP_Server *rtsp_server, RTSP_Server::event event) {
void
Streamer
::
Main
(
void
)
{
D
(
sensor_port
,
cerr
<<
"start Main for sensor port "
<<
sensor_port
<<
endl
);
int
def_port
=
20020
;
int
def_port
=
20020
+
4
*
sensor_port
;
// +4 because RTP port should be an even number and each stream can occupy 2 ports
string
def_ttl
=
"2"
;
session
->
rtp_out
.
ip_cached
=
0
;
...
...
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