Add sample_fmt to API progress

This commit is contained in:
Ingo Oppermann
2024-09-05 13:40:04 +02:00
parent 7831992936
commit 1a51db01ea
4 changed files with 20 additions and 6 deletions

View File

@@ -40,9 +40,10 @@ type ProgressIO struct {
Height uint64 `json:"height,omitempty" format:"uint64"`
// Audio
Sampling uint64 `json:"sampling_hz,omitempty" format:"uint64"`
Layout string `json:"layout,omitempty"`
Channels uint64 `json:"channels,omitempty" format:"uint64"`
Samplefmt string `json:"sample_fmt,omitempty"`
Sampling uint64 `json:"sampling_hz,omitempty" format:"uint64"`
Layout string `json:"layout,omitempty"`
Channels uint64 `json:"channels,omitempty" format:"uint64"`
// avstream
AVstream *AVstream `json:"avstream" jsonschema:"anyof_type=null;object"`
@@ -77,6 +78,7 @@ func (i *ProgressIO) Unmarshal(io *app.ProgressIO) {
i.Quantizer = json.ToNumber(io.Quantizer)
i.Width = io.Width
i.Height = io.Height
i.Samplefmt = io.Samplefmt
i.Sampling = io.Sampling
i.Layout = io.Layout
i.Channels = io.Channels
@@ -105,6 +107,7 @@ func (i *ProgressIO) Marshal() app.ProgressIO {
Pixfmt: i.Pixfmt,
Width: i.Width,
Height: i.Height,
Samplefmt: i.Samplefmt,
Sampling: i.Sampling,
Layout: i.Layout,
Channels: i.Channels,

View File

@@ -114,6 +114,7 @@ func TestProgressIO(t *testing.T) {
Quantizer: 494.2,
Width: 10393,
Height: 4933,
Samplefmt: "fltp",
Sampling: 58483,
Layout: "atmos",
Channels: 4944,
@@ -154,6 +155,7 @@ func TestProgressIOAVstream(t *testing.T) {
Quantizer: 494.2,
Width: 10393,
Height: 4933,
Samplefmt: "fltp",
Sampling: 58483,
Layout: "atmos",
Channels: 4944,
@@ -220,6 +222,7 @@ func TestProgress(t *testing.T) {
Quantizer: 494.2,
Width: 10393,
Height: 4933,
Samplefmt: "fltp",
Sampling: 58483,
Layout: "atmos",
Channels: 4944,
@@ -276,6 +279,7 @@ func TestProgress(t *testing.T) {
Quantizer: 494.2,
Width: 10393,
Height: 4933,
Samplefmt: "fltp",
Sampling: 58483,
Layout: "atmos",
Channels: 4944,

View File

@@ -36,9 +36,10 @@ type ProgressIO struct {
Height uint64
// Audio
Sampling uint64
Layout string
Channels uint64
Samplefmt string
Sampling uint64
Layout string
Channels uint64
// avstream
AVstream *AVstream
@@ -65,6 +66,7 @@ func (p *ProgressIO) UnmarshalParser(pp *parse.ProgressIO) {
p.Quantizer = pp.Quantizer
p.Width = pp.Width
p.Height = pp.Height
p.Samplefmt = pp.Samplefmt
p.Sampling = pp.Sampling
p.Layout = pp.Layout
p.Channels = pp.Channels
@@ -99,6 +101,7 @@ func (p *ProgressIO) MarshalParser() parse.ProgressIO {
Quantizer: p.Quantizer,
Width: p.Width,
Height: p.Height,
Samplefmt: p.Samplefmt,
Sampling: p.Sampling,
Layout: p.Layout,
Channels: p.Channels,

View File

@@ -37,6 +37,7 @@ func TestProgressIO(t *testing.T) {
Quantizer: 2.3,
Width: 4848,
Height: 9373,
Samplefmt: "fltp",
Sampling: 4733,
Layout: "atmos",
Channels: 83,
@@ -81,6 +82,7 @@ func TestProgressIOWithAVstream(t *testing.T) {
Quantizer: 2.3,
Width: 4848,
Height: 9373,
Samplefmt: "fltp",
Sampling: 4733,
Layout: "atmos",
Channels: 83,
@@ -238,6 +240,7 @@ func TestProgress(t *testing.T) {
Quantizer: 2.3,
Width: 4848,
Height: 9373,
Samplefmt: "fltp",
Sampling: 4733,
Layout: "atmos",
Channels: 83,
@@ -304,6 +307,7 @@ func TestProgress(t *testing.T) {
Quantizer: 2.3,
Width: 4848,
Height: 9373,
Samplefmt: "fltp",
Sampling: 4733,
Layout: "atmos",
Channels: 83,