Guest User

Native compile of github.com/Stasik0/omxplayer

a guest
Jan 6th, 2013
227
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Native compile of github.com/Stasik0/omxplayer
  2. 0) sudo apt-get install ca-certificates git-core binutils libva1 libpcre3-dev libidn11-dev libboost1.50-dev libfreetype6-dev libusb-1.0-0-dev
  3. 1) compile libboblight
  4. 1.1) svn checkout http://boblight.googlecode.com/svn/trunk/ boblight-read-only
  5. 1.2) cd boblight-read-only
  6. 1.3) ./configure CXXFLAGS="${CXXFLAGS} -march=armv6 -mfpu=vfp -mfloat-abi=hard" --without-portaudio --without-opengl --without-x11 --prefix=/usr
  7. 1.4) make && make install
  8. 2) compile omxplayer
  9. Files:
  10. -Makefile-
  11. include Makefile.include
  12.  
  13. CFLAGS+=-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 -DHAVE_CMAKE_CONFIG -D__VIDEOCORE4__ -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG -DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_OPT_H -DHAVE_LIBAVUTIL_MEM_H -DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DOMX -DOMX_SKIP64BIT -ftree-vectorize -pipe -DUSE_EXTERNAL_OMX -DTARGET_RASPBERRY_PI -DUSE_EXTERNAL_LIBBCM_HOST -Wno-psabi -I$(SDKSTAGE)/opt/vc/include/
  14.  
  15. LDFLAGS+=-L./ -lc -lWFC -lGLESv2 -lEGL -lbcm_host -lopenmaxil -Lffmpeg_compiled/usr/local/lib/
  16. INCLUDES+=-I./ -Ilinux -Iffmpeg
  17.  
  18.  
  19. SRC=linux/XMemUtils.cpp \
  20. utils/log.cpp \
  21. DynamicDll.cpp \
  22. utils/PCMRemap.cpp \
  23. utils/RegExp.cpp \
  24. OMXSubtitleTagSami.cpp \
  25. OMXOverlayCodecText.cpp \
  26. BitstreamConverter.cpp \
  27. linux/RBP.cpp \
  28. OMXThread.cpp \
  29. OMXReader.cpp \
  30. OMXStreamInfo.cpp \
  31. OMXAudioCodecOMX.cpp \
  32. OMXCore.cpp \
  33. OMXVideo.cpp \
  34. OMXAudio.cpp \
  35. OMXClock.cpp \
  36. File.cpp \
  37. OMXPlayerVideo.cpp \
  38. OMXPlayerAudio.cpp \
  39. OMXPlayerSubtitles.cpp \
  40. SubtitleRenderer.cpp \
  41. Unicode.cpp \
  42. omxplayer.cpp \
  43.  
  44. OBJS+=$(filter %.o,$(SRC:.cpp=.o))
  45.  
  46. all: omxplayer.bin
  47.  
  48. %.o: %.cpp
  49. @rm -f $@
  50. $(CXX) $(CFLAGS) $(INCLUDES) -c $< -o $@ -Wno-deprecated-declarations
  51.  
  52. list_test:
  53. $(CXX) -O3 -o list_test list_test.cpp
  54.  
  55. omxplayer.bin: $(OBJS)
  56. $(CXX) $(LDFLAGS) -o omxplayer.bin $(OBJS) -lvchiq_arm -lvcos -lrt -lpthread -lavutil -lavcodec -lavformat -lswscale -lpcre
  57. strip omxplayer.bin
  58.  
  59. clean:
  60. for i in $(OBJS); do (if test -e "$$i"; then ( rm $$i ); fi ); done
  61. @rm -f omxplayer.old.log omxplayer.log
  62. @rm -f omxplayer.bin
  63. @rm -rf omxplayer-dist
  64. @rm -f omxplayer-dist.tar.gz
  65.  
  66. ffmpeg:
  67. make -f Makefile.ffmpeg
  68. make -f Makefile.ffmpeg install
  69.  
  70. omxplayer-dist.tar.gz: omxplayer.bin
  71. echo
  72.  
  73. dist: omxplayer.bin
  74. mkdir -p $(TARGETFS)/lib
  75. mkdir -p $(TARGETFS)/bin
  76. mkdir -p $(TARGETFS)/share/doc
  77. cp omxplayer omxplayer.bin $(TARGETFS)/bin
  78. cp COPYING $(TARGETFS)/share/doc/
  79. cp README.md $(TARGETFS)/share/doc/README
  80. cp -a ffmpeg_compiled/usr/local/lib/*.so* $(TARGETFS)/lib/
  81. @rm -f omxplayer-dist.tar.gz
  82. tar -czf omxplayer-dist.tar.gz usr
  83.  
  84. sources-clean:
  85. @rm -rf firmware
  86. @rm -rf ffmpeg
  87.  
  88. -Makefile.include- (you might want to play with RASPBIAN variable)
  89. RASPBIAN=1
  90.  
  91. ifeq ($(RASPBIAN), 1)
  92. CFLAGS += -std=c++0x -pipe -mfloat-abi=hard -mcpu=arm1176jzf-s -fomit-frame-pointer -mabi=aapcs-linux -mtune=arm1176jzf-s -mfpu=vfp -Wno-psabi -mno-apcs-stack-check -O3 -mstructure-size-boundary=32 -mno-sched-prolog -march=armv6zk
  93. else
  94. CFLAGS += -std=c++0x -pipe -mfloat-abi=softfp -fomit-frame-pointer -mabi=aapcs-linux -Wno-psabi -mno-apcs-stack-check -O3 -mstructure-size-boundary=32 -mno-sched-prolog -march=armv6zk
  95. endif
  96.  
  97.  
  98. BUILDROOT :=/usr/local/src/omxplayer
  99. TARGETFS :=usr/local
  100. TOOLCHAIN :=/usr/
  101. LD := $(TOOLCHAIN)/bin/ld
  102. CC := $(TOOLCHAIN)/bin/gcc
  103. CXX := $(TOOLCHAIN)/bin/g++
  104. OBJDUMP := $(TOOLCHAIN)/bin/objdump
  105. RANLIB := $(TOOLCHAIN)/bin/ranlib
  106. STRIP := $(TOOLCHAIN)/bin/strip
  107. AR := $(TOOLCHAIN)/bin/ar
  108. CXXCP := $(CXX) -E
  109.  
  110. LDFLAGS += -L$(BUILDROOT)/firmware/opt/vc/lib -L$(BUILDROOT)/ffpmeg -L/lib -L/usr/lib -lfreetype -lboblight
  111. INCLUDES += -I$(BUILDROOT)/firmware/opt/vc/include/interface/vcos/pthreads \
  112. -I$(BUILDROOT)/firmware/opt/vc/include \
  113. -I$(BUILDROOT)/firmware/opt/vc/include/interface/vmcs_host \
  114. -I$(BUILDROOT)/ffmpeg \
  115. -I/usr/include \
  116. -I/usr/include/freetype2
  117.  
  118. -Makefile.ffmpeg-
  119. include Makefile.include
  120.  
  121. FLAGS=-D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_HAVE_SBRK -D_LARGEFILE64_SOURCE -DHAVE_CMAKE_CONFIG -DHAVE_VMCS_CONFIG -D_REENTRANT -DUSE_VCHIQ_ARM -DVCHI_BULK_ALIGN=1 -DVCHI_BULK_GRANULARITY=1 -DEGL_SERVER_DISPMANX -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__VIDEOCORE4__ -DGRAPHICS_X_VG=1 -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG -DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_MEM_H -DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DOMX -DOMX_SKIP64BIT
  122. WORK=$(PWD)
  123.  
  124. all: checkout configure compile
  125.  
  126. copy:
  127. find ffmpeg -name '*.so*' -exec cp {} . \;
  128. $(HOST)-strip *.so*
  129.  
  130. compile:
  131. cd ffmpeg; \
  132. make
  133.  
  134. configure:
  135. cd ffmpeg; \
  136. CFLAGS="$(CFLAGS) ${INCLUDES}" \
  137. LDFLAGS="" \
  138. ./configure \
  139. --enable-shared \
  140. --disable-static \
  141. --target-os=linux \
  142. --disable-muxers \
  143. --enable-muxer=spdif \
  144. --enable-muxer=adts \
  145. --disable-encoders \
  146. --enable-encoder=ac3 \
  147. --enable-encoder=aac \
  148. --disable-decoder=mpeg_xvmc \
  149. --disable-devices \
  150. --disable-ffprobe \
  151. --disable-ffserver \
  152. --disable-ffmpeg \
  153. --enable-shared \
  154. --enable-postproc \
  155. --enable-gpl \
  156. --enable-protocol=http \
  157. --enable-pthreads \
  158. --disable-runtime-cpudetect \
  159. --enable-pic \
  160. --disable-neon \
  161. --enable-armv6t2 \
  162. --enable-armv6 \
  163. --enable-armvfp \
  164. --enable-hardcoded-tables \
  165. --disable-runtime-cpudetect \
  166. --disable-debug
  167.  
  168. clean:
  169. make clean
  170. checkout:
  171.  
  172. install:
  173. cd ffmpeg; make DESTDIR="$(WORK)/ffmpeg_compiled" install
  174. strip ffmpeg_compiled/usr/local/lib/*.so
  175.  
  176. sources:
  177. git clone https://github.com/raspberrypi/firmware.git
  178. git clone git://git.videolan.org/ffmpeg.git ffmpeg;
  179. cd ffmpeg; git checkout master; git checkout 13a7bd70c8d94c5a46c14e7ac23a170b77eff52e
  180.  
  181. install: omxplayer-dist.tar.gz
  182. tar xf omxplayer-dist.tar.gz -C /
  183. ldconfig
  184.  
  185. uninstall:
  186. ./uninstall.sh
  187.  
  188. 2.1) make sources
  189. make -f Makefile.ffmpeg
  190. make -f Makefile.ffmpeg install
  191. make
  192. make dist
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×