mirror of
https://github.com/pion/webrtc.git
synced 2025-10-08 00:20:16 +08:00
Tweak g722 support code
* allow GST examples to use g722 * Assume G722 is mono -- that's what chrome likes, and i don't know if anyone's doing stereo g722 anyway Relates to #283
This commit is contained in:

committed by
Woodrow Douglass

parent
7cc44ba79b
commit
c1bfcc8367
@@ -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
|
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:
|
case webrtc.Opus:
|
||||||
pipelineStr = "audiotestsrc ! opusenc ! " + pipelineStr
|
pipelineStr = "audiotestsrc ! opusenc ! " + pipelineStr
|
||||||
|
case webrtc.G722:
|
||||||
|
pipelineStr = "audiotestsrc ! avenc_g722 ! " + pipelineStr
|
||||||
default:
|
default:
|
||||||
panic("Unhandled codec " + codecName)
|
panic("Unhandled codec " + codecName)
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ const (
|
|||||||
|
|
||||||
// RegisterDefaultCodecs is a helper that registers the default codecs supported by pions-webrtc
|
// RegisterDefaultCodecs is a helper that registers the default codecs supported by pions-webrtc
|
||||||
func RegisterDefaultCodecs() {
|
func RegisterDefaultCodecs() {
|
||||||
RegisterCodec(NewRTCRtpG722Codec(DefaultPayloadTypeG722, 8000, 1))
|
RegisterCodec(NewRTCRtpG722Codec(DefaultPayloadTypeG722, 8000))
|
||||||
RegisterCodec(NewRTCRtpOpusCodec(DefaultPayloadTypeOpus, 48000, 2))
|
RegisterCodec(NewRTCRtpOpusCodec(DefaultPayloadTypeOpus, 48000, 2))
|
||||||
RegisterCodec(NewRTCRtpVP8Codec(DefaultPayloadTypeVP8, 90000))
|
RegisterCodec(NewRTCRtpVP8Codec(DefaultPayloadTypeVP8, 90000))
|
||||||
RegisterCodec(NewRTCRtpH264Codec(DefaultPayloadTypeH264, 90000))
|
RegisterCodec(NewRTCRtpH264Codec(DefaultPayloadTypeH264, 90000))
|
||||||
@@ -96,11 +96,11 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// NewRTCRtpG722Codec is a helper to create a G722 codec
|
// 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,
|
c := NewRTCRtpCodec(RTCRtpCodecTypeAudio,
|
||||||
G722,
|
G722,
|
||||||
clockrate,
|
clockrate,
|
||||||
channels,
|
0,
|
||||||
"",
|
"",
|
||||||
payloadType,
|
payloadType,
|
||||||
&codecs.G722Payloader{})
|
&codecs.G722Payloader{})
|
||||||
|
Reference in New Issue
Block a user