forked from carlonluca/pot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PiOmxTextures.pro
313 lines (281 loc) · 9.67 KB
/
PiOmxTextures.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
#
# Project: PiOmxTextures
# Author: Luca Carlon
# Date: 12.03.2012
#
# Copyright (c) 2012, 2013 Luca Carlon. All rights reserved.
#
# This file is part of PiOmxTextures.
#
# PiOmxTextures is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PiOmxTextures is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with PiOmxTextures. If not, see <http://www.gnu.org/licenses/>.
#
# On the command line you can manually speciy some params.
# qmake "DEFINES+=[CONFIG_APP|CONFIG_LIB] [CONFIG_INCLUDE_FFMPEG]"
# Either CONFIG_LIB or CONFIG_APP.
#DEFINES += CONFIG_LIB
#DEFINES += CONFIG_APP
!contains(DEFINES, CONFIG_APP):!contains(DEFINES, CONFIG_LIB) {
error("Either add CONFIG_APP or CONFIG_LIB to DEFINES.")
}
QT += core core-private gui gui-private opengl quick quick-private
INCLUDEPATH += $$_PRO_FILE_PWD_/../LightLogger \
$$_PRO_FILE_PWD_/../LightSmartPtr
TARGET = PiOmxTextures
contains(DEFINES, CONFIG_LIB) {
TEMPLATE = lib
# Install headers.
headers.files = \
omx_mediaprocessor.h \
omx_textureprovider.h \
omx_qthread.h \
omx_globals.h \
lc_logging.h
headers.path = $$OUT_PWD/piomxtextures
omxplayer_headers.files = \
omxplayer_lib/OMXStreamInfo.h
omxplayer_headers.path = $$OUT_PWD/piomxtextures/omxplayer_lib
#omxplayer_linux_headers.files = omxplayer_lib/linux/RBP.h
#omxplayer_linux_headers.path = $$OUT_PWD/piomxtextures/omxplayer_lib/linux
INSTALLS += headers omxplayer_headers
}
else:contains(DEFINES, CONFIG_APP) {
TEMPLATE = app
}
else {
error("Either config as app or lib.");
}
# External
LIBS += -lopenmaxil -lGLESv2 -lEGL -lbcm_host -lvcos -lrt -lv4l2
#LIBS += -lavformat -lavcodec -lavutil
# Internal
contains(DEFINES, CONFIG_INCLUDE_FFMPEG) {
LIBS += $$_PRO_FILE_PWD_/3rdparty/ffmpeg/lib/libavformat.a \
$$_PRO_FILE_PWD_/3rdparty/ffmpeg/lib/libavcodec.a \
$$_PRO_FILE_PWD_/3rdparty/ffmpeg/lib/libavutil.a \
$$_PRO_FILE_PWD_/3rdparty/ffmpeg/lib/libswscale.a \
$$_PRO_FILE_PWD_/3rdparty/ffmpeg/lib/libswresample.a \
-lz -lssl -lcrypto
}
else {
LIBS += -L$$_PRO_FILE_PWD_/3rdparty/ffmpeg/lib \
-lavformat -lavcodec -lavutil -lswscale -lswresample
}
INCLUDEPATH += $$_PRO_FILE_PWD_/3rdparty/ffmpeg/include
# Add this if building with old firmware.
INCLUDEPATH += /opt/rpi/sysroot/opt/vc/include/interface/vmcs_host/linux
# For omxplayer.
LIBS += -lfreetype -lWFC -lpcre
INCLUDEPATH += /usr/include/freetype2
CONFIG += link_pkgconfig
PKGCONFIG += freetype2
INCLUDEPATH += \
omx_wrapper \
ilclient \
3rdparty/include
INCLUDEPATH += \
omxplayer_lib \
omxplayer_lib/utils \
omxplayer_lib/linux
VERSION = 4.3.0
# Flags used by hello_pi examples:
#-DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS
# -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE
# -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -DHAVE_LIBOPENMAX=2 -DOMX
# -DOMX_SKIP64BIT -ftree-vectorize -pipe -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST
# -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM -Wno-psabi
DEFINES += __STDC_CONSTANT_MACROS \
__STDC_LIMIT_MACROS \
TARGET_POSIX \
TARGET_LINUX \
PIC \
_REENTRANT \
_LARGEFILE64_SOURCE \
_FILE_OFFSET_BITS=64 \
HAVE_LIBOPENMAX=2 \
OMX \
OMX_SKIP64BIT \
USE_EXTERNAL_OMX \
HAVE_LIBBCM_HOST \
USE_EXTERNAL_LIBBCM_HOST \
USE_VCHIQ_ARM \
HAVE_OMXLIB
# Macro definitions
#DEFINES += LOG_LEVEL_DEBUG
DEFINES += VERBOSE
DEFINES += ENABLE_VIDEO_TEST
DEFINES += ENABLE_MEDIA_PROCESSOR
# This is related to modifications to omxplayer merged to PiOmxTextures that seemed
# to perform badly. After some revisions these seem to be acceptable and were kept
# to keep sources in sync with omxplayer code.
DEFINES += ENABLE_IMPROVED_BUFFERING
# To enable subtitles.
#DEFINES += ENABLE_SUBTITLES
# Enable this to monitor performance of the main loop in omx_mediaprocessor.h. Can
# also be enabled in omx_mediaprocessor.h.
#DEFINES += ENABLE_PROFILE_MAIN_LOOP
# This enables pause/resume implmentation in the main loop in omx_mediaprocessor.h.
# This code was removed because too much computation in that loop seems to cause
# too much CPU load which causes repeated pause/resume. A couple of ms are spared
# avoiding the computation and only small interruptions seem to give a better result.
# Can also be enabled in omx_mediaprocessor.h.
#DEFINES += ENABLE_PAUSE_FOR_BUFFERING
# This enables logs coming from omxplayer core.
#DEFINES += ENABLE_OMXPLAYER_LOGS
# For omxplayer.
QMAKE_CXXFLAGS += -std=c++11 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS \
-DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE \
-D_FILE_OFFSET_BITS=64 -DHAVE_CMAKE_CONFIG -D__VIDEOCORE4__ \
-U_FORTIFY_SOURCE -DUSE_EXTERNAL_FFMPEG -DHAVE_LIBAVCODEC_AVCODEC_H \
-DHAVE_LIBAVUTIL_OPT_H -DHAVE_LIBSWRESAMPLE_SWRESAMPLE_H -DHAVE_LIBAVUTIL_MEM_H \
-DHAVE_LIBAVUTIL_AVUTIL_H \
-DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DOMX -DOMX_SKIP64BIT \
-ftree-vectorize -DUSE_EXTERNAL_OMX -DTARGET_RASPBERRY_PI -DUSE_EXTERNAL_LIBBCM_HOST \
-Wno-deprecated-declarations -Wno-missing-field-initializers -Wno-ignored-qualifiers \
-Wno-psabi -Wno-unused-parameter
# [1]: part of implementation without omxplayer.
contains(DEFINES, CONFIG_APP) {
SOURCES += \
main.cpp \
# main_ffmpeg.cpp \
# main_v4l2.cpp \
# main_demux.cpp \
# main_omxplayer.cpp
}
SOURCES += \
openmaxiltextureloader.cpp \
omx_wrapper/Locker.cpp \
omx_wrapper/Event.cpp \
omx_wrapper/OMXComponent.cpp \
# glwidget.cpp \
# ilclient/ilcore.c \
# ilclient/ilclient.c \
# video.cpp \
omx_wrapper/omxtunnel.cpp \
omx_imageelement.cpp \
omx_videosurfaceelement.cpp \
# omx_texturedelement.cpp \
# omx_videoprocessor.cpp \ # [1]
omx_camerasurfaceelement.cpp \
omx_audioprocessor.cpp \
omx_mediaprocessor.cpp \
# omx_videograph.cpp \ # [1]
omx_wrapper/OMX_Core.cpp \
omx_mediaprocessorelement.cpp \
omx_globals.cpp \
omx_textureprovider.cpp \
omx_playeraudio.cpp \
omx_reader.cpp
# This is the PiOmxTextures implementation of the logging class
# in omxplayer.
SOURCES += omx_omxplayer_logging.cpp
SOURCES += \
omxplayer_lib/Srt.cpp \
omxplayer_lib/Unicode.cpp \
omxplayer_lib/SubtitleRenderer.cpp \
omxplayer_lib/OMXVideo.cpp \
omxplayer_lib/OMXThread.cpp \
omxplayer_lib/OMXSubtitleTagSami.cpp \
omxplayer_lib/OMXStreamInfo.cpp \
omxplayer_lib/OMXReader.cpp \
omxplayer_lib/OMXPlayerVideo.cpp \
omxplayer_lib/OMXPlayerSubtitles.cpp \
omxplayer_lib/OMXPlayerAudio.cpp \
# omxplayer_lib/omxplayer.cpp \
omxplayer_lib/OMXOverlayCodecText.cpp \
omxplayer_lib/OMXCore.cpp \
omxplayer_lib/OMXClock.cpp \
omxplayer_lib/OMXAudioCodecOMX.cpp \
omxplayer_lib/OMXAudio.cpp \
omxplayer_lib/File.cpp \
omxplayer_lib/DynamicDll.cpp \
omxplayer_lib/BitstreamConverter.cpp \
omxplayer_lib/linux/XMemUtils.cpp \
omxplayer_lib/linux/RBP.cpp \
omxplayer_lib/utils/RegExp.cpp \
omxplayer_lib/utils/PCMRemap.cpp
# Define log.cpp only if you want to use the omxplayer CLog
# implementation. Otherwise use omx_omxplayer_loggin.cpp.
#SOURCES += omxplayer_lib/utils/log.cpp
HEADERS += \
openmaxiltextureloader.h \
omx_wrapper/Locker.h \
omx_wrapper/ILocker.h \
omx_wrapper/IEvent.h \
omx_wrapper/Event.h \
omx_wrapper/OMXComponent.h \
omx_wrapper/MyDeleter.h \
# glwidget.h \
# ilclient/ilclient.h \
omx_wrapper/omxtunnel.h \
omx_imageelement.h \
omx_videosurfaceelement.h \
# omx_texturedelement.h \ # [1]
# omx_videoprocessor.h \
omx_camerasurfaceelement.h \
omx_texture.h \
omx_qthread.h \
omx_audioprocessor.h \
omx_globals.h \
omx_mediaprocessor.h \
# omx_videograph.h \ # [1]
omxplayer_lib/DllOMX.h \
omxplayer_lib/DllAvFormat.h \
omxplayer_lib/BitstreamConverter.h \
omxplayer_lib/OMXSubtitleTagSami.h \
omxplayer_lib/system.h \
omx_wrapper/OMX_Core.h \
omxplayer_lib/DllSwResample.h \
omxplayer_lib/DllAvUtil.h \
omxplayer_lib/DllAvCodec.h \
omx_mediaprocessorelement.h \
omx_textureprovider.h \
omx_playeraudio.h \
omx_reader.h
HEADERS += \
omxplayer_lib/Unicode.h \
omxplayer_lib/SubtitleRenderer.h \
omxplayer_lib/OMXVideo.h \
omxplayer_lib/OMXThread.h \
omxplayer_lib/OMXStreamInfo.h \
omxplayer_lib/OMXReader.h \
omxplayer_lib/OMXPlayerVideo.h \
omxplayer_lib/OMXPlayerSubtitles.h \
omxplayer_lib/OMXPlayerAudio.h \
omxplayer_lib/OMXCore.h \
omxplayer_lib/OMXClock.h \
omxplayer_lib/OMXAudioCodecOMX.h \
omxplayer_lib/OMXAudio.h \
omxplayer_lib/File.h \
omxplayer_lib/DynamicDll.h \
omxplayer_lib/linux/XMemUtils.h \
omxplayer_lib/linux/RBP.h \
omxplayer_lib/utils/RegExp.h \
omxplayer_lib/utils/PCMRemap.h \
omxplayer_lib/utils/log.h
OTHER_FILES += \
main.qml \
changelog.txt \
main_v4l2.cpp \
tools/compile_ffmpeg.sh \
tools/extract_aac_stream.sh \
tools/extract_h264_stream.sh \
tools/prepare_openmaxil_backend.sh \
omxplayer_lib/omxplayer.cpp \
omxplayer_lib/Keyboard.h \
omxplayer_lib/Keyboard.cpp \
omxplayer_lib/OMXPLAYER_VERSION \
OMX_CrossImage.qml
contains(DEFINES, CONFIG_APP) {
RESOURCES += resources.qrc
}