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"`
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,

View File

@@ -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{

View File

@@ -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,

View File

@@ -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 {