[FFmpeg-devel] [PATCH 1/2] update configure etc to use libyami for h264 decode

Zhao, Halley halley.zhao at intel.com
Fri Jan 9 09:15:12 CET 2015


From: "Zhao, Halley" <halley.zhao at intel.com>

---
 configure              | 24 +++++++++++++++++++-----
 libavcodec/Makefile    |  1 +
 libavcodec/allcodecs.c |  1 +
 3 files changed, 21 insertions(+), 5 deletions(-)
 mode change 100644 => 100755 libavcodec/Makefile

diff --git a/configure b/configure
index d4a86c0..9c54ffc 100755
--- a/configure
+++ b/configure
@@ -236,6 +236,7 @@ External library support:
   --enable-libspeex        enable Speex de/encoding via libspeex [no]
   --enable-libssh          enable SFTP protocol via libssh [no]
   --enable-libstagefright-h264  enable H.264 decoding via libstagefright [no]
+  --enable-libyami-h264    enable H.264 decoding via libyami [no]
   --enable-libtheora       enable Theora encoding via libtheora [no]
   --enable-libtwolame      enable MP2 encoding via libtwolame [no]
   --enable-libutvideo      enable Ut Video encoding and decoding via libutvideo [no]
@@ -1031,7 +1032,8 @@ check_func_headers(){
             echo "long check_$func(void) { return (long) $func; }"
         done
         echo "int main(void) { return 0; }"
-    } | check_ld "cc" "$@" && enable $funcs && enable_safe $headers
+    ## both C++/C header check goes here, use 'cxx'
+    } | check_ld "cxx" "$@" && enable $funcs && enable_safe $headers
 }
 
 check_class_headers_cpp(){
@@ -1092,14 +1094,15 @@ check_lib_cpp(){
 
 check_pkg_config(){
     log check_pkg_config "$@"
-    pkgandversion="$1"
+    ## one component may depend on multiple pkgs
+    allpkgs="$1"
     pkg="${1%% *}"
     headers="$2"
     funcs="$3"
     shift 3
-    check_cmd $pkg_config --exists --print-errors $pkgandversion || return
-    pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
-    pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
+    check_cmd $pkg_config --exists --print-errors $allpkgs || return
+    pkg_cflags=$($pkg_config --cflags $pkg_config_flags $allpkgs)
+    pkg_libs=$($pkg_config --libs $pkg_config_flags $allpkgs)
     check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
         set_safe ${pkg}_cflags $pkg_cflags   &&
         set_safe ${pkg}_libs   $pkg_libs
@@ -1210,6 +1213,14 @@ require_pkg_config(){
     add_extralibs $(get_safe ${pkg}_libs)
 }
 
+cxx_extralibs_added="no"
+add_cxx_extralibs(){
+    if [ $cxx_extralibs_added = "no"]; then
+        add_extralibs "-lstdc++ -Wl,--no-as-needed -ldl"
+        cxx_extralibs_added="yes"
+    fi
+}
+
 require_libfreetype(){
     log require_libfreetype "$@"
     pkg="freetype2"
@@ -1371,6 +1382,7 @@ EXTERNAL_LIBRARY_LIST="
     libspeex
     libssh
     libstagefright_h264
+    libyami_h264
     libtheora
     libtwolame
     libutvideo
@@ -2368,6 +2380,7 @@ libspeex_decoder_deps="libspeex"
 libspeex_encoder_deps="libspeex"
 libspeex_encoder_select="audio_frame_queue"
 libstagefright_h264_decoder_deps="libstagefright_h264"
+libyami_h264_decoder_deps="libyami_h264"
 libtheora_encoder_deps="libtheora"
 libtwolame_encoder_deps="libtwolame"
 libvo_aacenc_encoder_deps="libvo_aacenc"
@@ -4884,6 +4897,7 @@ enabled libspeex          && require_pkg_config speex speex/speex.h speex_decode
 enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
     media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h
     media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static
+enabled libyami_h264      && require_pkg_config "libyami_decoder libva" VideoDecoderHost.h createVideoDecoder && add_cxx_extralibs()
 enabled libtheora         && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
 enabled libtwolame        && require libtwolame twolame.h twolame_init -ltwolame &&
                              { check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
old mode 100644
new mode 100755
index fa0f53d..d8697ff
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -747,6 +747,7 @@ OBJS-$(CONFIG_LIBSHINE_ENCODER)           += libshine.o
 OBJS-$(CONFIG_LIBSPEEX_DECODER)           += libspeexdec.o
 OBJS-$(CONFIG_LIBSPEEX_ENCODER)           += libspeexenc.o
 OBJS-$(CONFIG_LIBSTAGEFRIGHT_H264_DECODER)+= libstagefright.o
+OBJS-$(CONFIG_LIBYAMI_H264_DECODER)       += libyami.o
 OBJS-$(CONFIG_LIBTHEORA_ENCODER)          += libtheoraenc.o
 OBJS-$(CONFIG_LIBTWOLAME_ENCODER)         += libtwolame.o
 OBJS-$(CONFIG_LIBUTVIDEO_DECODER)         += libutvideodec.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 0d39d33..beccc74 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -97,6 +97,7 @@ void avcodec_register_all(void)
     REGISTER_HWACCEL(WMV3_VDPAU,        wmv3_vdpau);
 
     /* video codecs */
+    REGISTER_DECODER(LIBYAMI_H264,      libyami_h264);
     REGISTER_ENCODER(A64MULTI,          a64multi);
     REGISTER_ENCODER(A64MULTI5,         a64multi5);
     REGISTER_DECODER(AASC,              aasc);
-- 
1.8.3.2



More information about the ffmpeg-devel mailing list