mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
RTSP: reply with only requested parameters
Some peers (like Nexus 5 and Nexus 7) send empty GET_PARAMETER request during streaming. Seems it just some kind of ping. Do not include unnecessary information in reply. Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
This commit is contained in:
parent
62460a9e89
commit
c1b476146c
1 changed files with 31 additions and 11 deletions
|
@ -122,23 +122,43 @@ static void sink_handle_get_parameter(struct ctl_sink *s,
|
||||||
struct rtsp_message *m)
|
struct rtsp_message *m)
|
||||||
{
|
{
|
||||||
_rtsp_message_unref_ struct rtsp_message *rep = NULL;
|
_rtsp_message_unref_ struct rtsp_message *rep = NULL;
|
||||||
char wfd_video_formats[128];
|
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
r = rtsp_message_new_reply_for(m, &rep, RTSP_CODE_OK, NULL);
|
r = rtsp_message_new_reply_for(m, &rep, RTSP_CODE_OK, NULL);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return cli_vERR(r);
|
return cli_vERR(r);
|
||||||
|
|
||||||
sprintf(wfd_video_formats,
|
/* wfd_content_protection */
|
||||||
"wfd_video_formats: 00 00 03 10 %08x %08x %08x 00 0000 0000 10 none none",
|
if (rtsp_message_read(m, "{<>}", "wfd_content_protection") >= 0) {
|
||||||
s->resolutions_cea, s->resolutions_vesa, s->resolutions_hh);
|
r = rtsp_message_append(rep, "{&}",
|
||||||
r = rtsp_message_append(rep, "{&&&&}",
|
"wfd_content_protection: none");
|
||||||
"wfd_content_protection: none",
|
if (r < 0)
|
||||||
wfd_video_formats,
|
return cli_vERR(r);
|
||||||
"wfd_audio_codecs: AAC 00000007 00",
|
}
|
||||||
"wfd_client_rtp_ports: RTP/AVP/UDP;unicast 1991 0 mode=play");
|
/* wfd_video_formats */
|
||||||
if (r < 0)
|
if (rtsp_message_read(m, "{<>}", "wfd_video_formats") >= 0) {
|
||||||
return cli_vERR(r);
|
char wfd_video_formats[128];
|
||||||
|
sprintf(wfd_video_formats,
|
||||||
|
"wfd_video_formats: 00 00 03 10 %08x %08x %08x 00 0000 0000 10 none none",
|
||||||
|
s->resolutions_cea, s->resolutions_vesa, s->resolutions_hh);
|
||||||
|
r = rtsp_message_append(rep, "{&}", wfd_video_formats);
|
||||||
|
if (r < 0)
|
||||||
|
return cli_vERR(r);
|
||||||
|
}
|
||||||
|
/* wfd_audio_codecs */
|
||||||
|
if (rtsp_message_read(m, "{<>}", "wfd_audio_codecs") >= 0) {
|
||||||
|
r = rtsp_message_append(rep, "{&}",
|
||||||
|
"wfd_audio_codecs: AAC 00000007 00");
|
||||||
|
if (r < 0)
|
||||||
|
return cli_vERR(r);
|
||||||
|
}
|
||||||
|
/* wfd_client_rtp_ports */
|
||||||
|
if (rtsp_message_read(m, "{<>}", "wfd_client_rtp_ports") >= 0) {
|
||||||
|
r = rtsp_message_append(rep, "{&}",
|
||||||
|
"wfd_client_rtp_ports: RTP/AVP/UDP;unicast 1991 0 mode=play");
|
||||||
|
if (r < 0)
|
||||||
|
return cli_vERR(r);
|
||||||
|
}
|
||||||
|
|
||||||
rtsp_message_seal(rep);
|
rtsp_message_seal(rep);
|
||||||
cli_debug("OUTGOING: %s\n", rtsp_message_get_raw(rep));
|
cli_debug("OUTGOING: %s\n", rtsp_message_get_raw(rep));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue