Add IDs for disambiguation to graph elements

This commit is contained in:
Ingo Oppermann
2025-03-12 21:08:33 +01:00
parent 5ab1333a54
commit 9557f7e10a
8 changed files with 60 additions and 0 deletions

View File

@@ -6510,6 +6510,9 @@ const docTemplate = `{
"dst_filter": { "dst_filter": {
"type": "string" "type": "string"
}, },
"dst_id": {
"type": "string"
},
"dst_name": { "dst_name": {
"type": "string" "type": "string"
}, },
@@ -6522,6 +6525,9 @@ const docTemplate = `{
"height": { "height": {
"type": "integer" "type": "integer"
}, },
"id": {
"type": "string"
},
"index": { "index": {
"type": "integer" "type": "integer"
}, },
@@ -6559,6 +6565,9 @@ const docTemplate = `{
"copy": { "copy": {
"type": "boolean" "type": "boolean"
}, },
"id": {
"type": "string"
},
"index": { "index": {
"type": "integer" "type": "integer"
}, },

View File

@@ -6503,6 +6503,9 @@
"dst_filter": { "dst_filter": {
"type": "string" "type": "string"
}, },
"dst_id": {
"type": "string"
},
"dst_name": { "dst_name": {
"type": "string" "type": "string"
}, },
@@ -6515,6 +6518,9 @@
"height": { "height": {
"type": "integer" "type": "integer"
}, },
"id": {
"type": "string"
},
"index": { "index": {
"type": "integer" "type": "integer"
}, },
@@ -6552,6 +6558,9 @@
"copy": { "copy": {
"type": "boolean" "type": "boolean"
}, },
"id": {
"type": "string"
},
"index": { "index": {
"type": "integer" "type": "integer"
}, },

View File

@@ -975,6 +975,8 @@ definitions:
properties: properties:
dst_filter: dst_filter:
type: string type: string
dst_id:
type: string
dst_name: dst_name:
type: string type: string
filter: filter:
@@ -983,6 +985,8 @@ definitions:
type: string type: string
height: height:
type: integer type: integer
id:
type: string
index: index:
type: integer type: integer
inpad: inpad:
@@ -1008,6 +1012,8 @@ definitions:
properties: properties:
copy: copy:
type: boolean type: boolean
id:
type: string
index: index:
type: integer type: integer
input: input:

View File

@@ -309,8 +309,10 @@ func (io *ffmpegProcessIO) export() ProgressIO {
} }
type ffmpegGraphElement struct { type ffmpegGraphElement struct {
SrcID string `json:"src_id"`
SrcName string `json:"src_name"` SrcName string `json:"src_name"`
SrcFilter string `json:"src_filter"` SrcFilter string `json:"src_filter"`
DstID string `json:"dst_id"`
DstName string `json:"dst_name"` DstName string `json:"dst_name"`
DstFilter string `json:"dst_filter"` DstFilter string `json:"dst_filter"`
Inpad string `json:"inpad"` Inpad string `json:"inpad"`
@@ -334,6 +336,7 @@ type ffmpegGraphMapping struct {
Output *ffmpegMappingIO `json:"output"` Output *ffmpegMappingIO `json:"output"`
Graph struct { Graph struct {
Index int `json:"index"` Index int `json:"index"`
ID string `json:"id"`
Name string `json:"name"` Name string `json:"name"`
} `json:"graph"` } `json:"graph"`
Copy bool `json:"copy"` Copy bool `json:"copy"`
@@ -363,8 +366,10 @@ func (f *ffmpegProcess) ExportMapping() StreamMapping {
for _, g := range graph.Graph { for _, g := range graph.Graph {
e := GraphElement{ e := GraphElement{
Index: graph.Index, Index: graph.Index,
ID: g.SrcID,
Name: g.SrcName, Name: g.SrcName,
Filter: g.SrcFilter, Filter: g.SrcFilter,
DstID: g.DstID,
DstName: g.DstName, DstName: g.DstName,
DstFilter: g.DstFilter, DstFilter: g.DstFilter,
Inpad: g.Inpad, Inpad: g.Inpad,
@@ -387,6 +392,7 @@ func (f *ffmpegProcess) ExportMapping() StreamMapping {
Input: -1, Input: -1,
Output: -1, Output: -1,
Index: fm.Graph.Index, Index: fm.Graph.Index,
ID: fm.Graph.ID,
Name: fm.Graph.Name, Name: fm.Graph.Name,
Copy: fm.Copy, Copy: fm.Copy,
} }
@@ -614,8 +620,10 @@ type UsageGPUMemory struct {
type GraphElement struct { type GraphElement struct {
Index int Index int
ID string
Name string Name string
Filter string Filter string
DstID string
DstName string DstName string
DstFilter string DstFilter string
Inpad string Inpad string
@@ -633,6 +641,7 @@ type GraphMapping struct {
Input int Input int
Output int Output int
Index int Index int
ID string
Name string Name string
Copy bool Copy bool
} }

View File

@@ -252,8 +252,10 @@ func (p *Progress) Marshal() app.Progress {
type GraphElement struct { type GraphElement struct {
Index int `json:"index"` Index int `json:"index"`
ID string `json:"id"`
Name string `json:"name"` Name string `json:"name"`
Filter string `json:"filter"` Filter string `json:"filter"`
DstID string `json:"dst_id"`
DstName string `json:"dst_name"` DstName string `json:"dst_name"`
DstFilter string `json:"dst_filter"` DstFilter string `json:"dst_filter"`
Inpad string `json:"inpad"` Inpad string `json:"inpad"`
@@ -269,8 +271,10 @@ type GraphElement struct {
func (g *GraphElement) Unmarshal(a *app.GraphElement) { func (g *GraphElement) Unmarshal(a *app.GraphElement) {
g.Index = a.Index g.Index = a.Index
g.ID = a.ID
g.Name = a.Name g.Name = a.Name
g.Filter = a.Filter g.Filter = a.Filter
g.DstID = a.DstID
g.DstName = a.DstName g.DstName = a.DstName
g.DstFilter = a.DstFilter g.DstFilter = a.DstFilter
g.Inpad = a.Inpad g.Inpad = a.Inpad
@@ -287,8 +291,10 @@ func (g *GraphElement) Unmarshal(a *app.GraphElement) {
func (g *GraphElement) Marshal() app.GraphElement { func (g *GraphElement) Marshal() app.GraphElement {
a := app.GraphElement{ a := app.GraphElement{
Index: g.Index, Index: g.Index,
ID: g.ID,
Name: g.Name, Name: g.Name,
Filter: g.Filter, Filter: g.Filter,
DstID: g.DstID,
DstName: g.DstName, DstName: g.DstName,
DstFilter: g.DstFilter, DstFilter: g.DstFilter,
Inpad: g.Inpad, Inpad: g.Inpad,
@@ -309,6 +315,7 @@ type GraphMapping struct {
Input int `json:"input"` Input int `json:"input"`
Output int `json:"output"` Output int `json:"output"`
Index int `json:"index"` Index int `json:"index"`
ID string `json:"id"`
Name string `json:"name"` Name string `json:"name"`
Copy bool `json:"copy"` Copy bool `json:"copy"`
} }
@@ -317,6 +324,7 @@ func (g *GraphMapping) Unmarshal(a *app.GraphMapping) {
g.Input = a.Input g.Input = a.Input
g.Output = a.Output g.Output = a.Output
g.Index = a.Index g.Index = a.Index
g.ID = a.ID
g.Name = a.Name g.Name = a.Name
g.Copy = a.Copy g.Copy = a.Copy
} }
@@ -326,6 +334,7 @@ func (g *GraphMapping) Marshal() app.GraphMapping {
Input: g.Input, Input: g.Input,
Output: g.Output, Output: g.Output,
Index: g.Index, Index: g.Index,
ID: g.ID,
Name: g.Name, Name: g.Name,
Copy: g.Copy, Copy: g.Copy,
} }

View File

@@ -147,8 +147,10 @@ func TestProcessReportHistoryEntry(t *testing.T) {
Graphs: []app.GraphElement{ Graphs: []app.GraphElement{
{ {
Index: 5, Index: 5,
ID: "id",
Name: "foobar", Name: "foobar",
Filter: "infilter", Filter: "infilter",
DstID: "dstid",
DstName: "outfilter_", DstName: "outfilter_",
DstFilter: "outfilter", DstFilter: "outfilter",
Inpad: "inpad", Inpad: "inpad",
@@ -167,6 +169,7 @@ func TestProcessReportHistoryEntry(t *testing.T) {
Input: 1, Input: 1,
Output: 3, Output: 3,
Index: 39, Index: 39,
ID: "id",
Name: "foobar", Name: "foobar",
Copy: true, Copy: true,
}, },
@@ -339,8 +342,10 @@ func TestProcessReport(t *testing.T) {
Graphs: []app.GraphElement{ Graphs: []app.GraphElement{
{ {
Index: 5, Index: 5,
ID: "id",
Name: "foobar", Name: "foobar",
Filter: "infilter", Filter: "infilter",
DstID: "dstid",
DstName: "outfilter_", DstName: "outfilter_",
DstFilter: "outfilter", DstFilter: "outfilter",
Inpad: "inpad", Inpad: "inpad",
@@ -359,6 +364,7 @@ func TestProcessReport(t *testing.T) {
Input: 1, Input: 1,
Output: 3, Output: 3,
Index: 39, Index: 39,
ID: "id",
Name: "foobar", Name: "foobar",
Copy: true, Copy: true,
}, },

View File

@@ -203,8 +203,10 @@ func (p *Progress) MarshalParser() parse.Progress {
type GraphElement struct { type GraphElement struct {
Index int Index int
ID string
Name string Name string
Filter string Filter string
DstID string
DstName string DstName string
DstFilter string DstFilter string
Inpad string Inpad string
@@ -220,8 +222,10 @@ type GraphElement struct {
func (g *GraphElement) UnmarshalParser(p *parse.GraphElement) { func (g *GraphElement) UnmarshalParser(p *parse.GraphElement) {
g.Index = p.Index g.Index = p.Index
g.ID = p.ID
g.Name = p.Name g.Name = p.Name
g.Filter = p.Filter g.Filter = p.Filter
g.DstID = p.DstID
g.DstName = p.DstName g.DstName = p.DstName
g.DstFilter = p.DstFilter g.DstFilter = p.DstFilter
g.Inpad = p.Inpad g.Inpad = p.Inpad
@@ -238,8 +242,10 @@ func (g *GraphElement) UnmarshalParser(p *parse.GraphElement) {
func (g *GraphElement) MarshalParser() parse.GraphElement { func (g *GraphElement) MarshalParser() parse.GraphElement {
p := parse.GraphElement{ p := parse.GraphElement{
Index: g.Index, Index: g.Index,
ID: g.ID,
Name: g.Name, Name: g.Name,
Filter: g.Filter, Filter: g.Filter,
DstID: g.DstID,
DstName: g.DstName, DstName: g.DstName,
DstFilter: g.DstFilter, DstFilter: g.DstFilter,
Inpad: g.Inpad, Inpad: g.Inpad,
@@ -260,6 +266,7 @@ type GraphMapping struct {
Input int // Index of input stream, negative if output element Input int // Index of input stream, negative if output element
Output int // Index of output stream, negative if input element Output int // Index of output stream, negative if input element
Index int // Index of the graph, negative if streamcopy Index int // Index of the graph, negative if streamcopy
ID string // ID of the source resp. destination, empty if streamcopy, the name can be ambigous
Name string // Name of the source resp. destination, empty if streamcopy Name string // Name of the source resp. destination, empty if streamcopy
Copy bool // Whether it's a streamcopy i.e. there's no graph Copy bool // Whether it's a streamcopy i.e. there's no graph
} }
@@ -268,6 +275,7 @@ func (g *GraphMapping) UnmarshalParser(p *parse.GraphMapping) {
g.Input = p.Input g.Input = p.Input
g.Output = p.Output g.Output = p.Output
g.Index = p.Index g.Index = p.Index
g.ID = p.ID
g.Name = p.Name g.Name = p.Name
g.Copy = p.Copy g.Copy = p.Copy
} }
@@ -277,6 +285,7 @@ func (g *GraphMapping) MarshalParser() parse.GraphMapping {
Input: g.Input, Input: g.Input,
Output: g.Output, Output: g.Output,
Index: g.Index, Index: g.Index,
ID: g.ID,
Name: g.Name, Name: g.Name,
Copy: g.Copy, Copy: g.Copy,
} }

View File

@@ -178,8 +178,10 @@ func TestStreamMapping(t *testing.T) {
Graphs: []parse.GraphElement{ Graphs: []parse.GraphElement{
{ {
Index: 5, Index: 5,
ID: "id",
Name: "foobar", Name: "foobar",
Filter: "infilter", Filter: "infilter",
DstID: "dstid",
DstName: "outfilter_", DstName: "outfilter_",
DstFilter: "outfilter", DstFilter: "outfilter",
Inpad: "inpad", Inpad: "inpad",
@@ -198,6 +200,7 @@ func TestStreamMapping(t *testing.T) {
Input: 1, Input: 1,
Output: 3, Output: 3,
Index: 39, Index: 39,
ID: "id",
Name: "foobar", Name: "foobar",
Copy: true, Copy: true,
}, },