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