mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
codec is video & audio.
This commit is contained in:
parent
89737dd4ce
commit
8d0468ea62
@ -145,7 +145,7 @@ func (manager *StreamSinkManagerCtx) createPipeline() error {
|
||||
}
|
||||
|
||||
appsinkSubfix := "audio"
|
||||
if codec.IsVideo(manager.codec.Type) {
|
||||
if manager.codec.IsVideo() {
|
||||
appsinkSubfix = "video"
|
||||
}
|
||||
|
||||
|
@ -50,14 +50,6 @@ func ParseStr(codecName string) (codec RTPCodec, ok bool) {
|
||||
return
|
||||
}
|
||||
|
||||
func IsVideo(codecType webrtc.RTPCodecType) bool {
|
||||
return codecType == webrtc.RTPCodecTypeVideo
|
||||
}
|
||||
|
||||
func IsAudio(codecType webrtc.RTPCodecType) bool {
|
||||
return codecType == webrtc.RTPCodecTypeAudio
|
||||
}
|
||||
|
||||
type RTPCodec struct {
|
||||
Name string
|
||||
PayloadType webrtc.PayloadType
|
||||
@ -72,6 +64,14 @@ func (codec RTPCodec) Register(engine *webrtc.MediaEngine) error {
|
||||
}, codec.Type)
|
||||
}
|
||||
|
||||
func (codec RTPCodec) IsVideo() bool {
|
||||
return codec.Type == webrtc.RTPCodecTypeVideo
|
||||
}
|
||||
|
||||
func (codec RTPCodec) IsAudio() bool {
|
||||
return codec.Type == webrtc.RTPCodecTypeAudio
|
||||
}
|
||||
|
||||
func VP8() RTPCodec {
|
||||
return RTPCodec{
|
||||
Name: "vp8",
|
||||
|
Loading…
Reference in New Issue
Block a user