mirror of
https://github.com/datarhei/core.git
synced 2025-12-24 13:07:56 +08:00
Use extra object for avstream data
This commit is contained in:
@@ -46,22 +46,36 @@ func NewProcessProgressEvent(progress *ProcessProgress) *ProcessEvent {
|
||||
}
|
||||
|
||||
type ProcessProgressInput struct {
|
||||
Bitrate float64
|
||||
FPS float64
|
||||
Looping bool
|
||||
Enc uint64
|
||||
Drop uint64
|
||||
Dup uint64
|
||||
Bitrate float64
|
||||
FPS float64
|
||||
AVstream ProcessProgressInputAVstream
|
||||
}
|
||||
|
||||
func (p *ProcessProgressInput) Clone() ProcessProgressInput {
|
||||
c := ProcessProgressInput{
|
||||
Bitrate: p.Bitrate,
|
||||
FPS: p.FPS,
|
||||
Bitrate: p.Bitrate,
|
||||
FPS: p.FPS,
|
||||
AVstream: p.AVstream.Clone(),
|
||||
}
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type ProcessProgressInputAVstream struct {
|
||||
Looping bool
|
||||
Enc uint64
|
||||
Drop uint64
|
||||
Dup uint64
|
||||
Time uint64
|
||||
}
|
||||
|
||||
func (p *ProcessProgressInputAVstream) Clone() ProcessProgressInputAVstream {
|
||||
c := ProcessProgressInputAVstream{
|
||||
Looping: p.Looping,
|
||||
Enc: p.Enc,
|
||||
Drop: p.Drop,
|
||||
Dup: p.Dup,
|
||||
Time: p.Time,
|
||||
}
|
||||
|
||||
return c
|
||||
|
||||
@@ -479,10 +479,13 @@ func (p *parser) Parse(line []byte) uint64 {
|
||||
}
|
||||
|
||||
if io.AVstream != nil {
|
||||
input.Looping = io.AVstream.Looping
|
||||
input.Enc = io.AVstream.Enc
|
||||
input.Drop = io.AVstream.Drop
|
||||
input.Dup = io.AVstream.Dup
|
||||
input.AVstream = event.ProcessProgressInputAVstream{
|
||||
Looping: io.AVstream.Looping,
|
||||
Enc: io.AVstream.Enc,
|
||||
Drop: io.AVstream.Drop,
|
||||
Dup: io.AVstream.Dup,
|
||||
Time: io.AVstream.Input.Time,
|
||||
}
|
||||
}
|
||||
|
||||
evt.Input = append(evt.Input, input)
|
||||
|
||||
@@ -195,12 +195,17 @@ type ProcessEvent struct {
|
||||
}
|
||||
|
||||
type ProcessProgressInput struct {
|
||||
Bitrate json.Number `json:"bitrate" swaggertype:"number" jsonschema:"type=number"`
|
||||
FPS json.Number `json:"fps" swaggertype:"number" jsonschema:"type=number"`
|
||||
Looping bool `json:"looping"`
|
||||
Enc uint64 `json:"enc"`
|
||||
Drop uint64 `json:"drop"`
|
||||
Dup uint64 `json:"dup"`
|
||||
Bitrate json.Number `json:"bitrate" swaggertype:"number" jsonschema:"type=number"`
|
||||
FPS json.Number `json:"fps" swaggertype:"number" jsonschema:"type=number"`
|
||||
AVstream ProcessProgressInputAVstream `json:"avstream"`
|
||||
}
|
||||
|
||||
type ProcessProgressInputAVstream struct {
|
||||
Looping bool `json:"looping"`
|
||||
Enc uint64 `json:"enc"`
|
||||
Drop uint64 `json:"drop"`
|
||||
Dup uint64 `json:"dup"`
|
||||
Time uint64 `json:"time"`
|
||||
}
|
||||
|
||||
type ProcessProgressOutput struct {
|
||||
@@ -219,10 +224,13 @@ func (p *ProcessProgress) Unmarshal(e *event.ProcessProgress) {
|
||||
p.Input = append(p.Input, ProcessProgressInput{
|
||||
Bitrate: json.ToNumber(io.Bitrate),
|
||||
FPS: json.ToNumber(io.FPS),
|
||||
Looping: io.Looping,
|
||||
Enc: io.Enc,
|
||||
Drop: io.Drop,
|
||||
Dup: io.Dup,
|
||||
AVstream: ProcessProgressInputAVstream{
|
||||
Looping: io.AVstream.Looping,
|
||||
Enc: io.AVstream.Enc,
|
||||
Drop: io.AVstream.Drop,
|
||||
Dup: io.AVstream.Dup,
|
||||
Time: io.AVstream.Time,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user