Add initialized field in progress data

This commit is contained in:
Ingo Oppermann
2024-04-12 15:18:47 +02:00
parent 423e0453de
commit a6375da911
8 changed files with 56 additions and 49 deletions

View File

@@ -4887,9 +4887,6 @@ const docTemplate = `{
"leader": {
"$ref": "#/definitions/api.ClusterAboutLeader"
},
"node_id": {
"type": "string"
},
"nodes": {
"type": "array",
"items": {
@@ -6834,6 +6831,9 @@ const docTemplate = `{
"type": "integer",
"format": "uint64"
},
"initialized": {
"type": "boolean"
},
"inputs": {
"type": "array",
"items": {

View File

@@ -4879,9 +4879,6 @@
"leader": {
"$ref": "#/definitions/api.ClusterAboutLeader"
},
"node_id": {
"type": "string"
},
"nodes": {
"type": "array",
"items": {
@@ -6826,6 +6823,9 @@
"type": "integer",
"format": "uint64"
},
"initialized": {
"type": "boolean"
},
"inputs": {
"type": "array",
"items": {

View File

@@ -78,8 +78,6 @@ definitions:
type: string
leader:
$ref: '#/definitions/api.ClusterAboutLeader'
node_id:
type: string
nodes:
items:
$ref: '#/definitions/api.ClusterNode'
@@ -1389,6 +1387,8 @@ definitions:
frame:
format: uint64
type: integer
initialized:
type: boolean
inputs:
items:
$ref: '#/definitions/api.ProgressIO'

View File

@@ -655,6 +655,8 @@ func (p *parser) Progress() Progress {
progress.Input[i].AVstream = av.export()
}
progress.Initialized = p.stats.initialized
return progress
}

View File

@@ -450,6 +450,7 @@ type ProgressIO struct {
}
type Progress struct {
Initialized bool
Input []ProgressIO
Output []ProgressIO
Mapping StreamMapping

View File

@@ -91,6 +91,7 @@ func (i *ProgressIO) Unmarshal(io *app.ProgressIO) {
// Progress represents the progress of an ffmpeg process
type Progress struct {
Initialized bool `json:"initialized"`
Input []ProgressIO `json:"inputs"`
Output []ProgressIO `json:"outputs"`
Mapping StreamMapping `json:"mapping"`
@@ -115,6 +116,7 @@ func (progress *Progress) Unmarshal(p *app.Progress) {
return
}
progress.Initialized = p.Initialized
progress.Input = make([]ProgressIO, len(p.Input))
progress.Output = make([]ProgressIO, len(p.Output))
progress.Frame = p.Frame

View File

@@ -41,6 +41,7 @@ type ProgressIO struct {
}
type Progress struct {
Initialized bool
Input []ProgressIO
Output []ProgressIO
Mapping StreamMapping

View File

@@ -1624,6 +1624,7 @@ func (r *restream) GetProcessState(id app.ProcessID) (*app.State, error) {
// convertProgressFromParser converts a ffmpeg/parse.Progress type into a restream/app.Progress type.
func convertProgressFromParser(progress *app.Progress, pprogress parse.Progress) {
progress.Initialized = pprogress.Initialized
progress.Frame = pprogress.Frame
progress.Packet = pprogress.Packet
progress.FPS = pprogress.FPS