Skip to content

Commit

Permalink
Add support S16LE (PCM-LE) for RTSP server
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Jul 26, 2024
1 parent 57d48f5 commit ed99025
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/core/media.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,13 @@ func MarshalSDP(name string, medias []*Media) ([]byte, error) {

codec := media.Codecs[0]

name := codec.Name
if name == CodecELD {
switch codec.Name {
case CodecELD:
name = CodecAAC
case CodecPCML:
name = CodecPCM // beacuse we using pcm.LittleToBig for RTSP server
default:
name = codec.Name
}

md := &sdp.MediaDescription{
Expand Down
2 changes: 2 additions & 0 deletions pkg/rtsp/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ func (c *Conn) packetWriter(codec *core.Codec, channel, payloadType uint8) core.
case core.CodecJPEG:
handlerFunc = mjpeg.RTPPay(handlerFunc)
}
} else if codec.Name == core.CodecPCML {
handlerFunc = pcm.LittleToBig(handlerFunc)
} else if c.PacketSize != 0 {
switch codec.Name {
case core.CodecH264:
Expand Down

0 comments on commit ed99025

Please sign in to comment.