mirror of
https://github.com/datarhei/core.git
synced 2025-10-05 07:57:13 +08:00
Add profile and level to progress IO
This commit is contained in:
@@ -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,
|
||||
|
@@ -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{
|
||||
|
@@ -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,
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user