Skip to content

Commit

Permalink
change: move GetVersion() from mp4 to internal
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbee committed Nov 12, 2024
1 parent bdcff7e commit 5db7c0a
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 12 deletions.
3 changes: 2 additions & 1 deletion cmd/mp4ff-crop/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"
"sort"

"github.com/Eyevinn/mp4ff/internal"
"github.com/Eyevinn/mp4ff/mp4"
)

Expand Down Expand Up @@ -62,7 +63,7 @@ func run(args []string, stdout io.Writer) error {
}

if o.version {
fmt.Fprintf(stdout, "%s %s\n", appName, mp4.GetVersion())
fmt.Fprintf(stdout, "%s %s\n", appName, internal.GetVersion())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion cmd/mp4ff-decrypt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io"
"os"

"github.com/Eyevinn/mp4ff/internal"
"github.com/Eyevinn/mp4ff/mp4"
)

Expand Down Expand Up @@ -61,7 +62,7 @@ func run(args []string) error {
}

if opts.version {
fmt.Printf("%s %s\n", appName, mp4.GetVersion())
fmt.Printf("%s %s\n", appName, internal.GetVersion())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion cmd/mp4ff-encrypt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io"
"os"

"github.com/Eyevinn/mp4ff/internal"
"github.com/Eyevinn/mp4ff/mp4"
)

Expand Down Expand Up @@ -72,7 +73,7 @@ func run(args []string) error {
}

if opts.version {
fmt.Printf("%s %s\n", appName, mp4.GetVersion())
fmt.Printf("%s %s\n", appName, internal.GetVersion())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion cmd/mp4ff-info/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io"
"os"

"github.com/Eyevinn/mp4ff/internal"
"github.com/Eyevinn/mp4ff/mp4"
)

Expand Down Expand Up @@ -59,7 +60,7 @@ func run(args []string, w io.Writer) error {
}

if opts.version {
fmt.Printf("%s %s\n", appName, mp4.GetVersion())
fmt.Printf("%s %s\n", appName, internal.GetVersion())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion cmd/mp4ff-nallister/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/Eyevinn/mp4ff/avc"
"github.com/Eyevinn/mp4ff/hevc"
"github.com/Eyevinn/mp4ff/internal"
"github.com/Eyevinn/mp4ff/mp4"
"github.com/Eyevinn/mp4ff/sei"
)
Expand Down Expand Up @@ -80,7 +81,7 @@ func run(args []string, stdout io.Writer) error {
}

if o.version {
fmt.Fprintf(stdout, "%s %s\n", appName, mp4.GetVersion())
fmt.Fprintf(stdout, "%s %s\n", appName, internal.GetVersion())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion cmd/mp4ff-pslister/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/Eyevinn/mp4ff/avc"
"github.com/Eyevinn/mp4ff/hevc"
"github.com/Eyevinn/mp4ff/internal"
"github.com/Eyevinn/mp4ff/mp4"
)

Expand Down Expand Up @@ -75,7 +76,7 @@ func run(args []string, stdout io.Writer) error {
}

if o.version {
fmt.Fprintf(stdout, "%s %s\n", appName, mp4.GetVersion())
fmt.Fprintf(stdout, "%s %s\n", appName, internal.GetVersion())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion cmd/mp4ff-subslister/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io"
"os"

"github.com/Eyevinn/mp4ff/internal"
"github.com/Eyevinn/mp4ff/mp4"
)

Expand Down Expand Up @@ -64,7 +65,7 @@ func run(args []string, stdout io.Writer) error {
}

if o.version {
fmt.Fprintf(stdout, "%s %s\n", appName, mp4.GetVersion())
fmt.Fprintf(stdout, "%s %s\n", appName, internal.GetVersion())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion examples/add-sidx/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io"
"os"

"github.com/Eyevinn/mp4ff/internal"
"github.com/Eyevinn/mp4ff/mp4"
)

Expand Down Expand Up @@ -67,7 +68,7 @@ func run(args []string, stdout io.Writer) error {
}

if o.version {
fmt.Fprintf(stdout, "%s %s\n", appName, mp4.GetVersion())
fmt.Fprintf(stdout, "%s %s\n", appName, internal.GetVersion())
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions mp4/version.go → internal/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package mp4
package internal

import (
"fmt"
Expand All @@ -8,7 +8,7 @@ import (

var (
commitVersion string = "v0.46" // May be updated using build flags
commitDate string = "1723143113" // commitDate in Epoch seconds (may be overridden using build flags)
commitDate string = "1731409630" // commitDate in Epoch seconds (may be overridden using build flags)
)

// GetVersion - get version and also commitHash and commitDate if inserted via Makefile
Expand Down
4 changes: 2 additions & 2 deletions mp4/version_test.go → internal/version_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package mp4
package internal

import "fmt"

func ExampleGetVersion() {
fmt.Println(GetVersion())
// Output: v0.46, date: 2024-08-08
// Output: v0.46, date: 2024-11-12
}

0 comments on commit 5db7c0a

Please sign in to comment.