From 834b509801375c29aa85da612d8ef29fb8146fbb Mon Sep 17 00:00:00 2001 From: zergon321 Date: Wed, 26 Jul 2023 20:25:17 +0300 Subject: [PATCH] pkg-config directives added to the dependent files. --- audioframe.go | 9 +++++++++ examples/player/Dockerfile | 20 ++++++++++++++++++++ frame.go | 8 ++++++++ unknown.go | 8 ++++++++ video.go | 2 +- videoframe.go | 8 ++++++++ 6 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 examples/player/Dockerfile diff --git a/audioframe.go b/audioframe.go index baeb1b1..c019056 100644 --- a/audioframe.go +++ b/audioframe.go @@ -1,5 +1,14 @@ package reisen +// #cgo pkg-config: libavutil libavformat libavcodec libswscale +// #include +// #include +// #include +// #include +// #include +// #include +import "C" + // AudioFrame is a data frame // obtained from an audio stream. type AudioFrame struct { diff --git a/examples/player/Dockerfile b/examples/player/Dockerfile new file mode 100644 index 0000000..f34c934 --- /dev/null +++ b/examples/player/Dockerfile @@ -0,0 +1,20 @@ +# Use the official Golang image as the base image +FROM golang:1.20.5-alpine3.18 AS builder + +# Set the working directory inside the container +WORKDIR /app + +# Install necessary packages +RUN apk add ffmpeg + +# Copy the Go module files +COPY go.mod go.sum ./ + +# Download and cache the Go module dependencies +RUN go mod download + +# Copy the source code into the container +COPY . . + +# Build the Go application +RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o vidstreamsplit . \ No newline at end of file diff --git a/frame.go b/frame.go index 58a9460..277ffc5 100644 --- a/frame.go +++ b/frame.go @@ -1,5 +1,13 @@ package reisen +// #cgo pkg-config: libavutil libavformat libavcodec libswscale +// #include +// #include +// #include +// #include +// #include +// #include +import "C" import ( "fmt" "time" diff --git a/unknown.go b/unknown.go index b7315a5..d73d133 100755 --- a/unknown.go +++ b/unknown.go @@ -1,5 +1,13 @@ package reisen +// #cgo pkg-config: libavutil libavformat libavcodec libswscale +// #include +// #include +// #include +// #include +// #include +// #include +import "C" import ( "fmt" ) diff --git a/video.go b/video.go index 1e1ff5a..4b234bb 100755 --- a/video.go +++ b/video.go @@ -1,6 +1,6 @@ package reisen -// #cgo pkg-config: libavutil libavformat libavformat libswscale +// #cgo pkg-config: libavutil libavformat libavcodec libswscale // #include // #include // #include diff --git a/videoframe.go b/videoframe.go index 8726a12..faff46c 100644 --- a/videoframe.go +++ b/videoframe.go @@ -1,5 +1,13 @@ package reisen +// #cgo pkg-config: libavutil libavformat libavcodec libswscale +// #include +// #include +// #include +// #include +// #include +// #include +import "C" import "image" // VideoFrame is a single frame