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