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.

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