[x265] [PATCH STABLE] api: do not log warnings from x265_api_get() on typical failures

Steve Borho steve at borho.org
Fri May 15 19:57:35 CEST 2015


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1431712639 18000
#      Fri May 15 12:57:19 2015 -0500
# Branch stable
# Node ID a7b2a1cfd10e1a26c69cfef20c27619a5cff76e6
# Parent  971bd26ef18b8f47ad5602c0cb590dfc22d219ae
api: do not log warnings from x265_api_get() on typical failures

applications might use x265_api_get() to probe which bit depths are available,
we do not want to spew warnings during these operations. Also, plumb in main12
here even though we don't expect to have one for some time, it is ok if current
libs allow queries for them

diff -r 971bd26ef18b -r a7b2a1cfd10e source/encoder/api.cpp
--- a/source/encoder/api.cpp	Wed May 13 16:56:02 2015 +0530
+++ b/source/encoder/api.cpp	Fri May 15 12:57:19 2015 -0500
@@ -299,15 +299,14 @@
         const char* libname = NULL;
         const char* method = "x265_api_get_" xstr(X265_BUILD);
 
-        if (bitDepth == 10)
+        if (bitDepth == 12)
+            libname = "libx265_main12" ext;
+        else if (bitDepth == 10)
             libname = "libx265_main10" ext;
         else if (bitDepth == 8)
             libname = "libx265_main" ext;
         else
-        {
-            x265_log(NULL, X265_LOG_WARNING, "bitdepth %d not supported\n", bitDepth);
             return NULL;
-        }
 
         const x265_api* api = NULL;
 
@@ -318,11 +317,7 @@
             api_get_func get = (api_get_func)GetProcAddress(h, method);
             if (get)
                 api = get(0);
-            else
-                x265_log(NULL, X265_LOG_WARNING, "Unable to bind %s from %s\n", method, libname);
         }
-        else
-            x265_log(NULL, X265_LOG_WARNING, "Unable to open %s\n", libname);
 #else
         void* h = dlopen(libname, RTLD_LAZY | RTLD_LOCAL);
         if (h)
@@ -330,11 +325,7 @@
             api_get_func get = (api_get_func)dlsym(h, method);
             if (get)
                 api = get(0);
-            else
-                x265_log(NULL, X265_LOG_WARNING, "Unable to bind %s from %s\n", method, libname);
         }
-        else
-            x265_log(NULL, X265_LOG_WARNING, "Unable to open %s\n", libname);
 #endif
 
         if (api && bitDepth != api->max_bit_depth)


More information about the x265-devel mailing list