mirror of
https://github.com/pion/mediadevices.git
synced 2025-10-23 16:43:11 +08:00
Remove videoDecoder
This commit is contained in:
@@ -11,11 +11,6 @@ type VideoEncoder interface {
|
||||
Close() error
|
||||
}
|
||||
|
||||
type VideoDecoder interface {
|
||||
Decode([]byte) (image.Image, error)
|
||||
Close() error
|
||||
}
|
||||
|
||||
type VideoSetting struct {
|
||||
Width, Height int
|
||||
TargetBitRate, MaxBitRate int
|
||||
@@ -23,7 +18,6 @@ type VideoSetting struct {
|
||||
}
|
||||
|
||||
type VideoEncoderBuilder func(s VideoSetting) (VideoEncoder, error)
|
||||
type VideoDecoderBuilder func(s VideoSetting) (VideoDecoder, error)
|
||||
|
||||
type AudioSetting struct {
|
||||
InSampleRate, OutSampleRate int
|
||||
|
@@ -8,7 +8,6 @@ import (
|
||||
|
||||
var (
|
||||
videoEncoders = make(map[string]VideoEncoderBuilder)
|
||||
videoDecoders = make(map[string]VideoDecoderBuilder)
|
||||
audioEncoders = make(map[string]AudioEncoderBuilder)
|
||||
)
|
||||
|
||||
@@ -16,8 +15,6 @@ func Register(name string, builder interface{}) {
|
||||
switch b := builder.(type) {
|
||||
case VideoEncoderBuilder:
|
||||
videoEncoders[name] = b
|
||||
case VideoDecoderBuilder:
|
||||
videoDecoders[name] = b
|
||||
case AudioEncoderBuilder:
|
||||
audioEncoders[name] = b
|
||||
}
|
||||
@@ -32,15 +29,6 @@ func BuildVideoEncoder(name string, s VideoSetting) (VideoEncoder, error) {
|
||||
return b(s)
|
||||
}
|
||||
|
||||
func BuildVideoDecoder(name string, s VideoSetting) (VideoDecoder, error) {
|
||||
b, ok := videoDecoders[name]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("codec: can't find %s video decoder", name)
|
||||
}
|
||||
|
||||
return b(s)
|
||||
}
|
||||
|
||||
func BuildAudioEncoder(name string, r audio.Reader, s AudioSetting) (io.ReadCloser, error) {
|
||||
b, ok := audioEncoders[name]
|
||||
if !ok {
|
||||
|
Reference in New Issue
Block a user