Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
I
IMGRender
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
IMGRender
Commits
3618d7b9
Commit
3618d7b9
authored
Jul 27, 2022
by
Linshizhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ffmpeg library.
parent
cbb2e83a
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
100 additions
and
4 deletions
+100
-4
.gitmodules
.gitmodules
+3
-0
BUILD.ffmpeg
BUILDS/BUILD.ffmpeg
+49
-0
BUILD.theft
BUILDS/BUILD.theft
+0
-1
WORKSPACE.bazel
WORKSPACE.bazel
+7
-0
ffmpeg
external/ffmpeg
+1
-0
prepare.sh
prepare.sh
+17
-0
BUILD.bazel
src/BUILD.bazel
+15
-2
canvas.cc
src/canvas.cc
+7
-1
BUILD.bazel
tests/BUILD.bazel
+1
-0
No files found.
.gitmodules
View file @
3618d7b9
...
...
@@ -7,3 +7,6 @@
[submodule "external/skia"]
path = external/skia
url = https://skia.googlesource.com/skia.git
[submodule "external/ffmpeg"]
path = external/ffmpeg
url = https://github.com/FFmpeg/FFmpeg.git
BUILDS/BUILD.ffmpeg
0 → 100644
View file @
3618d7b9
cc_import(
name = "avcodec",
hdrs = glob(["include/**/*.h"]),
static_library = "lib/libavcodec.a",
visibility = ["//visibility:public"]
)
cc_import(
name = "avdevice",
hdrs = glob(["include/**/*.h"]),
static_library = "lib/libavdevice.a",
visibility = ["//visibility:public"]
)
cc_import(
name = "avfilter",
hdrs = glob(["include/**/*.h"]),
static_library = "lib/libavfilter.a",
visibility = ["//visibility:public"]
)
cc_import(
name = "avformat",
hdrs = glob(["include/**/*.h"]),
static_library = "lib/libavformat.a",
visibility = ["//visibility:public"]
)
cc_import(
name = "avutil",
hdrs = glob(["include/**/*.h"]),
static_library = "lib/libavutil.a",
visibility = ["//visibility:public"]
)
cc_import(
name = "swresample",
hdrs = glob(["include/**/*.h"]),
static_library = "lib/libswresample.a",
visibility = ["//visibility:public"]
)
cc_import(
name = "swscale",
hdrs = glob(["include/**/*.h"]),
static_library = "lib/libswscale.a",
visibility = ["//visibility:public"]
)
BUILDS/BUILD.theft
View file @
3618d7b9
...
...
@@ -2,6 +2,5 @@ cc_library(
name = "theft",
srcs = glob(["src/*.c"]),
hdrs = glob(["inc/*.h", "src/*.h"]),
copts = ["-Iexternal/theft/inc", "-ltheft"],
visibility = ["//visibility:public"],
)
WORKSPACE.bazel
View file @
3618d7b9
...
...
@@ -19,3 +19,10 @@ new_local_repository(
path = "./external/build/skia",
build_file = "BUILDS/BUILD.skia"
)
# FFmpeg
new_local_repository(
name = "ffmpeg",
path = "./external/build/ffmpeg",
build_file = "BUILDS/BUILD.ffmpeg"
)
ffmpeg
@
81ebf40e
Subproject commit 81ebf40efa47b7d11be060c551411dd5efd11a05
prepare.sh
View file @
3618d7b9
...
...
@@ -39,3 +39,20 @@ builds=$(find . | grep bazel | xargs)
if
[
!
-z
"
$builds
"
]
;
then
rm
$builds
fi
# Build ffmpeg
FFMPEG_BUILD_DIR
=
${
EXTERNAL_BUILD_DIR
}
/ffmpeg
FFMPEG_DIR
=
${
EXTERNAL_DIR
}
/ffmpeg
cd
$FFMPEG_DIR
./configure
--disable-programs
--enable-shared
make
-j
install
prefix
=
${
FFMPEG_BUILD_DIR
}
/dist
if
[
!
-d
"
${
FFMPEG_BUILD_DIR
}
"
]
;
then
mkdir
${
FFMPEG_BUILD_DIR
}
else
rm
-rf
${
FFMPEG_BUILD_DIR
}
/
*
fi
cp
-r
${
FFMPEG_DIR
}
/dist/include
${
FFMPEG_BUILD_DIR
}
/
cp
-r
${
FFMPEG_DIR
}
/dist/lib
${
FFMPEG_BUILD_DIR
}
/
src/BUILD.bazel
View file @
3618d7b9
...
...
@@ -3,8 +3,21 @@ cc_library(
name = "render",
srcs = ["canvas.cc"],
hdrs = ["canvas.h"],
deps = ["@skia//:skia_public"],
copts = ["-I./external/build/skia/", "-std=c++2a"],
deps = [
"@ffmpeg//:avformat",
"@skia//:skia_public",
"@ffmpeg//:avcodec",
"@ffmpeg//:avdevice",
"@ffmpeg//:avfilter",
"@ffmpeg//:avutil",
"@ffmpeg//:swresample",
"@ffmpeg//:swscale",
],
copts = [
"-I./external/ffmpeg/include",
"-I./external/skia/include",
"-std=c++2a"
],
visibility = [
"//app:__pkg__",
"//tests:__pkg__"
...
...
src/canvas.cc
View file @
3618d7b9
#include <stdio.h>
#include "include/core/SkCanvas.h"
#include "core/SkCanvas.h"
extern
"C"
{
#include "libavformat/avformat.h"
}
int
say
(
void
)
{
SkCanvas
canvas
=
SkCanvas
();
AVFormatContext
*
ctx
=
avformat_alloc_context
();
return
0
;
}
tests/BUILD.bazel
View file @
3618d7b9
...
...
@@ -6,6 +6,7 @@ cc_test(
srcs = ["check.cc"],
args = ["/home"],
copts = ["-I./src"],
linkopts = ["-lz", "-llzma"],
deps = [
"//src:render",
"@theft//:theft",
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment