mirror of
https://github.com/owntone/owntone-server.git
synced 2025-05-24 02:46:17 -04:00
[cast] Make fake announcement of video stream (fixes #1092)
For unknown reasons some Chromecast devices disconnect causing a TLS error if we don't OFFER a video stream. Seems actually sending video isn't required to fix the issue.
This commit is contained in:
parent
db43d51568
commit
a11ab808b2
@ -120,6 +120,12 @@
|
|||||||
// See cast_packet_header_make()
|
// See cast_packet_header_make()
|
||||||
#define CAST_HEADER_SIZE 11
|
#define CAST_HEADER_SIZE 11
|
||||||
|
|
||||||
|
// These limits are defined in components/mirroring/service/session.cc
|
||||||
|
#define CAST_SSRC_AUDIO_MIN 1
|
||||||
|
#define CAST_SSRC_AUDIO_MAX 500000
|
||||||
|
#define CAST_SSRC_VIDEO_MIN 500001
|
||||||
|
#define CAST_SSRC_VIDEO_MAX 1000000
|
||||||
|
|
||||||
/* Notes
|
/* Notes
|
||||||
* OFFER/ANSWER <-webrtc
|
* OFFER/ANSWER <-webrtc
|
||||||
* RTCP/RTP
|
* RTCP/RTP
|
||||||
@ -383,7 +389,7 @@ struct cast_msg_basic cast_msg[] =
|
|||||||
// sampleRate seems to be ignored
|
// sampleRate seems to be ignored
|
||||||
// storeTime unknown meaning - perhaps size of buffer?
|
// storeTime unknown meaning - perhaps size of buffer?
|
||||||
// targetDelay - should be RTP delay in ms, but doesn't seem to change anything?
|
// targetDelay - should be RTP delay in ms, but doesn't seem to change anything?
|
||||||
.payload = "{'type':'OFFER','seqNum':%u,'offer':{'castMode':'mirroring','supportedStreams':[{'index':0,'type':'audio_source','codecName':'opus','rtpProfile':'cast','rtpPayloadType':127,'ssrc':%" PRIu32 ",'storeTime':400,'targetDelay':400,'bitRate':128000,'sampleRate':48000,'timeBase':'1/48000','channels':2,'receiverRtcpEventLog':false}]}}",
|
.payload = "{'type':'OFFER','seqNum':%u,'offer':{'castMode':'mirroring','supportedStreams':[{'index':0,'type':'audio_source','codecName':'opus','rtpProfile':'cast','rtpPayloadType':127,'ssrc':%" PRIu32 ",'storeTime':400,'targetDelay':400,'bitRate':128000,'sampleRate':48000,'timeBase':'1/48000','channels':2,'receiverRtcpEventLog':false},{'codecName':'vp8','index':1,'maxBitRate':5000000,'maxFrameRate':'30000/1000','receiverRtcpEventLog':false,'renderMode':'video','resolutions':[{'height':900,'width':1600}],'rtpPayloadType':96,'rtpProfile':'cast','ssrc':999999,'targetDelay':400,'timeBase':'1/90000','type':'video_source'}]}}",
|
||||||
.flags = USE_TRANSPORT_ID | USE_REQUEST_ID,
|
.flags = USE_TRANSPORT_ID | USE_REQUEST_ID,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1503,6 +1509,9 @@ master_session_make(struct media_quality *quality)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Change the SSRC to be in the interval [CAST_SSRC_AUDIO_MIN, CAST_SSRC_AUDIO_MAX]
|
||||||
|
cms->rtp_session->ssrc_id = ((cms->rtp_session->ssrc_id + CAST_SSRC_AUDIO_MIN) % CAST_SSRC_AUDIO_MAX) + CAST_SSRC_AUDIO_MIN;
|
||||||
|
|
||||||
cms->quality = *quality;
|
cms->quality = *quality;
|
||||||
cms->samples_per_packet = CAST_SAMPLES_PER_PACKET;
|
cms->samples_per_packet = CAST_SAMPLES_PER_PACKET;
|
||||||
cms->rawbuf_size = STOB(cms->samples_per_packet, quality->bits_per_sample, quality->channels);
|
cms->rawbuf_size = STOB(cms->samples_per_packet, quality->bits_per_sample, quality->channels);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user