diff --git a/examples/util/gstreamer-src/gst.go b/examples/util/gstreamer-src/gst.go index 33698075..41e4cdb8 100644 --- a/examples/util/gstreamer-src/gst.go +++ b/examples/util/gstreamer-src/gst.go @@ -43,6 +43,8 @@ func CreatePipeline(codecName string, in chan<- media.RTCSample) *Pipeline { pipelineStr = "videotestsrc ! video/x-raw,format=I420 ! x264enc bframes=0 speed-preset=veryfast key-int-max=60 ! video/x-h264,stream-format=byte-stream ! " + pipelineStr case webrtc.Opus: pipelineStr = "audiotestsrc ! opusenc ! " + pipelineStr + case webrtc.G722: + pipelineStr = "audiotestsrc ! avenc_g722 ! " + pipelineStr default: panic("Unhandled codec " + codecName) } diff --git a/mediaengine.go b/mediaengine.go index 9663ae40..196e7811 100644 --- a/mediaengine.go +++ b/mediaengine.go @@ -27,7 +27,7 @@ const ( // RegisterDefaultCodecs is a helper that registers the default codecs supported by pions-webrtc func RegisterDefaultCodecs() { - RegisterCodec(NewRTCRtpG722Codec(DefaultPayloadTypeG722, 8000, 1)) + RegisterCodec(NewRTCRtpG722Codec(DefaultPayloadTypeG722, 8000)) RegisterCodec(NewRTCRtpOpusCodec(DefaultPayloadTypeOpus, 48000, 2)) RegisterCodec(NewRTCRtpVP8Codec(DefaultPayloadTypeVP8, 90000)) RegisterCodec(NewRTCRtpH264Codec(DefaultPayloadTypeH264, 90000)) @@ -96,11 +96,11 @@ const ( ) // NewRTCRtpG722Codec is a helper to create a G722 codec -func NewRTCRtpG722Codec(payloadType uint8, clockrate uint32, channels uint16) *RTCRtpCodec { +func NewRTCRtpG722Codec(payloadType uint8, clockrate uint32) *RTCRtpCodec { c := NewRTCRtpCodec(RTCRtpCodecTypeAudio, G722, clockrate, - channels, + 0, "", payloadType, &codecs.G722Payloader{})