mirror of
https://github.com/datarhei/core.git
synced 2025-10-05 16:07:07 +08:00
Add initialized field in progress data
This commit is contained in:
@@ -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": {
|
||||
|
@@ -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": {
|
||||
|
@@ -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'
|
||||
|
@@ -655,6 +655,8 @@ func (p *parser) Progress() Progress {
|
||||
progress.Input[i].AVstream = av.export()
|
||||
}
|
||||
|
||||
progress.Initialized = p.stats.initialized
|
||||
|
||||
return progress
|
||||
}
|
||||
|
||||
|
@@ -450,6 +450,7 @@ type ProgressIO struct {
|
||||
}
|
||||
|
||||
type Progress struct {
|
||||
Initialized bool
|
||||
Input []ProgressIO
|
||||
Output []ProgressIO
|
||||
Mapping StreamMapping
|
||||
|
@@ -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
|
||||
|
@@ -41,6 +41,7 @@ type ProgressIO struct {
|
||||
}
|
||||
|
||||
type Progress struct {
|
||||
Initialized bool
|
||||
Input []ProgressIO
|
||||
Output []ProgressIO
|
||||
Mapping StreamMapping
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user