diff --git a/docs/docs.go b/docs/docs.go index 41e9394e..c453f3f4 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -2032,6 +2032,10 @@ const docTemplate = `{ "looping": { "type": "boolean" }, + "looping_runtime": { + "type": "integer", + "format": "uint64" + }, "output": { "$ref": "#/definitions/api.AVstreamIO" }, @@ -3044,6 +3048,10 @@ const docTemplate = `{ }, "type": { "type": "string" + }, + "updated_at": { + "type": "integer", + "format": "int64" } } }, @@ -3358,18 +3366,7 @@ const docTemplate = `{ "format": "uint64" }, "framerate": { - "type": "object", - "properties": { - "avg": { - "type": "number" - }, - "max": { - "type": "number" - }, - "min": { - "type": "number" - } - } + "$ref": "#/definitions/api.ProgressIOFramerate" }, "height": { "type": "integer", @@ -3427,6 +3424,20 @@ const docTemplate = `{ } } }, + "api.ProgressIOFramerate": { + "type": "object", + "properties": { + "avg": { + "type": "number" + }, + "max": { + "type": "number" + }, + "min": { + "type": "number" + } + } + }, "api.RTMPChannel": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index 2956a6ec..8351c34c 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -2025,6 +2025,10 @@ "looping": { "type": "boolean" }, + "looping_runtime": { + "type": "integer", + "format": "uint64" + }, "output": { "$ref": "#/definitions/api.AVstreamIO" }, @@ -3037,6 +3041,10 @@ }, "type": { "type": "string" + }, + "updated_at": { + "type": "integer", + "format": "int64" } } }, @@ -3351,18 +3359,7 @@ "format": "uint64" }, "framerate": { - "type": "object", - "properties": { - "avg": { - "type": "number" - }, - "max": { - "type": "number" - }, - "min": { - "type": "number" - } - } + "$ref": "#/definitions/api.ProgressIOFramerate" }, "height": { "type": "integer", @@ -3420,6 +3417,20 @@ } } }, + "api.ProgressIOFramerate": { + "type": "object", + "properties": { + "avg": { + "type": "number" + }, + "max": { + "type": "number" + }, + "min": { + "type": "number" + } + } + }, "api.RTMPChannel": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 2b35b2bd..ffe87a64 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -22,6 +22,9 @@ definitions: $ref: '#/definitions/api.AVstreamIO' looping: type: boolean + looping_runtime: + format: uint64 + type: integer output: $ref: '#/definitions/api.AVstreamIO' queue: @@ -701,6 +704,9 @@ definitions: $ref: '#/definitions/api.ProcessState' type: type: string + updated_at: + format: int64 + type: integer type: object api.ProcessConfig: properties: @@ -914,14 +920,7 @@ definitions: format: uint64 type: integer framerate: - properties: - avg: - type: number - max: - type: number - min: - type: number - type: object + $ref: '#/definitions/api.ProgressIOFramerate' height: format: uint64 type: integer @@ -963,6 +962,15 @@ definitions: format: uint64 type: integer type: object + api.ProgressIOFramerate: + properties: + avg: + type: number + max: + type: number + min: + type: number + type: object api.RTMPChannel: properties: name: diff --git a/ffmpeg/parse/types.go b/ffmpeg/parse/types.go index 1f829b5e..45bafa3f 100644 --- a/ffmpeg/parse/types.go +++ b/ffmpeg/parse/types.go @@ -59,33 +59,35 @@ func (avio *ffmpegAVstreamIO) export() app.AVstreamIO { } type ffmpegAVstream struct { - Input ffmpegAVstreamIO `json:"input"` - Output ffmpegAVstreamIO `json:"output"` - Address string `json:"id"` - URL string `json:"url"` - Stream uint64 `json:"stream"` - Aqueue uint64 `json:"aqueue"` - Queue uint64 `json:"queue"` - Dup uint64 `json:"dup"` - Drop uint64 `json:"drop"` - Enc uint64 `json:"enc"` - Looping bool `json:"looping"` - Duplicating bool `json:"duplicating"` - GOP string `json:"gop"` + Input ffmpegAVstreamIO `json:"input"` + Output ffmpegAVstreamIO `json:"output"` + Address string `json:"id"` + URL string `json:"url"` + Stream uint64 `json:"stream"` + Aqueue uint64 `json:"aqueue"` + Queue uint64 `json:"queue"` + Dup uint64 `json:"dup"` + Drop uint64 `json:"drop"` + Enc uint64 `json:"enc"` + Looping bool `json:"looping"` + LoopingRuntime uint64 `json:"looping_runtime"` + Duplicating bool `json:"duplicating"` + GOP string `json:"gop"` } func (av *ffmpegAVstream) export() *app.AVstream { return &app.AVstream{ - Aqueue: av.Aqueue, - Queue: av.Queue, - Drop: av.Drop, - Dup: av.Dup, - Enc: av.Enc, - Looping: av.Looping, - Duplicating: av.Duplicating, - GOP: av.GOP, - Input: av.Input.export(), - Output: av.Output.export(), + Aqueue: av.Aqueue, + Queue: av.Queue, + Drop: av.Drop, + Dup: av.Dup, + Enc: av.Enc, + Looping: av.Looping, + LoopingRuntime: av.LoopingRuntime, + Duplicating: av.Duplicating, + GOP: av.GOP, + Input: av.Input.export(), + Output: av.Output.export(), } } diff --git a/http/api/avstream.go b/http/api/avstream.go index 279b3352..91c6c5e7 100644 --- a/http/api/avstream.go +++ b/http/api/avstream.go @@ -23,16 +23,17 @@ func (i *AVstreamIO) Unmarshal(io *app.AVstreamIO) { } type AVstream struct { - Input AVstreamIO `json:"input"` - Output AVstreamIO `json:"output"` - Aqueue uint64 `json:"aqueue" format:"uint64"` - Queue uint64 `json:"queue" format:"uint64"` - Dup uint64 `json:"dup" format:"uint64"` - Drop uint64 `json:"drop" format:"uint64"` - Enc uint64 `json:"enc" format:"uint64"` - Looping bool `json:"looping"` - Duplicating bool `json:"duplicating"` - GOP string `json:"gop"` + Input AVstreamIO `json:"input"` + Output AVstreamIO `json:"output"` + Aqueue uint64 `json:"aqueue" format:"uint64"` + Queue uint64 `json:"queue" format:"uint64"` + Dup uint64 `json:"dup" format:"uint64"` + Drop uint64 `json:"drop" format:"uint64"` + Enc uint64 `json:"enc" format:"uint64"` + Looping bool `json:"looping"` + LoopingRuntime uint64 `json:"looping_runtime" format:"uint64"` + Duplicating bool `json:"duplicating"` + GOP string `json:"gop"` } func (a *AVstream) Unmarshal(av *app.AVstream) { @@ -46,6 +47,7 @@ func (a *AVstream) Unmarshal(av *app.AVstream) { a.Drop = av.Drop a.Enc = av.Enc a.Looping = av.Looping + a.LoopingRuntime = av.LoopingRuntime a.Duplicating = av.Duplicating a.GOP = av.GOP diff --git a/restream/app/avstream.go b/restream/app/avstream.go index 70cf9634..988a18cb 100644 --- a/restream/app/avstream.go +++ b/restream/app/avstream.go @@ -3,19 +3,20 @@ package app type AVstreamIO struct { State string Packet uint64 // counter - Time uint64 + Time uint64 // sec Size uint64 // bytes } type AVstream struct { - Input AVstreamIO - Output AVstreamIO - Aqueue uint64 // gauge - Queue uint64 // gauge - Dup uint64 // counter - Drop uint64 // counter - Enc uint64 // counter - Looping bool - Duplicating bool - GOP string + Input AVstreamIO + Output AVstreamIO + Aqueue uint64 // gauge + Queue uint64 // gauge + Dup uint64 // counter + Drop uint64 // counter + Enc uint64 // counter + Looping bool + LoopingRuntime uint64 // sec + Duplicating bool + GOP string }