go fmt all files

This commit is contained in:
Ivan Tivonenko
2022-02-03 00:36:43 +02:00
parent ec799c43e5
commit 7437e4b92a
10 changed files with 40 additions and 40 deletions

View File

@@ -186,4 +186,4 @@ func main() {
})
lpms.Start(context.Background())
}
}

View File

@@ -52,8 +52,8 @@ var FfEncoderLookup = map[Acceleration]map[VideoCodec]string{
Software: {
H264: "libx264",
H265: "libx265",
VP8: "libvpx",
VP9: "libvpx-vp9",
VP8: "libvpx",
VP9: "libvpx-vp9",
},
Nvidia: {
H264: "h264_nvenc",
@@ -115,10 +115,10 @@ func GetCodecInfo(fname string) (bool, string, string, error) {
defer C.free(unsafe.Pointer(acodec_c))
defer C.free(unsafe.Pointer(vcodec_c))
bres := int(C.lpms_get_codec_info(cfname, vcodec_c, acodec_c))
if C.strlen(acodec_c)<255 {
if C.strlen(acodec_c) < 255 {
acodec = C.GoString(acodec_c)
}
if C.strlen(vcodec_c)<255 {
if C.strlen(vcodec_c) < 255 {
vcodec = C.GoString(vcodec_c)
}
return bres == 1, acodec, vcodec, nil

View File

@@ -605,11 +605,11 @@ func TestTranscoder_MuxerOpts(t *testing.T) {
}
type TranscodeOptionsTest struct {
InputCodec VideoCodec
OutputCodec VideoCodec
InputAccel Acceleration
OutputAccel Acceleration
Profile VideoProfile
InputCodec VideoCodec
OutputCodec VideoCodec
InputAccel Acceleration
OutputAccel Acceleration
Profile VideoProfile
}
func TestSW_Transcoding(t *testing.T) {
@@ -627,18 +627,18 @@ func supportedCodecsCombinations(accels []Acceleration) []TranscodeOptionsTest {
for _, outCodec := range outCodecs {
// skip unsupported combinations
switch outAccel {
case Nvidia:
switch outCodec {
case VP8, VP9:
continue
}
case Nvidia:
switch outCodec {
case VP8, VP9:
continue
}
}
opts = append(opts, TranscodeOptionsTest{
InputCodec: inCodec,
OutputCodec: outCodec,
InputAccel: inAccel,
OutputAccel: outAccel,
Profile: prof,
InputCodec: inCodec,
OutputCodec: outCodec,
InputAccel: inAccel,
OutputAccel: outAccel,
Profile: prof,
})
}
}
@@ -661,18 +661,18 @@ func codecsComboTest(t *testing.T, options []TranscodeOptionsTest) {
for i := range options {
curOptions := options[i]
switch curOptions.InputCodec {
case VP8, VP9:
inName = dir + "/test_in.mkv"
case H264, H265:
inName = dir + "/test_in.ts"
case VP8, VP9:
inName = dir + "/test_in.mkv"
case H264, H265:
inName = dir + "/test_in.ts"
}
switch curOptions.OutputCodec {
case VP8, VP9:
outName = dir + "/out.mkv"
qName = dir + "/sw.mkv"
case H264, H265:
outName = dir + "/out.ts"
qName = dir + "/sw.ts"
case VP8, VP9:
outName = dir + "/out.mkv"
qName = dir + "/sw.mkv"
case H264, H265:
outName = dir + "/out.ts"
qName = dir + "/sw.ts"
}
// if non-h264 test requested, transcode to target input codec first
prepare := true

View File

@@ -14,10 +14,10 @@ import (
"path"
"github.com/golang/glog"
"github.com/livepeer/joy4/av"
"github.com/livepeer/lpms/ffmpeg"
"github.com/livepeer/lpms/stream"
"github.com/livepeer/m3u8"
"github.com/livepeer/joy4/av"
)
var ErrSegmenterTimeout = errors.New("SegmenterTimeout")

View File

@@ -3,8 +3,8 @@ package stream
import (
"context"
"github.com/livepeer/m3u8"
"github.com/livepeer/joy4/av"
"github.com/livepeer/m3u8"
)
type AppData interface {

View File

@@ -71,10 +71,10 @@ func (b *streamBuffer) len() int64 {
//We couldn't just use the m3u8 definition
type HLSSegment struct {
SeqNo uint64
Name string
Data []byte
Duration float64
SeqNo uint64
Name string
Data []byte
Duration float64
IsZeroFrame bool
}

View File

@@ -6,9 +6,9 @@ import (
"time"
"github.com/golang/glog"
joy4rtmp "github.com/livepeer/joy4/format/rtmp"
"github.com/livepeer/lpms/segmenter"
"github.com/livepeer/lpms/stream"
joy4rtmp "github.com/livepeer/joy4/format/rtmp"
)
var segOptions = segmenter.SegmenterOptions{SegLength: time.Second * 2}

View File

@@ -9,9 +9,9 @@ import (
"testing"
"time"
"github.com/livepeer/lpms/stream"
"github.com/livepeer/joy4/av/pubsub"
joy4rtmp "github.com/livepeer/joy4/format/rtmp"
"github.com/livepeer/lpms/stream"
)
type testStream string

View File

@@ -17,9 +17,9 @@ import (
"time"
"github.com/golang/glog"
joy4rtmp "github.com/livepeer/joy4/format/rtmp"
"github.com/livepeer/lpms/stream"
"github.com/livepeer/m3u8"
joy4rtmp "github.com/livepeer/joy4/format/rtmp"
)
var ErrNotFound = errors.New("ErrNotFound")

View File

@@ -10,9 +10,9 @@ import (
"net/url"
joy4rtmp "github.com/livepeer/joy4/format/rtmp"
"github.com/livepeer/lpms/stream"
"github.com/livepeer/m3u8"
joy4rtmp "github.com/livepeer/joy4/format/rtmp"
)
func TestRTMP(t *testing.T) {