debug needed

This commit is contained in:
Sense T
2022-09-26 06:54:32 +00:00
parent 4c80f8a25e
commit bd0812cc42
7 changed files with 66 additions and 47 deletions

View File

@@ -73,6 +73,7 @@ func (w *WavFIFODriver) Properties() []prop.Media {
}
func (w *WavFIFODriver) AudioRecord(p prop.Media) (audio.Reader, error) {
logrus.Debugf("wave header: %v", w.waveHeader)
offset := FmtHeaderOffset + FmtHeaderIDSize + FmtHeaderChunkSizeSize + int64(w.waveHeader.Size) + DataChunkIDSize + DataChunkSizeSize
if _, err := w.f.Seek(
offset,
@@ -105,6 +106,7 @@ func (w *WavFIFODriver) AudioRecord(p prop.Media) (audio.Reader, error) {
case <-w.closed:
return nil, func() {}, io.EOF
case pcmData, ok := <-pcm:
logrus.Debug("got %d bytes pcm data", len(pcmData))
if !ok {
return nil, func() {}, io.ErrClosedPipe
}

View File

@@ -4,7 +4,6 @@ import (
"github.com/pion/mediadevices"
"github.com/pion/mediadevices/pkg/codec/opus"
"github.com/pion/mediadevices/pkg/codec/x264"
"github.com/pion/mediadevices/pkg/prop"
"github.com/pion/webrtc/v3"
"github.com/sirupsen/logrus"
)
@@ -56,8 +55,10 @@ func (c *Connection) Regist(offer *webrtc.SessionDescription) (*webrtc.SessionDe
s, err := mediadevices.GetUserMedia(mediadevices.MediaStreamConstraints{
Video: func(mtc *mediadevices.MediaTrackConstraints) {
mtc.Height = prop.IntExact(c.option.Video.Height)
mtc.Width = prop.IntExact(c.option.Video.Width)
/*
mtc.Height = prop.IntExact(c.option.Video.Height)
mtc.Width = prop.IntExact(c.option.Video.Width)
*/
},
Audio: func(mtc *mediadevices.MediaTrackConstraints) {},
Codec: codecSelector,