-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathFFmpegHapGlPlayer.pro
169 lines (134 loc) · 4.51 KB
/
FFmpegHapGlPlayer.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# Setup
TEMPLATE = app
CONFIG += console c++11
CONFIG -= app_bundle
CONFIG -= qt
# Turn this off to skip runtime info log
DEFINES += LOG_RUNTIME_INFO
# Sources
HEADERS += \
src/HAPAvFormatOpenGLRenderer.h \
src/hap/hap.h \
src/glad/glad.h
SOURCES += \
src/HAPAvFormatOpenGLRenderer.cpp \
src/main.cpp \
src/hap/hap.c \
src/glad/glad.c
EXECUTABLE_PATH = $${OUT_PWD}/$${TARGET}
mac {
# Dependencies pathes
FFMPEGPATH = $$_PRO_FILE_PWD_/dependencies/Mac/x86_64/ffmpeg
INCLUDEPATH += $${FFMPEGPATH}/include
SNAPPY_PATH = $$_PRO_FILE_PWD_/dependencies/Mac/x86_64/snappy
INCLUDEPATH += $${SNAPPY_PATH}/include
SDL_PATH = $$_PRO_FILE_PWD_/dependencies/Mac/x86_64/SDL2
# FFMPEG
FFMPEGLIBPATH = $${FFMPEGPATH}/lib
LIBS += $${FFMPEGLIBPATH}/libavcodec.a
LIBS += $${FFMPEGLIBPATH}/libavdevice.a
LIBS += $${FFMPEGLIBPATH}/libavformat.a
LIBS += $${FFMPEGLIBPATH}/libavutil.a
LIBS += $${FFMPEGLIBPATH}/libswresample.a
LIBS += $${FFMPEGLIBPATH}/libswscale.a
LIBS += -framework VideoDecodeAcceleration
LIBS += -framework AudioToolbox
LIBS += -framework CoreFoundation
LIBS += -framework CoreVideo
LIBS += -framework CoreMedia
LIBS += -framework VideoToolbox
LIBS += -framework Security
LIBS += -lz
LIBS += -lbz2
LIBS += /usr/lib/libiconv.dylib
LIBS += /usr/lib/liblzma.dylib
# SDL
SDL_LIB_PATH = $${SDL_PATH}/lib/
INCLUDEPATH += $${SDL_LIB_PATH}/SDL2.framework/Headers
QMAKE_LFLAGS += -F$${SDL_LIB_PATH}
LIBS += -framework SDL2
QMAKE_POST_LINK += install_name_tool -change @rpath/SDL2.framework/Versions/A/SDL2 $${SDL_LIB_PATH}/SDL2.framework/Versions/A/SDL2 $${EXECUTABLE_PATH};
# Snappy
SNAPPY_LIB_PATH = $${SNAPPY_PATH}/lib
LIBS += $${SNAPPY_LIB_PATH}/libsnappy.dylib
QMAKE_POST_LINK += install_name_tool -change @rpath/libsnappy.dylib $${SNAPPY_LIB_PATH}/libsnappy.dylib $${EXECUTABLE_PATH};
# OpenGL
LIBS += -framework OpenGL
}
windows {
# Dependencies pathes
FFMPEGPATH = $$_PRO_FILE_PWD_/dependencies/Windows/x86_64/ffmpeg
INCLUDEPATH += $${FFMPEGPATH}/include
SNAPPY_PATH = $$_PRO_FILE_PWD_/dependencies/Windows/x86_64/snappy
INCLUDEPATH += $${SNAPPY_PATH}/include
SDL_PATH = $$_PRO_FILE_PWD_/dependencies/Windows/x86_64/SDL2
# FFMPEG
FFMPEGLIBPATH = $${FFMPEGPATH}/lib
LIBS += $${FFMPEGLIBPATH}/avcodec-lav.lib
LIBS += $${FFMPEGLIBPATH}/avformat-lav.lib
LIBS += $${FFMPEGLIBPATH}/avutil-lav.lib
# SDL
INCLUDEPATH += $${SDL_PATH}/include
SDL_LIB_PATH = $${SDL_PATH}/lib
LIBS += $${SDL_LIB_PATH}/SDL2.lib $${SDL_LIB_PATH}/SDL2main.lib
# Snappy
SNAPPY_LIB_PATH = $${SNAPPY_PATH}/lib
CONFIG(release, debug|release) {
LIBS += $${SNAPPY_LIB_PATH}/snappy.lib
} else {
LIBS += $${SNAPPY_LIB_PATH}/snappyd.lib
}
# OpenGL
LIBS += -lopengl32
}
linux {
# seems to be broken
CC = clang
CXX = clang
CFLAGS += -fblocks
CXXFLAGS += -fblocks
# important flag ;-)
DEFINES += Linux
# Dependencies pathes
# no change needed (works for me ...)
# Linux build is broken.
# Since the changes above don't work, you'll need to manually tweak the Makefile at the end
#
# clang IS mandatory to build HAPAvFormatOpenGLRenderer.cpp
# replace CC = gcc with the line : CC = clang
# replace CXX = g++ with the line : CXX = clang
# replace the line CFLAGS = -m64 -pipe with the line : CFLAGS = -m64 -fblock -pipe
# replace the line CXXFLAGS = -m64 -pipe with the line : CFLAGS = -m64 -fblock -pipe
# do not modify the LIBRARY_PATH. Should work without change anything
# OpenGL
LIBS += -lGL
# libpthread :
LIBS += -lpthread
# libdl :
LIBS += -ldl
# libsnappy
SNAPPY_LIB_PATH = $${SNAPPY_PATH}/lib
LIBS += -lsnappy
# libdispatch
LIBS += -ldispatch
# BlocksRuntime
LIBS += -lBlocksRuntime
# ffmpeg :
LIBS += `pkg-config --cflags --libs libavformat libavcodec libavutil`
# SDL2 :
LIBS += `sdl2-config --cflags --libs`
}
# Copy shaders folder next to executable (if the executable is not at project root)
!equals(_PRO_FILE_PWD_,OUT_PWD) {
windows {
QMAKE_POST_LINK += xcopy /S /I /E \"$$_PRO_FILE_PWD_/shaders\" \"$${OUT_PWD}\\\";
}
!windows {
QMAKE_POST_LINK += cp -R $$_PRO_FILE_PWD_/shaders $${OUT_PWD};
}
}
DISTFILES += \
shaders/Default.frag \
shaders/ScaledCoCgYPlusAToRGBA.frag \
shaders/ScaledCoCgYToRGBA.frag \
shaders/Default.vert