From bc1b2cf76b5d1fd8ac104113d0cdaacbb49b956a Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Thu, 5 Sep 2024 13:44:19 +0200 Subject: [PATCH] Add profile and level to progress IO --- http/api/progress.go | 6 ++++++ http/api/progress_test.go | 8 ++++++++ restream/app/progress.go | 6 ++++++ restream/app/progress_test.go | 8 ++++++++ 4 files changed, 28 insertions(+) diff --git a/http/api/progress.go b/http/api/progress.go index dc1bdd5b..05976060 100644 --- a/http/api/progress.go +++ b/http/api/progress.go @@ -23,6 +23,8 @@ type ProgressIO struct { Type string `json:"type"` Codec string `json:"codec"` Coder string `json:"coder"` + Profile int `json:"profile"` + Level int `json:"level"` Frame uint64 `json:"frame" format:"uint64"` Keyframe uint64 `json:"keyframe" format:"uint64"` Framerate ProgressIOFramerate `json:"framerate"` @@ -63,6 +65,8 @@ func (i *ProgressIO) Unmarshal(io *app.ProgressIO) { i.Type = io.Type i.Codec = io.Codec i.Coder = io.Coder + i.Profile = io.Profile + i.Level = io.Level i.Frame = io.Frame i.Keyframe = io.Keyframe i.Framerate.Min = json.ToNumber(io.Framerate.Min) @@ -99,6 +103,8 @@ func (i *ProgressIO) Marshal() app.ProgressIO { Type: i.Type, Codec: i.Codec, Coder: i.Coder, + Profile: i.Profile, + Level: i.Level, Frame: i.Frame, Keyframe: i.Keyframe, Packet: i.Packet, diff --git a/http/api/progress_test.go b/http/api/progress_test.go index 06837e10..3ccd7926 100644 --- a/http/api/progress_test.go +++ b/http/api/progress_test.go @@ -97,6 +97,8 @@ func TestProgressIO(t *testing.T) { Type: "video", Codec: "x", Coder: "y", + Profile: 848, + Level: 48, Frame: 133, Keyframe: 39, Framerate: app.ProgressIOFramerate{ @@ -138,6 +140,8 @@ func TestProgressIOAVstream(t *testing.T) { Type: "video", Codec: "x", Coder: "y", + Profile: 848, + Level: 48, Frame: 133, Keyframe: 39, Framerate: app.ProgressIOFramerate{ @@ -205,6 +209,8 @@ func TestProgress(t *testing.T) { Type: "video", Codec: "x", Coder: "y", + Profile: 848, + Level: 48, Frame: 133, Keyframe: 39, Framerate: app.ProgressIOFramerate{ @@ -262,6 +268,8 @@ func TestProgress(t *testing.T) { Type: "video", Codec: "x", Coder: "y", + Profile: 848, + Level: 48, Frame: 133, Keyframe: 39, Framerate: app.ProgressIOFramerate{ diff --git a/restream/app/progress.go b/restream/app/progress.go index c98ad0fd..e0681b01 100644 --- a/restream/app/progress.go +++ b/restream/app/progress.go @@ -19,6 +19,8 @@ type ProgressIO struct { Type string Codec string Coder string + Profile int + Level int Frame uint64 // counter Keyframe uint64 // counter Framerate ProgressIOFramerate @@ -53,6 +55,8 @@ func (p *ProgressIO) UnmarshalParser(pp *parse.ProgressIO) { p.Type = pp.Type p.Codec = pp.Codec p.Coder = pp.Coder + p.Profile = pp.Profile + p.Level = pp.Level p.Frame = pp.Frame p.Keyframe = pp.Keyframe p.Framerate = pp.Framerate @@ -88,6 +92,8 @@ func (p *ProgressIO) MarshalParser() parse.ProgressIO { Type: p.Type, Codec: p.Codec, Coder: p.Coder, + Profile: p.Profile, + Level: p.Level, Frame: p.Frame, Keyframe: p.Keyframe, Framerate: p.Framerate, diff --git a/restream/app/progress_test.go b/restream/app/progress_test.go index 2cee5173..b8cce1ba 100644 --- a/restream/app/progress_test.go +++ b/restream/app/progress_test.go @@ -16,6 +16,8 @@ func TestProgressIO(t *testing.T) { Type: "video", Codec: "h264", Coder: "libx264", + Profile: 848, + Level: 48, Frame: 39, Keyframe: 433, Framerate: struct { @@ -61,6 +63,8 @@ func TestProgressIOWithAVstream(t *testing.T) { Type: "video", Codec: "h264", Coder: "libx264", + Profile: 848, + Level: 48, Frame: 39, Keyframe: 433, Framerate: struct { @@ -219,6 +223,8 @@ func TestProgress(t *testing.T) { Type: "video", Codec: "h264", Coder: "libx264", + Profile: 848, + Level: 48, Frame: 39, Keyframe: 433, Framerate: struct { @@ -286,6 +292,8 @@ func TestProgress(t *testing.T) { Type: "video", Codec: "h264", Coder: "libx264", + Profile: 848, + Level: 48, Frame: 39, Keyframe: 433, Framerate: struct {