Added thread type to context

This commit is contained in:
Quentin Renard
2021-11-21 11:26:06 +01:00
parent 71359b8aea
commit ea2e3b39cd
4 changed files with 13 additions and 9 deletions

6
go.mod
View File

@@ -4,9 +4,9 @@ go 1.13
require (
github.com/BurntSushi/toml v0.3.1
github.com/asticode/go-astikit v0.21.0
github.com/asticode/go-astiws v1.4.0
github.com/asticode/goav v1.2.5
github.com/asticode/go-astikit v0.22.0
github.com/asticode/go-astiws v1.5.0
github.com/asticode/goav v1.4.0
github.com/gorilla/websocket v1.4.1
github.com/julienschmidt/httprouter v1.3.0
github.com/stretchr/testify v1.4.0

12
go.sum
View File

@@ -1,12 +1,12 @@
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/asticode/go-astikit v0.1.0/go.mod h1:h4ly7idim1tNhaVkdVBeXQZEE3L0xblP7fCWbgwipF0=
github.com/asticode/go-astikit v0.21.0 h1:NuD7KdRELczvVBItgAgYje/C6nIjokbqTel/1nrbgHo=
github.com/asticode/go-astikit v0.21.0/go.mod h1:h4ly7idim1tNhaVkdVBeXQZEE3L0xblP7fCWbgwipF0=
github.com/asticode/go-astiws v1.4.0 h1:+rPshVSmZK876YmszlaaktzVSWfqW7wI9i3f3EA1zg4=
github.com/asticode/go-astiws v1.4.0/go.mod h1:xDs2lfL41R0sUXYniZv7SMFY2VedPpfeydCdpaewgik=
github.com/asticode/goav v1.2.5 h1:F1/ft1n8ptx9Fxn9w2aQzRxCPAJV9JhQURcimFu9YXo=
github.com/asticode/goav v1.2.5/go.mod h1:PbMRIqgyIjrbfX/HUgO1Gn6YalnFDAevQrt8D8sQgvM=
github.com/asticode/go-astikit v0.22.0 h1:ZI/gS/0bWlqPvC8KGuoOOl71ZjFtA4ypxYXxwWOZuwU=
github.com/asticode/go-astikit v0.22.0/go.mod h1:h4ly7idim1tNhaVkdVBeXQZEE3L0xblP7fCWbgwipF0=
github.com/asticode/go-astiws v1.5.0 h1:b4FQ/iNRjX3m96fuQL2fNsFvZraxR4TJXBU4ISTkyas=
github.com/asticode/go-astiws v1.5.0/go.mod h1:xDs2lfL41R0sUXYniZv7SMFY2VedPpfeydCdpaewgik=
github.com/asticode/goav v1.4.0 h1:L5z6EDskiz90AvrGodjXjXMhVHkHqVfZP+QBEJ6gbl0=
github.com/asticode/goav v1.4.0/go.mod h1:PbMRIqgyIjrbfX/HUgO1Gn6YalnFDAevQrt8D8sQgvM=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=

View File

@@ -22,6 +22,7 @@ type Context struct {
GlobalHeader bool
Index int
ThreadCount *int
ThreadType *int
TimeBase avutil.Rational
// Audio

View File

@@ -100,6 +100,9 @@ func NewEncoder(o EncoderOptions, eh *astiencoder.EventHandler, c *astikit.Close
if o.Ctx.ThreadCount != nil {
e.ctxCodec.SetThreadCount(*o.Ctx.ThreadCount)
}
if o.Ctx.ThreadType != nil {
e.ctxCodec.SetThreadType(*o.Ctx.ThreadType)
}
// Set media type-specific context parameters
switch o.Ctx.CodecType {