You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

720 lines
16 KiB

  1. #
  2. # Copyright (C) 2017-2018 Ian Leonard <antonlacon@gmail.com>
  3. # Copyright (C) 2018 Ted Hess <thess@kitschensync.net>
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=ffmpeg
  10. PKG_VERSION:=3.2.10
  11. PKG_RELEASE:=2
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_SOURCE_URL:=https://ffmpeg.org/releases/
  14. PKG_HASH:=3c1626220c7b68ff6be7312559f77f3c65ff6809daf645d4470ac0189926bdbc
  15. PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
  16. Ian Leonard <antonlacon@gmail.com>
  17. PKG_LICENSE:=LGPL-2.1+ GPL-2+ LGPL-3
  18. PKG_LICENSE_FILES:=COPYING.GPLv2 COPYING.GPLv3 COPYING.LGPLv2.1 COPYING.LGPLv3
  19. FFMPEG_CUSTOM_ENCODERS:= \
  20. ac3 \
  21. jpegls \
  22. mpeg1video \
  23. mpeg2video \
  24. mpeg4 \
  25. pcm_s16be \
  26. pcm_s16le \
  27. png \
  28. vorbis \
  29. zlib \
  30. FFMPEG_CUSTOM_DECODERS:= \
  31. aac \
  32. ac3 \
  33. alac \
  34. amrnb \
  35. amrwb \
  36. ape \
  37. atrac3 \
  38. flac \
  39. gif \
  40. h264 \
  41. hevc \
  42. jpegls \
  43. mp2 \
  44. mp3 \
  45. mpeg1video \
  46. mpeg2video \
  47. mpeg4 \
  48. mpegvideo \
  49. mpc7 \
  50. mpc8 \
  51. pcm_s16be \
  52. pcm_s16le \
  53. png \
  54. vc1 \
  55. vorbis \
  56. wavpack \
  57. wmav1 \
  58. wmav2 \
  59. zlib \
  60. FFMPEG_CUSTOM_MUXERS:= \
  61. ac3 \
  62. ffm \
  63. h264 \
  64. hevc \
  65. mp3 \
  66. mp4 \
  67. mpeg1video \
  68. mpeg2video \
  69. mpegts \
  70. ogg \
  71. rtp \
  72. FFMPEG_CUSTOM_DEMUXERS:= \
  73. aac \
  74. ac3 \
  75. amr \
  76. ape \
  77. avi \
  78. flac \
  79. ffm \
  80. h264 \
  81. hevc \
  82. matroska \
  83. mov \
  84. mp3 \
  85. mpegps \
  86. mpegts \
  87. mpegvideo \
  88. mpc \
  89. mpc8 \
  90. ogg \
  91. rm \
  92. rtsp \
  93. rtp \
  94. sdp \
  95. v4l2 \
  96. vc1 \
  97. wav \
  98. wv \
  99. FFMPEG_CUSTOM_PARSERS:= \
  100. aac \
  101. flac \
  102. ac3 \
  103. h264 \
  104. hevc \
  105. mpegaudio \
  106. mpeg4video \
  107. mpegvideo \
  108. vc1 \
  109. FFMPEG_CUSTOM_PROTOCOLS:= \
  110. file http icecast pipe rtp tcp udp
  111. FFMPEG_MINI_DECODERS:= \
  112. ac3 \
  113. flac \
  114. jpegls \
  115. mp2 \
  116. mp3 \
  117. mpeg1video \
  118. mpeg2video \
  119. mpeg4 \
  120. mpegvideo \
  121. opus \
  122. png \
  123. vorbis \
  124. FFMPEG_PATENTED_MINI_DECODERS:= \
  125. h264 \
  126. hevc \
  127. vc1 \
  128. FFMPEG_MINI_DEMUXERS:= \
  129. avi \
  130. flac \
  131. matroska \
  132. mov \
  133. mp3 \
  134. mpegps \
  135. mpegts \
  136. mpegvideo \
  137. ogg \
  138. FFMPEG_MINI_PROTOCOLS:= \
  139. file
  140. FFMPEG_AUDIO_DECODERS:= \
  141. ac3 \
  142. adpcm_* \
  143. alac \
  144. amrnb \
  145. amrwb \
  146. ape \
  147. atrac3 \
  148. flac \
  149. mp2 \
  150. mp3* \
  151. mpc7 \
  152. mpc8 \
  153. opus \
  154. pcm_* \
  155. vorbis \
  156. wavpack \
  157. zlib \
  158. FFMPEG_AUDIO_DEMUXERS:= \
  159. ac3 \
  160. aiff \
  161. amr \
  162. ape \
  163. avi \
  164. flac \
  165. ffm \
  166. matroska \
  167. mp3 \
  168. mov \
  169. mpc \
  170. mpc8 \
  171. mpegts \
  172. ogg \
  173. rm \
  174. rtsp \
  175. rtp \
  176. sdp \
  177. wav \
  178. wv \
  179. FFMPEG_AUDIO_PROTOCOLS:= \
  180. file http icecast rtp tcp udp
  181. FFMPEG_PATENTED_DECODERS:= \
  182. atrac3 \
  183. h264 \
  184. hevc \
  185. vc1 \
  186. FFMPEG_PATENTED_ENCODERS:=$(FFMPEG_PATENDED_DECODERS)
  187. FFMPEG_PATENTED_MUXERS:= \
  188. h264 \
  189. hevc \
  190. vc1 \
  191. FFMPEG_PATENTED_DEMUXERS:=$(FFMPEG_PATENTED_MUXERS)
  192. FFMPEG_PATENTED_PARSERS:= \
  193. h264 \
  194. hevc \
  195. vc1 \
  196. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  197. PKG_CONFIG_DEPENDS:= \
  198. $(patsubst %,CONFIG_FFMPEG_CUSTOM_ENCODER_%,$(FFMPEG_CUSTOM_ENCODERS)) \
  199. $(patsubst %,CONFIG_FFMPEG_CUSTOM_DECODER_%,$(FFMPEG_CUSTOM_DECODERS)) \
  200. $(patsubst %,CONFIG_FFMPEG_CUSTOM_MUXER_%,$(FFMPEG_CUSTOM_MUXERS)) \
  201. $(patsubst %,CONFIG_FFMPEG_CUSTOM_DEMUXER_%,$(FFMPEG_CUSTOM_DEMUXERS)) \
  202. $(patsubst %,CONFIG_FFMPEG_CUSTOM_PARSER_%,$(FFMPEG_CUSTOM_PARSERS)) \
  203. $(patsubst %,CONFIG_FFMPEG_CUSTOM_PROTOCOL_%,$(FFMPEG_CUSTOM_PROTOCOLS))
  204. include $(INCLUDE_DIR)/package.mk
  205. define Package/ffmpeg/Default
  206. TITLE:=FFmpeg
  207. URL:=https://ffmpeg.org/
  208. DEPENDS+= +libpthread
  209. endef
  210. define Package/ffmpeg/Default/description
  211. FFmpeg is a a software package that can record, convert and stream digital
  212. audio and video in numerous formats.
  213. FFmpeg licensing / patent issues are complex. It is the reponsibility of the
  214. user to understand any requirements in this regard with its usage. See:
  215. https://ffmpeg.org/legal.html for further information.
  216. endef
  217. define Package/ffmpeg
  218. $(call Package/ffmpeg/Default)
  219. SECTION:=multimedia
  220. CATEGORY:=Multimedia
  221. TITLE+= program
  222. DEPENDS+= +libffmpeg-full
  223. VARIANT:=full
  224. endef
  225. define Package/ffmpeg/description
  226. $(call Package/ffmpeg/Default/description)
  227. .
  228. This package contains the FFmpeg command line tool.
  229. endef
  230. define Package/ffprobe
  231. $(call Package/ffmpeg/Default)
  232. SECTION:=multimedia
  233. CATEGORY:=Multimedia
  234. TITLE+= CLI media identifier
  235. DEPENDS+= +libffmpeg-full
  236. VARIANT:=full
  237. endef
  238. define Package/ffprobe/description
  239. $(call Package/ffmpeg/Default/description)
  240. .
  241. This package contains the FFprobe command line tool.
  242. endef
  243. define Package/ffserver
  244. $(call Package/ffserver/Default)
  245. SECTION:=multimedia
  246. CATEGORY:=Multimedia
  247. TITLE+= streaming server
  248. DEPENDS+= +libffmpeg-full
  249. VARIANT:=full
  250. endef
  251. define Package/ffserver/description
  252. $(call Package/ffmpeg/Default/description)
  253. .
  254. This package contains the FFmpeg streaming server.
  255. endef
  256. define Package/libffmpeg/Default
  257. $(call Package/ffmpeg/Default)
  258. SECTION:=libs
  259. CATEGORY:=Libraries
  260. TITLE+= libraries
  261. DEPENDS+= +libpthread +zlib +libbz2
  262. PROVIDES:= libffmpeg
  263. endef
  264. # Package build suppressed when CONFIG_ALL=y
  265. define Package/libffmpeg-custom
  266. $(call Package/libffmpeg/Default)
  267. TITLE+= (custom)
  268. DEPENDS+= @!ALL \
  269. +FFMPEG_CUSTOM_SELECT_libopus:libopus \
  270. +PACKAGE_libx264:libx264 +PACKAGE_lame-lib:lame-lib \
  271. +FFMPEG_CUSTOM_SELECT_libshine:shine \
  272. +PACKAGE_fdk-aac:fdk-aac
  273. VARIANT:=custom
  274. MENU:=1
  275. endef
  276. define Package/libffmpeg-custom/config
  277. source "$(SOURCE)/Config.in"
  278. endef
  279. define Package/libffmpeg-custom/description
  280. $(call Package/ffmpeg/Default/description)
  281. .
  282. This package contains customized FFmpeg shared libraries.
  283. endef
  284. define Package/libffmpeg-audio-dec
  285. $(call Package/libffmpeg/Default)
  286. TITLE+= (audio)
  287. VARIANT:=audio-dec
  288. endef
  289. define Package/libffmpeg-audio-dec/description
  290. $(call Package/ffmpeg/Default/description)
  291. .
  292. This package contains FFmpeg shared libraries for audio decoding
  293. endef
  294. define Package/libffmpeg-full
  295. $(call Package/libffmpeg/Default)
  296. TITLE+= (full)
  297. DEPENDS+= +alsa-lib +PACKAGE_libopus:libopus
  298. ifeq ($(CONFIG_SOFT_FLOAT),y)
  299. DEPENDS+= +PACKAGE_shine:shine
  300. else
  301. DEPENDS+= +PACKAGE_lame-lib:lame-lib +PACKAGE_libx264:libx264
  302. endif
  303. VARIANT:=full
  304. endef
  305. define Package/libffmpeg-full/description
  306. $(call Package/ffmpeg/Default/description)
  307. .
  308. This package contains full-featured FFmpeg shared libraries.
  309. endef
  310. define Package/libffmpeg-mini
  311. $(call Package/libffmpeg/Default)
  312. TITLE+= (mini)
  313. VARIANT:=mini
  314. endef
  315. define Package/libffmpeg-mini/description
  316. $(call Package/ffmpeg/Default/description)
  317. .
  318. This package contains minimal-featured FFmpeg shared libraries.
  319. endef
  320. FFMPEG_CONFIGURE:= \
  321. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
  322. LDFLAGS="$(TARGET_LDFLAGS)" \
  323. ./configure \
  324. --enable-cross-compile \
  325. --cross-prefix="$(TARGET_CROSS)" \
  326. --arch="$(ARCH)" \
  327. --target-os=linux \
  328. --prefix="/usr" \
  329. --pkg-config="pkg-config" \
  330. --enable-shared \
  331. --enable-static \
  332. --enable-pthreads \
  333. --enable-zlib \
  334. --disable-doc \
  335. --disable-debug \
  336. \
  337. --disable-lzma \
  338. --disable-vaapi \
  339. --disable-vdpau \
  340. --disable-outdevs
  341. ifeq ($(CONFIG_SOFT_FLOAT),y)
  342. FFMPEG_CONFIGURE+= \
  343. --disable-altivec \
  344. --disable-vsx \
  345. --disable-power8 \
  346. --disable-armv5te \
  347. --disable-armv6 \
  348. --disable-armv6t2 \
  349. --disable-inline-asm \
  350. --disable-mipsdsp \
  351. --disable-mipsdspr2 \
  352. --disable-mipsfpu \
  353. --disable-msa \
  354. --disable-mmi \
  355. --disable-fast-unaligned \
  356. --disable-runtime-cpudetect
  357. else ifneq ($(findstring arm,$(CONFIG_ARCH)),)
  358. FFMPEG_CONFIGURE+= \
  359. --disable-runtime-cpudetect
  360. # XXX: GitHub issue 3320 ppc cpu with fpu but no altivec (WNDR4700)
  361. else ifneq ($(findstring powerpc,$(CONFIG_ARCH)),)
  362. FFMPEG_CONFIGURE+= \
  363. --disable-altivec
  364. endif
  365. # selectively disable optimizations according to arch/cpu type
  366. ifneq ($(findstring arm,$(CONFIG_ARCH)),)
  367. FFMPEG_CONFIGURE+= --enable-lto
  368. ifneq ($(findstring vfp,$(CONFIG_TARGET_OPTIMIZATION)),)
  369. FFMPEG_CONFIGURE+= --enable-vfp
  370. else
  371. FFMPEG_CONFIGURE+= --disable-vfp
  372. endif
  373. ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),)
  374. FFMPEG_CONFIGURE+= \
  375. --enable-neon \
  376. --enable-vfp
  377. else
  378. FFMPEG_CONFIGURE+= --disable-neon
  379. endif
  380. endif
  381. ifeq ($(ARCH),x86_64)
  382. FFMPEG_CONFIGURE+= --enable-lto
  383. endif
  384. ifneq ($(CONFIG_YASM),y)
  385. FFMPEG_CONFIGURE+= --disable-yasm
  386. endif
  387. ifeq ($(BUILD_VARIANT),full)
  388. FFMPEG_DISABLE= \
  389. $(foreach c, $(2), \
  390. --disable-$(1)="$(c)" \
  391. )
  392. FFMPEG_CONFIGURE+= \
  393. --enable-avresample \
  394. $(if $(CONFIG_BUILD_PATENTED),, \
  395. $(call FFMPEG_DISABLE,decoder,$(FFMPEG_PATENTED_DECODERS)) \
  396. $(call FFMPEG_DISABLE,encoder,$(FFMPEG_PATENTED_ENCODERS)) \
  397. $(call FFMPEG_DISABLE,muxer,$(FFMPEG_PATENTED_MUXERS)) \
  398. $(call FFMPEG_DISABLE,demuxer,$(FFMPEG_PATENTED_DEMUXERS)) \
  399. $(call FFMPEG_DISABLE,parser,$(FFMPEG_PATENTED_PARSERS))) \
  400. $(if $(CONFIG_PACKAGE_libopus),--enable-libopus)
  401. ifeq ($(CONFIG_SOFT_FLOAT),y)
  402. FFMPEG_CONFIGURE+= \
  403. --enable-small \
  404. \
  405. $(if $(CONFIG_PACKAGE_shine),--enable-libshine)
  406. else
  407. ifeq ($(ARCH),x86_64)
  408. FFMPEG_CONFIGURE+= --enable-hardcoded-tables
  409. else
  410. FFMPEG_CONFIGURE+= --enable-small
  411. endif
  412. FFMPEG_CONFIGURE+= \
  413. --enable-gpl \
  414. $(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame) \
  415. $(if $(CONFIG_PACKAGE_libx264),--enable-libx264)
  416. endif
  417. endif
  418. ifeq ($(BUILD_VARIANT),custom)
  419. FFMPEG_ENABLE= \
  420. $(foreach c, $(2), \
  421. $(if $($(3)_$(c)),--enable-$(1)="$(c)") \
  422. )
  423. ifeq ($(CONFIG_FFMPEG_CUSTOM_LARGE),y)
  424. FFMPEG_CONFIGURE+= \
  425. --enable-hardcoded-tables
  426. else
  427. FFMPEG_CONFIGURE+= \
  428. --enable-small
  429. endif
  430. ifeq ($(CONFIG_FFMPEG_CUSTOM_GPL),y)
  431. FFMPEG_CONFIGURE+= --enable-gpl
  432. endif
  433. ifeq ($(CONFIG_FFMPEG_CUSTOM_GPLV3),y)
  434. FFMPEG_CONFIGURE+= --enable-version3
  435. endif
  436. ifeq ($(CONFIG_FFMPEG_CUSTOM_NONFREE),y)
  437. FFMPEG_CONFIGURE+= --enable-nonfree
  438. endif
  439. FFMPEG_CONFIGURE+= \
  440. --disable-programs \
  441. --disable-avfilter \
  442. --disable-postproc \
  443. --disable-swresample \
  444. --disable-swscale \
  445. --disable-everything \
  446. $(call FFMPEG_ENABLE,encoder,$(FFMPEG_CUSTOM_ENCODERS),CONFIG_FFMPEG_CUSTOM_ENCODER) \
  447. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_CUSTOM_DECODERS),CONFIG_FFMPEG_CUSTOM_DECODER) \
  448. $(call FFMPEG_ENABLE,muxer,$(FFMPEG_CUSTOM_MUXERS),CONFIG_FFMPEG_CUSTOM_MUXER) \
  449. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_CUSTOM_DEMUXERS),CONFIG_FFMPEG_CUSTOM_DEMUXER) \
  450. $(call FFMPEG_ENABLE,parser,$(FFMPEG_CUSTOM_PARSERS),CONFIG_FFMPEG_CUSTOM_PARSER) \
  451. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_CUSTOM_PROTOCOLS),CONFIG_FFMPEG_CUSTOM_PROTOCOL) \
  452. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_adpcm),y)
  453. FFMPEG_CONFIGURE+= \
  454. --enable-decoder=adpcm_ima_wav \
  455. --enable-decoder=adpcm_ima_qt \
  456. --enable-decoder=adpcm_ms
  457. endif
  458. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libfdk-aac),y)
  459. FFMPEG_CONFIGURE+= \
  460. --enable-libfdk-aac --enable-encoder=libfdk_aac
  461. endif
  462. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libmp3lame),y)
  463. FFMPEG_CONFIGURE+= \
  464. --enable-libmp3lame --enable-encoder=libmp3lame
  465. endif
  466. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libopus),y)
  467. FFMPEG_CONFIGURE+= \
  468. --enable-libopus --enable-decoder=libopus --enable-encoder=libopus
  469. endif
  470. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libshine),y)
  471. FFMPEG_CONFIGURE+= \
  472. --enable-libshine --enable-encoder=libshine
  473. endif
  474. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),y)
  475. FFMPEG_CONFIGURE+= \
  476. --enable-libx264 --enable-encoder=libx264
  477. endif
  478. endif
  479. ifeq ($(BUILD_VARIANT),audio-dec)
  480. FFMPEG_ENABLE= \
  481. $(foreach c, $(2), \
  482. --enable-$(1)="$(c)" \
  483. )
  484. FFMPEG_CONFIGURE+= \
  485. --enable-small \
  486. --enable-gpl \
  487. \
  488. --disable-programs \
  489. --disable-avfilter \
  490. --disable-postproc \
  491. --disable-swresample \
  492. --disable-swscale \
  493. --disable-everything \
  494. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_AUDIO_DECODERS)) \
  495. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_AUDIO_DEMUXERS)) \
  496. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_AUDIO_PROTOCOLS)) \
  497. --disable-decoder=pcm_bluray,pcm_dvd
  498. endif
  499. ifeq ($(BUILD_VARIANT),mini)
  500. FFMPEG_ENABLE= \
  501. $(foreach c, $(2), \
  502. --enable-$(1)="$(c)" \
  503. )
  504. FFMPEG_CONFIGURE+= \
  505. --enable-small \
  506. \
  507. --disable-programs \
  508. --disable-avdevice \
  509. --disable-avfilter \
  510. --disable-postproc \
  511. --disable-swresample \
  512. --disable-swscale \
  513. --disable-everything \
  514. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_MINI_DECODERS)) \
  515. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_MINI_DEMUXERS)) \
  516. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_MINI_PROTOCOLS)) \
  517. $(if $(CONFIG_BUILD_PATENTED), \
  518. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_PATENTED_MINI_DECODERS)))
  519. endif
  520. ifneq ($(CONFIG_TARGET_x86),)
  521. TARGET_CFLAGS+= -fomit-frame-pointer
  522. endif
  523. define Build/Configure
  524. ( cd $(PKG_BUILD_DIR); $(FFMPEG_CONFIGURE) )
  525. endef
  526. define Build/Compile
  527. $(MAKE) -C $(PKG_BUILD_DIR) \
  528. DESTDIR="$(PKG_INSTALL_DIR)" \
  529. all install
  530. endef
  531. define Build/InstallDev/custom
  532. $(INSTALL_DIR) $(1)/usr/include
  533. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avformat,avutil} $(1)/usr/include/
  534. $(INSTALL_DIR) $(1)/usr/lib
  535. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.{a,so*} $(1)/usr/lib/
  536. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  537. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
  538. endef
  539. # Soft float is LGPL (no libpostproc); Hard float is GPL (yes libpostproc)
  540. define Build/InstallDev/full
  541. $(INSTALL_DIR) $(1)/usr/include
  542. $(INSTALL_DIR) $(1)/usr/lib
  543. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  544. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale} $(1)/usr/include/
  545. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.{a,so*} $(1)/usr/lib/
  546. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/
  547. ifneq ($(CONFIG_SOFT_FLOAT),y)
  548. $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
  549. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
  550. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
  551. endif
  552. endef
  553. define Build/InstallDev/mini
  554. $(INSTALL_DIR) $(1)/usr/include
  555. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avformat,avutil} $(1)/usr/include/
  556. $(INSTALL_DIR) $(1)/usr/lib
  557. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.{a,so*} $(1)/usr/lib/
  558. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  559. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
  560. endef
  561. Build/InstallDev/audio-dec = $(Build/InstallDev/custom)
  562. # XXX: attempt at installing "best" dev files available
  563. ifeq ($(BUILD_VARIANT),custom)
  564. # XXX: only install "custom" dev files if -full & -mini are not selected
  565. ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
  566. Build/InstallDev = $(Build/InstallDev/custom)
  567. endif
  568. endif
  569. ifeq ($(BUILD_VARIANT),audio-dec)
  570. # XXX: only install "audio-dec" dev files if -full & -mini are not selected
  571. ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
  572. Build/InstallDev = $(Build/InstallDev/audio-dec)
  573. endif
  574. endif
  575. ifeq ($(BUILD_VARIANT),full)
  576. # XXX: always install "full" dev files if -full is selected
  577. Build/InstallDev = $(Build/InstallDev/full)
  578. endif
  579. ifeq ($(BUILD_VARIANT),mini)
  580. # XXX: only install "mini" dev files if -full is not selected
  581. ifeq ($(CONFIG_PACKAGE_libffmpeg-full),)
  582. Build/InstallDev = $(Build/InstallDev/mini)
  583. endif
  584. endif
  585. define Package/ffmpeg/install
  586. $(INSTALL_DIR) $(1)/usr/bin
  587. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/
  588. endef
  589. define Package/ffprobe/install
  590. $(INSTALL_DIR) $(1)/usr/bin
  591. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/
  592. endef
  593. define Package/ffserver/install
  594. $(INSTALL_DIR) $(1)/usr/bin
  595. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffserver $(1)/usr/bin/
  596. endef
  597. define Package/libffmpeg-custom/install
  598. $(INSTALL_DIR) $(1)/usr/lib
  599. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.so.* $(1)/usr/lib/
  600. endef
  601. # Soft float is LGPL (no libpostproc); Hard float is GPL (yes libpostproc)
  602. define Package/libffmpeg-full/install
  603. $(INSTALL_DIR) $(1)/usr/lib
  604. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.so.* $(1)/usr/lib/
  605. ifneq ($(CONFIG_SOFT_FLOAT),y)
  606. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
  607. endif
  608. endef
  609. define Package/libffmpeg-mini/install
  610. $(INSTALL_DIR) $(1)/usr/lib
  611. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.so.* $(1)/usr/lib/
  612. endef
  613. Package/libffmpeg-audio-dec/install = $(Package/libffmpeg-custom/install)
  614. $(eval $(call BuildPackage,ffmpeg))
  615. $(eval $(call BuildPackage,ffprobe))
  616. $(eval $(call BuildPackage,ffserver))
  617. $(eval $(call BuildPackage,libffmpeg-audio-dec))
  618. $(eval $(call BuildPackage,libffmpeg-full))
  619. $(eval $(call BuildPackage,libffmpeg-mini))
  620. $(eval $(call BuildPackage,libffmpeg-custom))