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.

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