Add custom video/audio transforms

Resolves https://github.com/pion/mediadevices/issues/31
This commit is contained in:
Lukas Herman
2020-02-10 18:46:14 -08:00
parent ad9279e961
commit c6d0f3ec02
7 changed files with 218 additions and 3 deletions

View File

@@ -1,6 +1,8 @@
package mediadevices
import (
"github.com/pion/mediadevices/pkg/io/audio"
"github.com/pion/mediadevices/pkg/io/video"
"github.com/pion/mediadevices/pkg/prop"
)
@@ -13,6 +15,12 @@ type MediaStreamConstraints struct {
type MediaTrackConstraints struct {
prop.Media
Enabled bool
// VideoTransform will be used to transform the video that's coming from the driver.
// So, basically it'll look like following: driver -> VideoTransform -> codec
VideoTransform video.TransformFunc
// AudioTransform will be used to transform the audio that's coming from the driver.
// So, basically it'll look like following: driver -> AudioTransform -> code
AudioTransform audio.TransformFunc
}
type MediaOption func(*MediaTrackConstraints)