Add profile and level to progress IO

This commit is contained in:
Ingo Oppermann
2024-09-05 13:44:19 +02:00
parent 1a51db01ea
commit bc1b2cf76b
4 changed files with 28 additions and 0 deletions

View File

@@ -23,6 +23,8 @@ type ProgressIO struct {
Type string `json:"type"` Type string `json:"type"`
Codec string `json:"codec"` Codec string `json:"codec"`
Coder string `json:"coder"` Coder string `json:"coder"`
Profile int `json:"profile"`
Level int `json:"level"`
Frame uint64 `json:"frame" format:"uint64"` Frame uint64 `json:"frame" format:"uint64"`
Keyframe uint64 `json:"keyframe" format:"uint64"` Keyframe uint64 `json:"keyframe" format:"uint64"`
Framerate ProgressIOFramerate `json:"framerate"` Framerate ProgressIOFramerate `json:"framerate"`
@@ -63,6 +65,8 @@ func (i *ProgressIO) Unmarshal(io *app.ProgressIO) {
i.Type = io.Type i.Type = io.Type
i.Codec = io.Codec i.Codec = io.Codec
i.Coder = io.Coder i.Coder = io.Coder
i.Profile = io.Profile
i.Level = io.Level
i.Frame = io.Frame i.Frame = io.Frame
i.Keyframe = io.Keyframe i.Keyframe = io.Keyframe
i.Framerate.Min = json.ToNumber(io.Framerate.Min) i.Framerate.Min = json.ToNumber(io.Framerate.Min)
@@ -99,6 +103,8 @@ func (i *ProgressIO) Marshal() app.ProgressIO {
Type: i.Type, Type: i.Type,
Codec: i.Codec, Codec: i.Codec,
Coder: i.Coder, Coder: i.Coder,
Profile: i.Profile,
Level: i.Level,
Frame: i.Frame, Frame: i.Frame,
Keyframe: i.Keyframe, Keyframe: i.Keyframe,
Packet: i.Packet, Packet: i.Packet,

View File

@@ -97,6 +97,8 @@ func TestProgressIO(t *testing.T) {
Type: "video", Type: "video",
Codec: "x", Codec: "x",
Coder: "y", Coder: "y",
Profile: 848,
Level: 48,
Frame: 133, Frame: 133,
Keyframe: 39, Keyframe: 39,
Framerate: app.ProgressIOFramerate{ Framerate: app.ProgressIOFramerate{
@@ -138,6 +140,8 @@ func TestProgressIOAVstream(t *testing.T) {
Type: "video", Type: "video",
Codec: "x", Codec: "x",
Coder: "y", Coder: "y",
Profile: 848,
Level: 48,
Frame: 133, Frame: 133,
Keyframe: 39, Keyframe: 39,
Framerate: app.ProgressIOFramerate{ Framerate: app.ProgressIOFramerate{
@@ -205,6 +209,8 @@ func TestProgress(t *testing.T) {
Type: "video", Type: "video",
Codec: "x", Codec: "x",
Coder: "y", Coder: "y",
Profile: 848,
Level: 48,
Frame: 133, Frame: 133,
Keyframe: 39, Keyframe: 39,
Framerate: app.ProgressIOFramerate{ Framerate: app.ProgressIOFramerate{
@@ -262,6 +268,8 @@ func TestProgress(t *testing.T) {
Type: "video", Type: "video",
Codec: "x", Codec: "x",
Coder: "y", Coder: "y",
Profile: 848,
Level: 48,
Frame: 133, Frame: 133,
Keyframe: 39, Keyframe: 39,
Framerate: app.ProgressIOFramerate{ Framerate: app.ProgressIOFramerate{

View File

@@ -19,6 +19,8 @@ type ProgressIO struct {
Type string Type string
Codec string Codec string
Coder string Coder string
Profile int
Level int
Frame uint64 // counter Frame uint64 // counter
Keyframe uint64 // counter Keyframe uint64 // counter
Framerate ProgressIOFramerate Framerate ProgressIOFramerate
@@ -53,6 +55,8 @@ func (p *ProgressIO) UnmarshalParser(pp *parse.ProgressIO) {
p.Type = pp.Type p.Type = pp.Type
p.Codec = pp.Codec p.Codec = pp.Codec
p.Coder = pp.Coder p.Coder = pp.Coder
p.Profile = pp.Profile
p.Level = pp.Level
p.Frame = pp.Frame p.Frame = pp.Frame
p.Keyframe = pp.Keyframe p.Keyframe = pp.Keyframe
p.Framerate = pp.Framerate p.Framerate = pp.Framerate
@@ -88,6 +92,8 @@ func (p *ProgressIO) MarshalParser() parse.ProgressIO {
Type: p.Type, Type: p.Type,
Codec: p.Codec, Codec: p.Codec,
Coder: p.Coder, Coder: p.Coder,
Profile: p.Profile,
Level: p.Level,
Frame: p.Frame, Frame: p.Frame,
Keyframe: p.Keyframe, Keyframe: p.Keyframe,
Framerate: p.Framerate, Framerate: p.Framerate,

View File

@@ -16,6 +16,8 @@ func TestProgressIO(t *testing.T) {
Type: "video", Type: "video",
Codec: "h264", Codec: "h264",
Coder: "libx264", Coder: "libx264",
Profile: 848,
Level: 48,
Frame: 39, Frame: 39,
Keyframe: 433, Keyframe: 433,
Framerate: struct { Framerate: struct {
@@ -61,6 +63,8 @@ func TestProgressIOWithAVstream(t *testing.T) {
Type: "video", Type: "video",
Codec: "h264", Codec: "h264",
Coder: "libx264", Coder: "libx264",
Profile: 848,
Level: 48,
Frame: 39, Frame: 39,
Keyframe: 433, Keyframe: 433,
Framerate: struct { Framerate: struct {
@@ -219,6 +223,8 @@ func TestProgress(t *testing.T) {
Type: "video", Type: "video",
Codec: "h264", Codec: "h264",
Coder: "libx264", Coder: "libx264",
Profile: 848,
Level: 48,
Frame: 39, Frame: 39,
Keyframe: 433, Keyframe: 433,
Framerate: struct { Framerate: struct {
@@ -286,6 +292,8 @@ func TestProgress(t *testing.T) {
Type: "video", Type: "video",
Codec: "h264", Codec: "h264",
Coder: "libx264", Coder: "libx264",
Profile: 848,
Level: 48,
Frame: 39, Frame: 39,
Keyframe: 433, Keyframe: 433,
Framerate: struct { Framerate: struct {