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.

694 lines
15 KiB

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