Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Makefile(s): fix libmfx support
  • Loading branch information
lekma authored and perexg committed Oct 1, 2015
1 parent e9c9344 commit d58eeb9
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 11 deletions.
12 changes: 11 additions & 1 deletion Makefile
Expand Up @@ -85,12 +85,21 @@ LDFLAGS += -lx265
endif
endif
LDFLAGS += ${LDFLAGS_FFDIR}/libvpx.a
CONFIG_LIBMFX_VA_LIBS =
ifeq ($(CONFIG_LIBMFX),yes)
CONFIG_LIBMFX_VA_LIBS += -lva
ifeq ($(CONFIG_VA_DRM),yes)
CONFIG_LIBMFX_VA_LIBS += -lva-drm
endif
ifeq ($(CONFIG_VA_X11),yes)
CONFIG_LIBMFX_VA_LIBS += -lva-x11
endif
ifeq ($(CONFIG_LIBMFX_STATIC),yes)
LDFLAGS += ${LDFLAGS_FFDIR}/libmfx.a -lstdc++ -lva-drm -lva
LDFLAGS += ${LDFLAGS_FFDIR}/libmfx.a -lstdc++
else
LDFLAGS += -lmfx
endif
LDFLAGS += ${CONFIG_LIBMFX_VA_LIBS}
endif
endif

Expand Down Expand Up @@ -660,6 +669,7 @@ ${ROOTDIR}/libav_static/build/ffmpeg/lib/libavcodec.a: Makefile.ffmpeg
CONFIG_LIBX265_STATIC=$(CONFIG_LIBX265_STATIC) \
CONFIG_LIBMFX=$(CONFIG_LIBMFX) \
CONFIG_LIBMFX_STATIC=$(CONFIG_LIBMFX_STATIC) \
CONFIG_LIBMFX_VA_LIBS="$(CONFIG_LIBMFX_VA_LIBS)" \
$(MAKE) -f Makefile.ffmpeg build

# Static HDHOMERUN library
Expand Down
13 changes: 7 additions & 6 deletions Makefile.ffmpeg
Expand Up @@ -53,7 +53,7 @@ ECFLAGS = -I$(LIBAVDIR)/build/ffmpeg/include
ELIBS = -L$(LIBAVDIR)/build/ffmpeg/lib -ldl

EXTRAENV =
CONFIGURE = TVHEADEND_LIBAV_BUILD=$(LIBAVDIR)/ffmpeg \
CONFIGURE = TVHEADEND_LIBAV_BUILD=$(LIBAVDIR)/build/ffmpeg \
PKG_CONFIG=$(ROOTDIR)/support/pkg-config.ffmpeg ./configure

FFMPEG = ffmpeg-2.8
Expand Down Expand Up @@ -136,6 +136,8 @@ EXTLIBS += libmfx
DECODERS += mpeg2_qsv h264_qsv hevc_qsv
ENCODERS += mpeg2_qsv h264_qsv hevc_qsv

ELIBS += $(CONFIG_LIBMFX_VA_LIBS)

endif

ifeq (yes,$(CONFIG_LIBMFX_STATIC))
Expand All @@ -149,8 +151,9 @@ $(LIBAVDIR)/$(LIBMFX)/.tvh_build: \
$(LIBAVDIR)/$(LIBMFX)/.tvh_download
cd $(LIBAVDIR)/$(LIBMFX) && autoreconf -i
cd $(LIBAVDIR)/$(LIBMFX) && ./configure \
--with-libva_drm \
--prefix=/ffmpeg
--prefix=/ffmpeg \
--enable-static \
--disable-shared
DESTDIR=$(LIBAVDIR)/build \
$(MAKE) -C $(LIBAVDIR)/$(LIBMFX) install
@touch $@
Expand Down Expand Up @@ -185,7 +188,7 @@ $(LIBAVDIR)/$(LIBOGG)/.tvh_build: \
$(LIBAVDIR)/$(YASM)/.tvh_build \
$(LIBAVDIR)/$(LIBOGG)/.tvh_download
cd $(LIBAVDIR)/$(LIBOGG) && $(CONFIGURE) \
--prefix=/ffmpeg \
--prefix=/ffmpeg \
--enable-static \
--disable-shared
DESTDIR=$(LIBAVDIR)/build \
Expand Down Expand Up @@ -267,8 +270,6 @@ endif

ifeq (yes,$(CONFIG_LIBX265_STATIC))

ELIBS += -lva-drm -lva

$(LIBAVDIR)/$(LIBX265)/.tvh_download:
$(call DOWNLOAD,$(LIBX265_URL),$(LIBAVDIR)/$(LIBX265_TB),$(LIBX265_SHA1))
$(call UNTAR,$(LIBX265_TB),z)
Expand Down
26 changes: 22 additions & 4 deletions configure
Expand Up @@ -39,7 +39,7 @@ OPTIONS=(
"libx265:no"
"libx265_static:yes"
"libmfx:no"
"libmfx_static:no"
"libmfx_static:yes"
"inotify:auto"
"epoll:auto"
"uriparser:auto"
Expand Down Expand Up @@ -400,9 +400,27 @@ if enabled libffmpeg_static; then
fi

# libmfx
if enabled libmfxdis; then
check_cc_lib libva-drm || die "libva-drm not found"
check_cc_lib mfx || die "libmfx not found"
if enabled libmfx; then
check_cc_lib va || die "libva not found"
check_cc_lib va-drm va_drm || disable va_drm
check_cc_lib va-x11 va_x11 || disable va_x11
if disabled va_drm && disabled va_x11; then
die "neither libva-drm nor libva-x11 was found"
fi
if enabled libmfx_static; then
check_bin autoreconf ||\
die "autoreconf not found (needed for building libmfx)"
check_bin libtool ||\
die "libtool not found (needed for building libmfx)"
check_bin libtoolize ||\
die "libtoolize not found (needed for building libmfx)"
check_cc_lib stdc++ stdcpp ||\
die "libstdc++ not found (needed for building libmfx)"
else
check_cc_lib mfx || die "libmfx not found"
fi
else
disable libmfx_static
fi

else
Expand Down

0 comments on commit d58eeb9

Please sign in to comment.