Commit Graph

49 Commits

Author SHA1 Message Date
aler9
ffe8c87c38 fix overriding of previously-received RTP packets that leaded to crashes
RTP packets were previously take from a buffer pool. This was messing
up the Client, since that buffer pool was used by multiple routines at
once, and was probably messing up the Server too, since packets can be
pushed to different queues and there's no guarantee that these queues
have an overall size less than ReadBufferCount.

This buffer pool is removed; this decreases performance but avoids bugs.
2022-12-19 13:51:49 +01:00
aler9
b3de3cf80e move media-related logics into serverStreamMedia 2022-12-19 13:06:08 +01:00
aler9
38b24b8e26 rename 'track' references into 'format' 2022-12-13 18:06:41 +01:00
Alessandro Ros
a1396206b5 convert Tracks into Medias and Formats (#155)
* split tracks from medias

* move tracks into dedicated package

* move media into dedicated package

* edit Medias.Marshal() in order to return SDP

* add medias.Find() and simplify examples

* improve coverage

* fix rebase errors

* replace TrackIDs with MediaIDs

* implement media-specific and track-specific callbacks for reading RTCP and RTP packets

* rename publish into record, read into play

* add v2 tag

* rename tracks into formats
2022-12-11 22:03:22 +01:00
aler9
d521a785c4 support tracks without clock rate 2022-11-27 21:17:48 +01:00
Alessandro Ros
7951b2e4af allow to set NTP of outgoing packets in both client and server (#148) 2022-11-14 16:55:40 +01:00
aler9
9029c3a9a3 clarify error 2022-11-09 12:54:35 +01:00
aler9
32f611270c add option to disable automatic RTCP sender reports (#111) 2022-11-02 17:32:42 +01:00
aler9
dbb6934a3c server: wait for a packet with DTS equal to PTS before filling RTP-Info 2022-11-01 11:20:23 +01:00
aler9
363ed38625 server: fix memory leak
(https://github.com/aler9/rtsp-simple-server/issues/1206)

RTCPSender was not closed when its corresponding stream was closed
2022-10-28 16:27:18 +02:00
aler9
cc9dcae08a server: make ServerStream.Close() thread-safe 2022-10-28 16:22:31 +02:00
aler9
630b1ebce1 change and check error message 2022-10-28 15:28:05 +02:00
aler9
c51fddc784 server: move serverMulticastHandler inside serverStreamTrack 2022-10-28 14:56:03 +02:00
aler9
0b75c240c7 server: fix bug that allowed two readers to use the same UDP ports
UDP ports of a reader that performed a SETUP request, but not a PLAY
request, were not taken into account when checking port availability
2022-10-28 14:39:23 +02:00
aler9
0cfbb1fb30 server: send RTCP sender reports to TCP clients too
this allows Nvidia Deepstream to compute NTP timestamp of frames
(https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_NTP_Timestamp.html)
2022-08-25 22:47:38 +02:00
aler9
5692796b4a server: remove useless check 2022-07-23 23:18:40 +02:00
aler9
aa08f973dd server: fix crash that happens when a reader tries to setup a closed stream (https://github.com/aler9/rtsp-simple-server/issues/866) 2022-06-14 15:32:16 +02:00
aler9
92ed04ad6c optimize RTP packet handling 2022-06-11 19:11:24 +02:00
aler9
206506a8f0 fix wrong RTP-Info header (https://github.com/aler9/rtsp-simple-server/issues/922)
- fix truncation to seconds of RTP time in RTP-Info
- add a small quantity to rtptime in RTP-Info
- add 1 to last sequence number in RTP-Info
2022-05-16 14:34:17 +02:00
aler9
ff34f5ac1d improve performance 2022-04-10 15:12:33 +02:00
aler9
2d2e62f55b fix 32bit support 2022-04-08 18:09:15 +02:00
aler9
d0cab3c8bd server: add parameter 'containsKeyFrame' to WritePacketRTP; fix RTCP sender reports and RTP-Info 2022-04-08 16:45:09 +02:00
aler9
cec5326ccf downgrade pion/rtp to v1 (#110) (#113) 2022-04-01 11:19:43 +02:00
aler9
7d9c882cc9 server: generate RTCP sender reports automatically; remote RTCP routing from examples 2022-03-24 15:27:19 +01:00
aler9
7f6383aa3c server: make calling ServerStream.Close() mandatory 2022-03-24 12:44:20 +01:00
aler9
e12b22ae77 fix encoding of RTP packets with padding
this fixes a SIGSEGV with GStreamer
2022-03-08 12:47:55 +01:00
aler9
86fb4181c7 server: allow calling ServerSession.WritePacketRTCP() inside OnRecord and OnPlay (#99) 2022-02-18 23:19:33 +01:00
aler9
a7ce5b7a53 update docs 2022-02-18 10:08:47 +01:00
aler9
3a2f9adbd5 server: decode and encode RTP/RTCP packets 2022-02-18 00:03:39 +01:00
aler9
6d5bf0c1bb new track system 2022-01-30 15:51:49 +01:00
aler9
3438279d73 server: move multicast handler into separate file 2022-01-28 00:22:11 +01:00
aler9
6f374e3965 server: re-export ServerSession.WritePacketRTP() (#90) 2021-12-12 23:06:44 +01:00
aler9
bda1f3539c server: slightly improve write performance 2021-12-07 22:46:47 +01:00
aler9
066ddd4423 server: write UDP packets in parallel.
A goroutine writer is allocated for each session and
for each multicast stream.

This increases bandwidth and prevents freezes caused
by lagging readers.
2021-12-07 22:45:24 +01:00
aler9
4621d5f7be server: unexport ServerSession.WritePacketRTP 2021-12-04 22:30:21 +01:00
aler9
2882bacdf2 server: split WriteFrame into WritePacketRTP and WritePacketRTCP 2021-11-12 18:01:27 +01:00
aler9
eb7bf2614b remove duplicate methods 2021-10-27 19:15:22 +02:00
aler9
320c1b6f2c rename ClientTransport into Transport 2021-10-22 17:53:51 +02:00
aler9
e7ab15750c server: replace SetuppedProtocol() with SetuppedTransport() 2021-10-22 17:40:18 +02:00
aler9
239b71d975 server: do not allow a client to control a session created with a different IP 2021-09-23 19:52:57 +02:00
aler9
5ef9076357 server: do not allow a reader to use the same UDP ports of another reader 2021-09-23 19:16:01 +02:00
aler9
c45a1b3995 server: stop sending frames immediately after ServerStream.Close() is called 2021-08-10 17:34:40 +02:00
aler9
d073a185c2 client: allow to publish tracks with pre-existing control attribute (#48) 2021-06-23 22:03:22 +02:00
aler9
63e2864a67 server: use one IP per stream; expose multicast parameters in configuration 2021-06-19 18:48:32 +02:00
aler9
eef21cc2b5 server: fix bug that prevents clients from receiving with multicast after all previous clients have disconnected 2021-06-19 16:03:53 +02:00
aler9
9595e298f8 client: support reading with UDP-multicast 2021-06-18 17:47:25 +02:00
aler9
ea1c7c69be server: support receiving RTCP packets from multicast clients 2021-06-18 17:34:25 +02:00
aler9
db28e87ecb server: fill SSRC in SETUP responses and RTP-Info in PLAY responses automatically 2021-06-17 16:45:24 +02:00
aler9
3f3226b53d server: support reading with multicast 2021-06-17 16:45:24 +02:00