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.

708 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.5
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_SOURCE_URL:=https://ffmpeg.org/releases/
  14. PKG_MD5SUM:=b53ecfcbafca973f92bfb77815cce01e
  15. PKG_HASH:=0c0c15e999c66003b969c7a5d61c4a7e1d3dfbf3c809c23ff5537d583dd93323
  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. ifeq (,$(findstring vfp,$(CONFIG_TARGET_OPTIMIZATION)))
  383. FFMPEG_CONFIGURE+= \
  384. --disable-vfp
  385. endif
  386. ifeq (,$(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)))
  387. FFMPEG_CONFIGURE+= \
  388. --disable-neon
  389. endif
  390. endif
  391. ifneq ($(CONFIG_YASM),y)
  392. FFMPEG_CONFIGURE += \
  393. --disable-yasm
  394. endif
  395. ifeq ($(BUILD_VARIANT),full)
  396. FFMPEG_CONFIGURE+= \
  397. $(if $(CONFIG_PACKAGE_libopus),--enable-libopus)
  398. ifeq ($(CONFIG_SOFT_FLOAT),y)
  399. FFMPEG_CONFIGURE+= \
  400. --enable-small \
  401. \
  402. $(if $(CONFIG_PACKAGE_shine),--enable-libshine)
  403. else
  404. FFMPEG_CONFIGURE+= \
  405. --enable-small \
  406. --enable-gpl \
  407. \
  408. $(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame) \
  409. $(if $(CONFIG_PACKAGE_libx264),--enable-libx264)
  410. endif
  411. endif
  412. ifeq ($(BUILD_VARIANT),custom)
  413. FFMPEG_ENABLE= \
  414. $(foreach c, $(2), \
  415. $(if $($(3)_$(c)),--enable-$(1)="$(c)") \
  416. )
  417. ifeq ($(CONFIG_FFMPEG_CUSTOM_LARGE),y)
  418. FFMPEG_CONFIGURE+= \
  419. --enable-hardcoded-tables
  420. else
  421. FFMPEG_CONFIGURE+= \
  422. --enable-small
  423. endif
  424. ifeq ($(CONFIG_FFMPEG_CUSTOM_GPL),y)
  425. FFMPEG_CONFIGURE+= --enable-gpl
  426. endif
  427. ifeq ($(CONFIG_FFMPEG_CUSTOM_GPLV3),y)
  428. FFMPEG_CONFIGURE+= --enable-version3
  429. endif
  430. ifeq ($(CONFIG_FFMPEG_CUSTOM_NONFREE),y)
  431. FFMPEG_CONFIGURE+= --enable-nonfree
  432. endif
  433. FFMPEG_CONFIGURE+= \
  434. --disable-programs \
  435. --disable-avfilter \
  436. --disable-postproc \
  437. --disable-swresample \
  438. --disable-swscale \
  439. --disable-everything \
  440. $(call FFMPEG_ENABLE,encoder,$(FFMPEG_CUSTOM_ENCODERS),CONFIG_FFMPEG_CUSTOM_ENCODER) \
  441. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_CUSTOM_DECODERS),CONFIG_FFMPEG_CUSTOM_DECODER) \
  442. $(call FFMPEG_ENABLE,muxer,$(FFMPEG_CUSTOM_MUXERS),CONFIG_FFMPEG_CUSTOM_MUXER) \
  443. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_CUSTOM_DEMUXERS),CONFIG_FFMPEG_CUSTOM_DEMUXER) \
  444. $(call FFMPEG_ENABLE,parser,$(FFMPEG_CUSTOM_PARSERS),CONFIG_FFMPEG_CUSTOM_PARSER) \
  445. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_CUSTOM_PROTOCOLS),CONFIG_FFMPEG_CUSTOM_PROTOCOL) \
  446. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_adpcm),y)
  447. FFMPEG_CONFIGURE+= \
  448. --enable-decoder=adpcm_ima_wav \
  449. --enable-decoder=adpcm_ima_qt \
  450. --enable-decoder=adpcm_ms
  451. endif
  452. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libfdk-aac),y)
  453. FFMPEG_CONFIGURE+= \
  454. --enable-libfdk-aac --enable-encoder=libfdk_aac
  455. endif
  456. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libmp3lame),y)
  457. FFMPEG_CONFIGURE+= \
  458. --enable-libmp3lame --enable-encoder=libmp3lame
  459. endif
  460. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libopus),y)
  461. FFMPEG_CONFIGURE+= \
  462. --enable-libopus --enable-decoder=libopus --enable-encoder=libopus
  463. endif
  464. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libshine),y)
  465. FFMPEG_CONFIGURE+= \
  466. --enable-libshine --enable-encoder=libshine
  467. endif
  468. ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),y)
  469. FFMPEG_CONFIGURE+= \
  470. --enable-libx264 --enable-encoder=libx264
  471. endif
  472. endif
  473. ifeq ($(BUILD_VARIANT),audio-dec)
  474. FFMPEG_ENABLE= \
  475. $(foreach c, $(2), \
  476. --enable-$(1)="$(c)" \
  477. )
  478. FFMPEG_CONFIGURE+= \
  479. --enable-small \
  480. --enable-gpl \
  481. \
  482. --disable-programs \
  483. --disable-avfilter \
  484. --disable-postproc \
  485. --disable-swresample \
  486. --disable-swscale \
  487. --disable-everything \
  488. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_AUDIO_DECODERS)) \
  489. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_AUDIO_DEMUXERS)) \
  490. $(call FFMPEG_ENABLE,parser,$(FFMPEG_AUDIO_PARSERS)) \
  491. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_AUDIO_PROTOCOLS)) \
  492. --disable-decoder=pcm_bluray,pcm_dvd \
  493. endif
  494. ifeq ($(BUILD_VARIANT),mini)
  495. FFMPEG_ENABLE= \
  496. $(foreach c, $(2), \
  497. --enable-$(1)="$(c)" \
  498. )
  499. FFMPEG_CONFIGURE+= \
  500. --enable-small \
  501. \
  502. --disable-programs \
  503. --disable-avdevice \
  504. --disable-avfilter \
  505. --disable-postproc \
  506. --disable-swresample \
  507. --disable-swscale \
  508. --disable-everything \
  509. $(call FFMPEG_ENABLE,decoder,$(FFMPEG_MINI_DECODERS)) \
  510. $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_MINI_DEMUXERS)) \
  511. $(call FFMPEG_ENABLE,protocol,$(FFMPEG_MINI_PROTOCOLS))
  512. endif
  513. ifneq ($(CONFIG_TARGET_x86),)
  514. TARGET_CFLAGS += -fomit-frame-pointer
  515. endif
  516. define Build/Configure
  517. ( cd $(PKG_BUILD_DIR); $(FFMPEG_CONFIGURE) )
  518. endef
  519. define Build/Compile
  520. $(MAKE) -C $(PKG_BUILD_DIR) \
  521. DESTDIR="$(PKG_INSTALL_DIR)" \
  522. all install
  523. endef
  524. define Build/InstallDev/custom
  525. $(INSTALL_DIR) $(1)/usr/include
  526. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avformat,avutil} $(1)/usr/include/
  527. $(INSTALL_DIR) $(1)/usr/lib
  528. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.{a,so*} $(1)/usr/lib/
  529. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  530. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
  531. endef
  532. # Soft float is LGPL (no libpostproc); Hard float is GPL (yes libpostproc)
  533. define Build/InstallDev/full
  534. $(INSTALL_DIR) $(1)/usr/include
  535. $(INSTALL_DIR) $(1)/usr/lib
  536. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  537. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avutil,swresample,swscale} $(1)/usr/include/
  538. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,swresample,swscale}.{a,so*} $(1)/usr/lib/
  539. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avutil,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/
  540. ifneq ($(CONFIG_SOFT_FLOAT),y)
  541. $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
  542. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
  543. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
  544. endif
  545. endef
  546. define Build/InstallDev/mini
  547. $(INSTALL_DIR) $(1)/usr/include
  548. $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avformat,avutil} $(1)/usr/include/
  549. $(INSTALL_DIR) $(1)/usr/lib
  550. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.{a,so*} $(1)/usr/lib/
  551. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  552. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
  553. endef
  554. Build/InstallDev/audio-dec = $(Build/InstallDev/custom)
  555. # XXX: attempt at installing "best" dev files available
  556. ifeq ($(BUILD_VARIANT),custom)
  557. # XXX: only install "custom" dev files if -full & -mini are not selected
  558. ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
  559. Build/InstallDev = $(Build/InstallDev/custom)
  560. endif
  561. endif
  562. ifeq ($(BUILD_VARIANT),audio-dec)
  563. # XXX: only install "audio-dec" dev files if -full & -mini are not selected
  564. ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
  565. Build/InstallDev = $(Build/InstallDev/audio-dec)
  566. endif
  567. endif
  568. ifeq ($(BUILD_VARIANT),full)
  569. # XXX: always install "full" dev files if -full is selected
  570. Build/InstallDev = $(Build/InstallDev/full)
  571. endif
  572. ifeq ($(BUILD_VARIANT),mini)
  573. # XXX: only install "mini" dev files if -full is not selected
  574. ifeq ($(CONFIG_PACKAGE_libffmpeg-full),)
  575. Build/InstallDev = $(Build/InstallDev/mini)
  576. endif
  577. endif
  578. define Package/ffmpeg/install
  579. $(INSTALL_DIR) $(1)/usr/bin
  580. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/
  581. endef
  582. define Package/ffprobe/install
  583. $(INSTALL_DIR) $(1)/usr/bin
  584. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/
  585. endef
  586. define Package/ffserver/install
  587. $(INSTALL_DIR) $(1)/usr/bin
  588. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffserver $(1)/usr/bin/
  589. endef
  590. define Package/libffmpeg-custom/install
  591. $(INSTALL_DIR) $(1)/usr/lib
  592. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.so.* $(1)/usr/lib/
  593. endef
  594. # Soft float is LGPL (no libpostproc); Hard float is GPL (yes libpostproc)
  595. define Package/libffmpeg-full/install
  596. $(INSTALL_DIR) $(1)/usr/lib
  597. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,swresample,swscale}.so.* $(1)/usr/lib/
  598. ifneq ($(CONFIG_SOFT_FLOAT),y)
  599. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
  600. endif
  601. endef
  602. define Package/libffmpeg-mini/install
  603. $(INSTALL_DIR) $(1)/usr/lib
  604. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avformat,avutil}.so.* $(1)/usr/lib/
  605. endef
  606. Package/libffmpeg-audio-dec/install = $(Package/libffmpeg-custom/install)
  607. $(eval $(call BuildPackage,ffmpeg))
  608. $(eval $(call BuildPackage,ffprobe))
  609. $(eval $(call BuildPackage,ffserver))
  610. $(eval $(call BuildPackage,libffmpeg-audio-dec))
  611. $(eval $(call BuildPackage,libffmpeg-full))
  612. $(eval $(call BuildPackage,libffmpeg-mini))
  613. ifneq ($(CONFIG_ALL),y)
  614. $(eval $(call BuildPackage,libffmpeg-custom))
  615. endif