Files
go-gst/examples/feature-rank/main.go
Dan Jenkins b54981346e Add GitHub action build and lint (#21)
* see if this works... adding github build first try

* fix up uses path

* add in our supported golang version

* don't run.... build... :D

* remove branch specifics

* remove things we don't need any longer
2023-08-26 09:52:23 +01:00

48 lines
887 B
Go

// This example shows how to use the feature ranking.
package main
import (
"fmt"
"github.com/go-gst/go-gst/examples"
"github.com/go-gst/go-gst/gst"
)
func start() error {
gst.Init(nil)
registry := gst.GetRegistry()
higherThanHighRank := (gst.Rank)(258)
codec, codecErr := registry.LookupFeature("vtdec_hw")
if codecErr == nil {
codec.SetPluginRank(higherThanHighRank)
rank := codec.GetPluginRank()
fmt.Println("vtdec_hw rank is:", rank)
}
codec, codecErr = registry.LookupFeature("vtdec_hw")
if codecErr == nil {
codec.SetPluginRank(gst.RankPrimary)
rank := codec.GetPluginRank()
fmt.Println("vtdec_hw rank is now:", rank)
}
//add a feature you expect to be available to you here and change it's rank
return codecErr
}
func main() {
examples.Run(func() error {
var err error
if err = start(); err != nil {
return err
}
return nil
})
}