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 authored and dagleaves committed Nov 20, 2024
1 parent 040b972 commit d2f6418
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 d2f6418

Please sign in to comment.