Skip to content

Commit

Permalink
Merge branch 'master' into ai-video-rebase-master-2
Browse files Browse the repository at this point in the history
  • Loading branch information
rickstaa committed Aug 7, 2024
2 parents c2da0bd + 825b3e2 commit faec85a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
5 changes: 3 additions & 2 deletions cmd/livepeer/starter/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,9 @@ func DefaultLivepeerConfig() LivepeerConfig {
FVfailGsKey: &defaultFVfailGsKey,

// API
AuthWebhookURL: &defaultAuthWebhookURL,
OrchWebhookURL: &defaultOrchWebhookURL,
AuthWebhookURL: &defaultAuthWebhookURL,
OrchWebhookURL: &defaultOrchWebhookURL,
OrchMinLivepeerVersion: &defaultMinLivepeerVersion,

// Versioning constraints
OrchMinLivepeerVersion: &defaultMinLivepeerVersion,

Check failure on line 350 in cmd/livepeer/starter/starter.go

View workflow job for this annotation

GitHub Actions / Build binaries for linux-cpu-amd64

duplicate field name OrchMinLivepeerVersion in struct literal

Check failure on line 350 in cmd/livepeer/starter/starter.go

View workflow job for this annotation

GitHub Actions / Build binaries for linux-gpu-amd64

duplicate field name OrchMinLivepeerVersion in struct literal

Check failure on line 350 in cmd/livepeer/starter/starter.go

View workflow job for this annotation

GitHub Actions / Build binaries for darwin-amd64

duplicate field name OrchMinLivepeerVersion in struct literal

Check failure on line 350 in cmd/livepeer/starter/starter.go

View workflow job for this annotation

GitHub Actions / Build binaries for darwin-arm64

duplicate field name OrchMinLivepeerVersion in struct literal
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ func CapabilityToName(capability Capability) (string, error) {
return capName, nil
}

func InArray(capability Capability, caps []Capability) bool {
func HasCapability(caps []Capability, capability Capability) bool {
for _, c := range caps {
if capability == c {
return true
Expand Down
20 changes: 10 additions & 10 deletions core/capabilities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,22 +148,22 @@ func TestCapability_TranscoderCapabilities(t *testing.T) {
if devicesAvailable {
nvidiaCaps, err := TestTranscoderCapabilities(devices, NewNvidiaTranscoder)
assert.Nil(t, err)
assert.False(t, InArray(Capability_H264_Decode_444_8bit, nvidiaCaps), "Nvidia device should not support decode of 444_8bit")
assert.False(t, InArray(Capability_H264_Decode_422_8bit, nvidiaCaps), "Nvidia device should not support decode of 422_8bit")
assert.False(t, InArray(Capability_H264_Decode_444_10bit, nvidiaCaps), "Nvidia device should not support decode of 444_10bit")
assert.False(t, InArray(Capability_H264_Decode_422_10bit, nvidiaCaps), "Nvidia device should not support decode of 422_10bit")
assert.False(t, InArray(Capability_H264_Decode_420_10bit, nvidiaCaps), "Nvidia device should not support decode of 420_10bit")
assert.False(t, HasCapability(nvidiaCaps, Capability_H264_Decode_444_8bit), "Nvidia device should not support decode of 444_8bit")
assert.False(t, HasCapability(nvidiaCaps, Capability_H264_Decode_422_8bit), "Nvidia device should not support decode of 422_8bit")
assert.False(t, HasCapability(nvidiaCaps, Capability_H264_Decode_444_10bit), "Nvidia device should not support decode of 444_10bit")
assert.False(t, HasCapability(nvidiaCaps, Capability_H264_Decode_422_10bit), "Nvidia device should not support decode of 422_10bit")
assert.False(t, HasCapability(nvidiaCaps, Capability_H264_Decode_420_10bit), "Nvidia device should not support decode of 420_10bit")
}

// Same test with software transcoder:
softwareCaps, err := TestSoftwareTranscoderCapabilities(tmpdir)
assert.Nil(t, err)
// Software transcoder supports: [h264_444_8bit h264_422_8bit h264_444_10bit h264_422_10bit h264_420_10bit]
assert.True(t, InArray(Capability_H264_Decode_444_8bit, softwareCaps), "software decoder should support 444_8bit input")
assert.True(t, InArray(Capability_H264_Decode_422_8bit, softwareCaps), "software decoder should support 422_8bit input")
assert.True(t, InArray(Capability_H264_Decode_444_10bit, softwareCaps), "software decoder should support 444_10bit input")
assert.True(t, InArray(Capability_H264_Decode_422_10bit, softwareCaps), "software decoder should support 422_10bit input")
assert.True(t, InArray(Capability_H264_Decode_420_10bit, softwareCaps), "software decoder should support 420_10bit input")
assert.True(t, HasCapability(softwareCaps, Capability_H264_Decode_444_8bit), "software decoder should support 444_8bit input")
assert.True(t, HasCapability(softwareCaps, Capability_H264_Decode_422_8bit), "software decoder should support 422_8bit input")
assert.True(t, HasCapability(softwareCaps, Capability_H264_Decode_444_10bit), "software decoder should support 444_10bit input")
assert.True(t, HasCapability(softwareCaps, Capability_H264_Decode_422_10bit), "software decoder should support 422_10bit input")
assert.True(t, HasCapability(softwareCaps, Capability_H264_Decode_420_10bit), "software decoder should support 420_10bit input")
}

func TestCapability_JobCapabilities(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion core/transcoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ type transcodeTestParams struct {
}

func (params transcodeTestParams) IsRequired() bool {
return InArray(params.Cap, DefaultCapabilities())
return HasCapability(DefaultCapabilities(), params.Cap)
}

func (params transcodeTestParams) Kind() string {
Expand Down

0 comments on commit faec85a

Please sign in to comment.