mirror of
https://github.com/datarhei/core.git
synced 2025-10-05 16:07:07 +08:00
Add expose 'mode' from avstream progress
This commit is contained in:
@@ -1928,6 +1928,20 @@ const docTemplateClusterAPI = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"backup": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"dir": {
|
||||
"type": "string"
|
||||
},
|
||||
"patterns": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"max_size_mbytes": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
|
@@ -1920,6 +1920,20 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"backup": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"dir": {
|
||||
"type": "string"
|
||||
},
|
||||
"patterns": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"max_size_mbytes": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
|
@@ -538,6 +538,15 @@ definitions:
|
||||
description: Deprecated, use IAM
|
||||
type: string
|
||||
type: object
|
||||
backup:
|
||||
properties:
|
||||
dir:
|
||||
type: string
|
||||
patterns:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
max_size_mbytes:
|
||||
format: int64
|
||||
type: integer
|
||||
|
31
docs/docs.go
31
docs/docs.go
@@ -4579,6 +4579,9 @@ const docTemplate = `{
|
||||
"type": "integer",
|
||||
"format": "uint64"
|
||||
},
|
||||
"mode": {
|
||||
"type": "string"
|
||||
},
|
||||
"output": {
|
||||
"$ref": "#/definitions/api.AVstreamIO"
|
||||
},
|
||||
@@ -5418,6 +5421,20 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"backup": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"dir": {
|
||||
"type": "string"
|
||||
},
|
||||
"patterns": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"max_size_mbytes": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
@@ -7694,6 +7711,20 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"backup": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"dir": {
|
||||
"type": "string"
|
||||
},
|
||||
"patterns": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"max_size_mbytes": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
|
@@ -4571,6 +4571,9 @@
|
||||
"type": "integer",
|
||||
"format": "uint64"
|
||||
},
|
||||
"mode": {
|
||||
"type": "string"
|
||||
},
|
||||
"output": {
|
||||
"$ref": "#/definitions/api.AVstreamIO"
|
||||
},
|
||||
@@ -5410,6 +5413,20 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"backup": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"dir": {
|
||||
"type": "string"
|
||||
},
|
||||
"patterns": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"max_size_mbytes": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
@@ -7686,6 +7703,20 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"backup": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"dir": {
|
||||
"type": "string"
|
||||
},
|
||||
"patterns": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"max_size_mbytes": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
|
@@ -25,6 +25,8 @@ definitions:
|
||||
looping_runtime:
|
||||
format: uint64
|
||||
type: integer
|
||||
mode:
|
||||
type: string
|
||||
output:
|
||||
$ref: '#/definitions/api.AVstreamIO'
|
||||
queue:
|
||||
@@ -590,6 +592,15 @@ definitions:
|
||||
description: Deprecated, use IAM
|
||||
type: string
|
||||
type: object
|
||||
backup:
|
||||
properties:
|
||||
dir:
|
||||
type: string
|
||||
patterns:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
max_size_mbytes:
|
||||
format: int64
|
||||
type: integer
|
||||
@@ -2195,6 +2206,15 @@ definitions:
|
||||
description: Deprecated, use IAM
|
||||
type: string
|
||||
type: object
|
||||
backup:
|
||||
properties:
|
||||
dir:
|
||||
type: string
|
||||
patterns:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
max_size_mbytes:
|
||||
format: int64
|
||||
type: integer
|
||||
|
@@ -805,7 +805,7 @@ func TestParserProgressPlayout(t *testing.T) {
|
||||
parser.Parse(`ffmpeg.inputs:[{"url":"playout:https://cdn.livespotting.com/vpu/e9slfpe3/z60wzayk.m3u8","format":"playout","index":0,"stream":0,"type":"video","codec":"h264","coder":"h264","bitrate_kbps":0,"duration_sec":0.000000,"language":"und","fps":20.666666,"pix_fmt":"yuvj420p","width":1280,"height":720}]`)
|
||||
parser.Parse(`ffmpeg.outputs:[{"url":"/dev/null","format":"flv","index":0,"stream":0,"type":"video","codec":"h264","coder":"libx264","bitrate_kbps":0,"duration_sec":0.000000,"language":"und","fps":25.000000,"pix_fmt":"yuvj420p","width":1280,"height":720},{"url":"/dev/null","format":"mp4","index":1,"stream":0,"type":"video","codec":"h264","coder":"copy","bitrate_kbps":0,"duration_sec":0.000000,"language":"und","fps":20.666666,"pix_fmt":"yuvj420p","width":1280,"height":720}]`)
|
||||
parser.Parse(`ffmpeg.progress:{"inputs":[{"index":0,"stream":0,"frame":7,"keyframe":1,"packet":11,"size_kb":226,"size_bytes":42}],"outputs":[{"index":0,"stream":0,"frame":7,"keyframe":1,"packet":0,"q":0.0,"size_kb":0,"size_bytes":5,"extradata_size_bytes":32},{"index":1,"stream":0,"frame":11,"packet":11,"q":-1.0,"size_kb":226}],"frame":7,"packet":0,"q":0.0,"size_kb":226,"time":"0h0m0.56s","speed":0.4,"dup":0,"drop":0}`)
|
||||
parser.Parse(`avstream.progress:{"id":"playout:https://cdn.livespotting.com/vpu/e9slfpe3/z60wzayk.m3u8","url":"https://cdn.livespotting.com/vpu/e9slfpe3/z60wzayk.m3u8","stream":0,"queue":140,"aqueue":0,"dup":0,"drop":0,"enc":0,"looping":false,"duplicating":false,"gop":"none","input":{"state":"running","packet":148,"size_kb":1529,"time":5},"output":{"state":"running","packet":8,"size_kb":128,"time":1},"swap":{"url":"","status":"waiting","lasturl":"","lasterror":""}}`)
|
||||
parser.Parse(`avstream.progress:{"id":"playout:https://cdn.livespotting.com/vpu/e9slfpe3/z60wzayk.m3u8","url":"https://cdn.livespotting.com/vpu/e9slfpe3/z60wzayk.m3u8","stream":0,"queue":140,"aqueue":42,"dup":5,"drop":8,"enc":7,"looping":true,"duplicating":true,"gop":"key","mode":"live","input":{"state":"running","packet":148,"size_kb":1529,"time":5},"output":{"state":"running","packet":8,"size_kb":128,"time":1},"swap":{"url":"","status":"waiting","lasturl":"","lasterror":""}}`)
|
||||
|
||||
progress := parser.Progress()
|
||||
|
||||
@@ -846,14 +846,15 @@ func TestParserProgressPlayout(t *testing.T) {
|
||||
Time: 1,
|
||||
Size: 131072,
|
||||
},
|
||||
Aqueue: 0,
|
||||
Aqueue: 42,
|
||||
Queue: 140,
|
||||
Dup: 0,
|
||||
Drop: 0,
|
||||
Enc: 0,
|
||||
Looping: false,
|
||||
Duplicating: false,
|
||||
GOP: "none",
|
||||
Dup: 5,
|
||||
Drop: 8,
|
||||
Enc: 7,
|
||||
Looping: true,
|
||||
Duplicating: true,
|
||||
GOP: "key",
|
||||
Mode: "live",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@@ -71,6 +71,7 @@ type ffmpegAVstream struct {
|
||||
LoopingRuntime uint64 `json:"looping_runtime"`
|
||||
Duplicating bool `json:"duplicating"`
|
||||
GOP string `json:"gop"`
|
||||
Mode string `json:"mode"`
|
||||
}
|
||||
|
||||
func (av *ffmpegAVstream) export() *AVstream {
|
||||
@@ -84,6 +85,7 @@ func (av *ffmpegAVstream) export() *AVstream {
|
||||
LoopingRuntime: av.LoopingRuntime,
|
||||
Duplicating: av.Duplicating,
|
||||
GOP: av.GOP,
|
||||
Mode: av.Mode,
|
||||
Input: av.Input.export(),
|
||||
Output: av.Output.export(),
|
||||
}
|
||||
@@ -323,6 +325,7 @@ type AVstream struct {
|
||||
LoopingRuntime uint64
|
||||
Duplicating bool
|
||||
GOP string
|
||||
Mode string
|
||||
}
|
||||
|
||||
type Usage struct {
|
||||
|
@@ -34,6 +34,7 @@ type AVstream struct {
|
||||
LoopingRuntime uint64 `json:"looping_runtime" format:"uint64"`
|
||||
Duplicating bool `json:"duplicating"`
|
||||
GOP string `json:"gop"`
|
||||
Mode string `json:"mode"`
|
||||
}
|
||||
|
||||
func (a *AVstream) Unmarshal(av *app.AVstream) {
|
||||
@@ -50,6 +51,7 @@ func (a *AVstream) Unmarshal(av *app.AVstream) {
|
||||
a.LoopingRuntime = av.LoopingRuntime
|
||||
a.Duplicating = av.Duplicating
|
||||
a.GOP = av.GOP
|
||||
a.Mode = av.Mode
|
||||
|
||||
a.Input.Unmarshal(&av.Input)
|
||||
a.Output.Unmarshal(&av.Output)
|
||||
|
@@ -19,4 +19,5 @@ type AVstream struct {
|
||||
LoopingRuntime uint64 // sec
|
||||
Duplicating bool
|
||||
GOP string
|
||||
Mode string // "file" or "live"
|
||||
}
|
||||
|
@@ -1674,6 +1674,7 @@ func convertProgressFromParser(progress *app.Progress, pprogress parse.Progress)
|
||||
LoopingRuntime: pinput.AVstream.LoopingRuntime,
|
||||
Duplicating: pinput.AVstream.Duplicating,
|
||||
GOP: pinput.AVstream.GOP,
|
||||
Mode: pinput.AVstream.Mode,
|
||||
}
|
||||
|
||||
input.AVstream = avstream
|
||||
|
Reference in New Issue
Block a user