Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
videolan
vlc
Commits
946fcf95
Commit
946fcf95
authored
Sep 24, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Basic support for RTP-Info
parent
f35e96de
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
4 deletions
+49
-4
modules/stream_out/rtp.c
modules/stream_out/rtp.c
+26
-0
modules/stream_out/rtp.h
modules/stream_out/rtp.h
+2
-0
modules/stream_out/rtsp.c
modules/stream_out/rtsp.c
+21
-4
No files found.
modules/stream_out/rtp.c
View file @
946fcf95
...
...
@@ -1473,6 +1473,32 @@ void rtp_del_sink( sout_stream_id_t *id, int fd )
net_Close
(
sink
.
rtp_fd
);
}
uint16_t
rtp_get_seq
(
const
sout_stream_id_t
*
id
)
{
/* This will return values for the next packet.
* Accounting for caching would not be totally trivial. */
return
id
->
i_sequence
;
}
/* FIXME: this is pretty bad - if we remove and then insert an ES
* the number will get unsynched from inside RTSP */
unsigned
rtp_get_num
(
const
sout_stream_id_t
*
id
)
{
sout_stream_sys_t
*
p_sys
=
id
->
p_stream
->
p_sys
;
int
i
;
vlc_mutex_lock
(
&
p_sys
->
lock_es
);
for
(
i
=
0
;
i
<
p_sys
->
i_es
;
i
++
)
{
if
(
id
==
p_sys
->
es
[
i
]
)
break
;
}
vlc_mutex_unlock
(
&
p_sys
->
lock_es
);
return
i
;
}
/****************************************************************************
* rtp_packetize_*:
****************************************************************************/
...
...
modules/stream_out/rtp.h
View file @
946fcf95
...
...
@@ -38,6 +38,8 @@ char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url );
int
rtp_add_sink
(
sout_stream_id_t
*
id
,
int
fd
,
vlc_bool_t
rtcp_mux
);
void
rtp_del_sink
(
sout_stream_id_t
*
id
,
int
fd
);
uint16_t
rtp_get_seq
(
const
sout_stream_id_t
*
id
);
unsigned
rtp_get_num
(
const
sout_stream_id_t
*
id
);
/* RTCP */
typedef
struct
rtcp_sender_t
rtcp_sender_t
;
...
...
modules/stream_out/rtsp.c
View file @
946fcf95
...
...
@@ -195,6 +195,7 @@ rtsp_stream_id_t *RtspAddId( rtsp_stream_t *rtsp, sout_stream_id_t *sid,
id
->
hiport
=
hiport
;
}
/* FIXME: num screws up if any ES has been removed and re-added */
snprintf
(
urlbuf
,
sizeof
(
urlbuf
),
rtsp
->
track_fmt
,
rtsp
->
psz_path
,
num
);
msg_Dbg
(
rtsp
->
owner
,
"RTSP: adding %s"
,
urlbuf
);
...
...
@@ -603,16 +604,32 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
ses
=
RtspClientGet
(
rtsp
,
psz_session
);
if
(
ses
!=
NULL
)
{
/* FIXME: we really need to limit the number of tracks... */
char
info
[
ses
->
trackc
*
(
strlen
(
control
)
+
sizeof
(
"/trackID=123;seq=65535, "
)
)
+
1
];
size_t
infolen
=
0
;
for
(
int
i
=
0
;
i
<
ses
->
trackc
;
i
++
)
{
rtsp_strack_t
*
tr
=
ses
->
trackv
+
i
;
if
(
!
tr
->
playing
&&
(
(
id
==
NULL
)
||
(
tr
->
id
==
id
->
sout_id
)
)
)
if
(
(
id
==
NULL
)
||
(
tr
->
id
==
id
->
sout_id
)
)
{
tr
->
playing
=
VLC_TRUE
;
rtp_add_sink
(
tr
->
id
,
tr
->
fd
,
VLC_FALSE
);
if
(
!
tr
->
playing
)
{
tr
->
playing
=
VLC_TRUE
;
rtp_add_sink
(
tr
->
id
,
tr
->
fd
,
VLC_FALSE
);
}
infolen
+=
sprintf
(
info
+
infolen
,
"%s/trackID=%u;seq=%u, "
,
control
,
rtp_get_num
(
tr
->
id
),
rtp_get_seq
(
tr
->
id
)
);
}
}
if
(
infolen
>
0
)
{
info
[
infolen
-
2
]
=
'\0'
;
/* remove trailing ", " */
httpd_MsgAdd
(
answer
,
"RTP-Info"
,
"%s"
,
info
);
}
}
vlc_mutex_unlock
(
&
rtsp
->
lock
);
...
...
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