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.

700 lines
16 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. PKG_BUILD_DEPENDS:= \
  199. PACKAGE_shine:shine \
  200. PACKAGE_libx264:libx264 \
  201. PACKAGE_lame-lib:lame-lib \
  202. PACKAGE_libopus:libopus
  203. include $(INCLUDE_DIR)/package.mk
  204. define Package/ffmpeg/Default
  205. TITLE:=FFmpeg
  206. URL:=https://ffmpeg.org/
  207. DEPENDS+= +libpthread
  208. endef
  209. define Package/ffmpeg/Default/description
  210. FFmpeg is a a software package that can record, convert and stream digital
  211. audio and video in numerous formats.
  212. endef
  213. define Package/ffmpeg
  214. $(call Package/ffmpeg/Default)
  215. SECTION:=multimedia
  216. CATEGORY:=Multimedia
  217. TITLE+= program
  218. DEPENDS+= +libffmpeg-full
  219. VARIANT:=full
  220. endef
  221. define Package/ffmpeg/description
  222. $(call Package/ffmpeg/Default/description)
  223. .
  224. This package contains the FFmpeg command line tool.
  225. endef
  226. define Package/ffprobe
  227. $(call Package/ffmpeg/Default)
  228. SECTION:=multimedia
  229. CATEGORY:=Multimedia
  230. TITLE+= CLI media identifier
  231. DEPENDS+= +libffmpeg-full
  232. VARIANT:=full
  233. endef
  234. define Package/ffprobe/description
  235. $(call Package/ffmpeg/Default/description)
  236. .
  237. This package contains the FFprobe command line tool.
  238. endef
  239. define Package/ffserver
  240. $(call Package/ffserver/Default)
  241. SECTION:=multimedia
  242. CATEGORY:=Multimedia
  243. TITLE+= streaming server
  244. DEPENDS+= +libffmpeg-full
  245. VARIANT:=full
  246. endef
  247. define Package/ffserver/description
  248. $(call Package/ffmpeg/Default/description)
  249. .
  250. This package contains the FFmpeg streaming server.
  251. endef
  252. define Package/libffmpeg/Default
  253. $(call Package/ffmpeg/Default)
  254. SECTION:=libs
  255. CATEGORY:=Libraries
  256. TITLE+= libraries
  257. DEPENDS+= +libpthread +zlib +libbz2
  258. PROVIDES:= libffmpeg
  259. endef
  260. # Package build suppressed when CONFIG_ALL=y
  261. define Package/libffmpeg-custom
  262. $(call Package/libffmpeg/Default)
  263. TITLE+= (custom)
  264. DEPENDS+= @!ALL \
  265. +FFMPEG_CUSTOM_SELECT_libopus:libopus \
  266. +PACKAGE_libx264:libx264 +PACKAGE_lame-lib:lame-lib \
  267. +FFMPEG_CUSTOM_SELECT_libshine:shine \
  268. +PACKAGE_fdk-aac:fdk-aac
  269. VARIANT:=custom
  270. MENU:=1
  271. endef
  272. define Package/libffmpeg-custom/config
  273. source "$(SOURCE)/Config.in"
  274. endef
  275. define Package/libffmpeg-custom/description
  276. $(call Package/ffmpeg/Default/description)
  277. .
  278. This package contains customized FFmpeg shared libraries.
  279. endef
  280. define Package/libffmpeg-audio-dec
  281. $(call Package/libffmpeg/Default)
  282. TITLE+= (audio)
  283. DEPENDS+= @BUILD_PATENTED
  284. VARIANT:=audio-dec
  285. endef
  286. define Package/libffmpeg-audio-dec/description
  287. $(call Package/ffmpeg/Default/description)
  288. .
  289. This package contains FFmpeg shared libraries for audio decoding
  290. endef
  291. define Package/libffmpeg-full
  292. $(call Package/libffmpeg/Default)
  293. TITLE+= (full)
  294. DEPENDS+= @BUILD_PATENTED +alsa-lib +PACKAGE_libopus:libopus
  295. ifeq ($(CONFIG_SOFT_FLOAT),y)
  296. DEPENDS+= +PACKAGE_shine:shine
  297. else
  298. DEPENDS+= +PACKAGE_lame-lib:lame-lib +PACKAGE_libx264:libx264
  299. endif
  300. VARIANT:=full
  301. endef
  302. define Package/libffmpeg-full/description
  303. $(call Package/ffmpeg/Default/description)
  304. .
  305. This package contains full-featured FFmpeg shared libraries.
  306. endef
  307. define Package/libffmpeg-mini
  308. $(call Package/libffmpeg/Default)
  309. TITLE+= (mini)
  310. DEPENDS+= @BUILD_PATENTED
  311. VARIANT:=mini
  312. endef
  313. define Package/libffmpeg-mini/description
  314. $(call Package/ffmpeg/Default/description)
  315. .
  316. This package contains minimal-featured FFmpeg shared libraries.
  317. endef
  318. FFMPEG_CONFIGURE:= \
  319. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
  320. LDFLAGS="$(TARGET_LDFLAGS)" \
  321. ./configure \
  322. --enable-cross-compile \
  323. --cross-prefix="$(TARGET_CROSS)" \
  324. --arch="$(ARCH)" \
  325. --target-os=linux \
  326. --prefix="/usr" \
  327. --pkg-config="pkg-config" \
  328. --enable-shared \
  329. --enable-static \
  330. --enable-pthreads \
  331. --enable-zlib \
  332. --disable-doc \
  333. --disable-debug \
  334. \
  335. --disable-lzma \
  336. --disable-vaapi \
  337. --disable-vdpau \
  338. --disable-outdevs
  339. ifeq ($(CONFIG_SOFT_FLOAT),y)
  340. FFMPEG_CONFIGURE+= \
  341. --disable-altivec \
  342. --disable-vsx \
  343. --disable-power8 \
  344. --disable-armv5te \
  345. --disable-armv6 \
  346. --disable-armv6t2 \
  347. --disable-inline-asm \
  348. --disable-mipsdsp \
  349. --disable-mipsdspr2 \
  350. --disable-mipsfpu \
  351. --disable-msa \
  352. --disable-mmi \
  353. --disable-fast-unaligned \
  354. --disable-runtime-cpudetect
  355. else ifneq ($(findstring arm,$(CONFIG_ARCH)),)
  356. FFMPEG_CONFIGURE+= \
  357. --disable-runtime-cpudetect
  358. # XXX: GitHub issue 3320 ppc cpu with fpu but no altivec (WNDR4700)
  359. else ifneq ($(findstring powerpc,$(CONFIG_ARCH)),)
  360. FFMPEG_CONFIGURE+= \
  361. --disable-altivec
  362. endif
  363. # selectively disable optimizations according to arch/cpu type
  364. ifneq ($(findstring arm,$(CONFIG_ARCH)),)
  365. FFMPEG_CONFIGURE+= --enable-lto
  366. ifneq ($(findstring vfp,$(CONFIG_TARGET_OPTIMIZATION)),)
  367. FFMPEG_CONFIGURE+= --enable-vfp
  368. else
  369. FFMPEG_CONFIGURE+= --disable-vfp
  370. endif
  371. ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),)
  372. FFMPEG_CONFIGURE+= \
  373. --enable-neon \
  374. --enable-vfp
  375. else
  376. FFMPEG_CONFIGURE+= --disable-neon
  377. endif
  378. endif
  379. ifeq ($(ARCH),x86_64)
  380. FFMPEG_CONFIGURE+= --enable-lto
  381. endif
  382. ifneq ($(CONFIG_YASM),y)
  383. FFMPEG_CONFIGURE+= --disable-yasm
  384. endif
  385. ifeq ($(BUILD_VARIANT),full)
  386. FFMPEG_CONFIGURE+= \
  387. --enable-avresample \
  388. $(if $(CONFIG_PACKAGE_libopus),--enable-libopus)
  389. ifeq ($(CONFIG_SOFT_FLOAT),y)
  390. FFMPEG_CONFIGURE+= \
  391. --enable-small \
  392. \
  393. $(if $(CONFIG_PACKAGE_shine),--enable-libshine)
  394. else
  395. ifeq ($(ARCH),x86_64)
  396. FFMPEG_CONFIGURE+= --enable-hardcoded-tables
  397. else
  398. FFMPEG_CONFIGURE+= --enable-small
  399. endif
  400. FFMPEG_CONFIGURE+= \
  401. --enable-gpl \
  402. \
  403. $(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame) \
  404. $(if $(CONFIG_PACKAGE_libx264),--enable-libx264)
  405. endif
  406. endif
  407. ifeq ($(BUILD_VARIANT),custom)
  408. FFMPEG_ENABLE= \
  409. $(foreach c, $(2), \
  410. $(if $($(3)_$(c)),--enable-$(1)="$(c)") \
  411. )
  412. ifeq ($(CONFIG_FFMPEG_CUSTOM_LARGE),y)
  413. FFMPEG_CONFIGURE+= \
  414. --enable-hardcoded-tables
  415. else
  416. FFMPEG_CONFIGURE+= \
  417. --enable-small
  418. endif
  419. ifeq ($(CONFIG_FFMPEG_CUSTOM_GPL),y)
  420. FFMPEG_CONFIGURE+= --enable-gpl
  421. endif
  422. ifeq ($(CONFIG_FFMPEG_CUSTOM_GPLV3),y)
  423. FFMPEG_CONFIGURE+= --enable-version3
  424. endif
  425. ifeq ($(CONFIG_FFMPEG_CUSTOM_NONFREE),y)
  426. FFMPEG_CONFIGURE+= --enable-nonfree
  427. endif
  428. FFMPEG_CONFIGURE+= \
  429. --disable-programs \
  430. --disable-avfilter \
  431. --disable-postproc \
  432. --disable-swresample \
  433. --disable-swscale \
  434. --disable-everything \
  435. $(call FFMPEG_ENABLE,encoder,$(FFMPEG_CUSTOM_ENCODERS),CONFIG_FFMPEG_CUSTOM_ENCODER) \
  436. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_CUSTOM_DECODERS),CONFIG_FFMPEG_CUSTOM_DECODER) \
  437. $(call FFMPEG_ENABLE,muxer,$(FFMPEG_CUSTOM_MUXERS),CONFIG_FFMPEG_CUSTOM_MUXER) \
  438. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_CUSTOM_DEMUXERS),CONFIG_FFMPEG_CUSTOM_DEMUXER) \
  439. $(call FFMPEG_ENABLE,parser,$(FFMPEG_CUSTOM_PARSERS),CONFIG_FFMPEG_CUSTOM_PARSER) \
  440. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_CUSTOM_PROTOCOLS),CONFIG_FFMPEG_CUSTOM_PROTOCOL) \
  441. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_adpcm),y)
  442. FFMPEG_CONFIGURE+= \
  443. --enable-decoder=adpcm_ima_wav \
  444. --enable-decoder=adpcm_ima_qt \
  445. --enable-decoder=adpcm_ms
  446. endif
  447. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libfdk-aac),y)
  448. FFMPEG_CONFIGURE+= \
  449. --enable-libfdk-aac --enable-encoder=libfdk_aac
  450. endif
  451. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libmp3lame),y)
  452. FFMPEG_CONFIGURE+= \
  453. --enable-libmp3lame --enable-encoder=libmp3lame
  454. endif
  455. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libopus),y)
  456. FFMPEG_CONFIGURE+= \
  457. --enable-libopus --enable-decoder=libopus --enable-encoder=libopus
  458. endif
  459. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libshine),y)
  460. FFMPEG_CONFIGURE+= \
  461. --enable-libshine --enable-encoder=libshine
  462. endif
  463. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),y)
  464. FFMPEG_CONFIGURE+= \
  465. --enable-libx264 --enable-encoder=libx264
  466. endif
  467. endif
  468. ifeq ($(BUILD_VARIANT),audio-dec)
  469. FFMPEG_ENABLE= \
  470. $(foreach c, $(2), \
  471. --enable-$(1)="$(c)" \
  472. )
  473. FFMPEG_CONFIGURE+= \
  474. --enable-small \
  475. --enable-gpl \
  476. \
  477. --disable-programs \
  478. --disable-avfilter \
  479. --disable-postproc \
  480. --disable-swresample \
  481. --disable-swscale \
  482. --disable-everything \
  483. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_AUDIO_DECODERS)) \
  484. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_AUDIO_DEMUXERS)) \
  485. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_AUDIO_PROTOCOLS)) \
  486. --disable-decoder=pcm_bluray,pcm_dvd
  487. endif
  488. ifeq ($(BUILD_VARIANT),mini)
  489. FFMPEG_ENABLE= \
  490. $(foreach c, $(2), \
  491. --enable-$(1)="$(c)" \
  492. )
  493. FFMPEG_CONFIGURE+= \
  494. --enable-small \
  495. \
  496. --disable-programs \
  497. --disable-avdevice \
  498. --disable-avfilter \
  499. --disable-postproc \
  500. --disable-swresample \
  501. --disable-swscale \
  502. --disable-everything \
  503. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_MINI_DECODERS)) \
  504. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_MINI_DEMUXERS)) \
  505. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_MINI_PROTOCOLS))
  506. endif
  507. ifneq ($(CONFIG_TARGET_x86),)
  508. TARGET_CFLAGS+= -fomit-frame-pointer
  509. endif
  510. define Build/Configure
  511. ( cd $(PKG_BUILD_DIR); $(FFMPEG_CONFIGURE) )
  512. endef
  513. define Build/Compile
  514. $(MAKE) -C $(PKG_BUILD_DIR) \
  515. DESTDIR="$(PKG_INSTALL_DIR)" \
  516. all install
  517. endef
  518. define Build/InstallDev/custom
  519. $(INSTALL_DIR) $(1)/usr/include
  520. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avformat,avutil} $(1)/usr/include/
  521. $(INSTALL_DIR) $(1)/usr/lib
  522. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.{a,so*} $(1)/usr/lib/
  523. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  524. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
  525. endef
  526. # Soft float is LGPL (no libpostproc); Hard float is GPL (yes libpostproc)
  527. define Build/InstallDev/full
  528. $(INSTALL_DIR) $(1)/usr/include
  529. $(INSTALL_DIR) $(1)/usr/lib
  530. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  531. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale} $(1)/usr/include/
  532. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.{a,so*} $(1)/usr/lib/
  533. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/
  534. ifneq ($(CONFIG_SOFT_FLOAT),y)
  535. $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
  536. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
  537. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
  538. endif
  539. endef
  540. define Build/InstallDev/mini
  541. $(INSTALL_DIR) $(1)/usr/include
  542. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avformat,avutil} $(1)/usr/include/
  543. $(INSTALL_DIR) $(1)/usr/lib
  544. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.{a,so*} $(1)/usr/lib/
  545. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  546. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
  547. endef
  548. Build/InstallDev/audio-dec = $(Build/InstallDev/custom)
  549. # XXX: attempt at installing "best" dev files available
  550. ifeq ($(BUILD_VARIANT),custom)
  551. # XXX: only install "custom" dev files if -full & -mini are not selected
  552. ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
  553. Build/InstallDev = $(Build/InstallDev/custom)
  554. endif
  555. endif
  556. ifeq ($(BUILD_VARIANT),audio-dec)
  557. # XXX: only install "audio-dec" dev files if -full & -mini are not selected
  558. ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
  559. Build/InstallDev = $(Build/InstallDev/audio-dec)
  560. endif
  561. endif
  562. ifeq ($(BUILD_VARIANT),full)
  563. # XXX: always install "full" dev files if -full is selected
  564. Build/InstallDev = $(Build/InstallDev/full)
  565. endif
  566. ifeq ($(BUILD_VARIANT),mini)
  567. # XXX: only install "mini" dev files if -full is not selected
  568. ifeq ($(CONFIG_PACKAGE_libffmpeg-full),)
  569. Build/InstallDev = $(Build/InstallDev/mini)
  570. endif
  571. endif
  572. define Package/ffmpeg/install
  573. $(INSTALL_DIR) $(1)/usr/bin
  574. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/
  575. endef
  576. define Package/ffprobe/install
  577. $(INSTALL_DIR) $(1)/usr/bin
  578. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/
  579. endef
  580. define Package/ffserver/install
  581. $(INSTALL_DIR) $(1)/usr/bin
  582. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffserver $(1)/usr/bin/
  583. endef
  584. define Package/libffmpeg-custom/install
  585. $(INSTALL_DIR) $(1)/usr/lib
  586. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.so.* $(1)/usr/lib/
  587. endef
  588. # Soft float is LGPL (no libpostproc); Hard float is GPL (yes libpostproc)
  589. define Package/libffmpeg-full/install
  590. $(INSTALL_DIR) $(1)/usr/lib
  591. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.so.* $(1)/usr/lib/
  592. ifneq ($(CONFIG_SOFT_FLOAT),y)
  593. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
  594. endif
  595. endef
  596. define Package/libffmpeg-mini/install
  597. $(INSTALL_DIR) $(1)/usr/lib
  598. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.so.* $(1)/usr/lib/
  599. endef
  600. Package/libffmpeg-audio-dec/install = $(Package/libffmpeg-custom/install)
  601. $(eval $(call BuildPackage,ffmpeg))
  602. $(eval $(call BuildPackage,ffprobe))
  603. $(eval $(call BuildPackage,ffserver))
  604. $(eval $(call BuildPackage,libffmpeg-audio-dec))
  605. $(eval $(call BuildPackage,libffmpeg-full))
  606. $(eval $(call BuildPackage,libffmpeg-mini))
  607. $(eval $(call BuildPackage,libffmpeg-custom))