Commit 958b4332 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

wmphoto: Implement WMP decoder using jxrlib.

parent 3c2da5b9
......@@ -646,6 +646,8 @@ TIFF_LIBS
TIFF_CFLAGS
PNG_LIBS
PNG_CFLAGS
JXRLIB_LIBS
JXRLIB_CFLAGS
JPEG_LIBS
JPEG_CFLAGS
GSSAPI_LIBS
......@@ -863,6 +865,7 @@ with_gstreamer
with_hal
with_inotify
with_jpeg
with_jxrlib
with_krb5
with_ldap
with_mingw
......@@ -1928,6 +1931,8 @@ GSSAPI_CFLAGS
GSSAPI_LIBS
JPEG_CFLAGS
JPEG_LIBS
JXRLIB_CFLAGS
JXRLIB_LIBS
PNG_CFLAGS
PNG_LIBS
TIFF_CFLAGS
......@@ -2603,6 +2608,7 @@ Optional Packages:
--without-hal do not use HAL (dynamic device support)
--without-inotify do not use inotify (filesystem change notifications)
--without-jpeg do not use JPEG
--without-jxrlib do not use JPEG-XR
--without-krb5 do not use krb5 (Kerberos)
--without-ldap do not use LDAP
--without-mingw do not use the MinGW cross-compiler
......@@ -2729,6 +2735,9 @@ Some influential environment variables:
GSSAPI_LIBS Linker flags for krb5-gssapi, overriding pkg-config
JPEG_CFLAGS C compiler flags for libjpeg, overriding pkg-config
JPEG_LIBS Linker flags for libjpeg, overriding pkg-config
JXRLIB_CFLAGS
C compiler flags for jxrlib, overriding pkg-config
JXRLIB_LIBS Linker flags for jxrlib, overriding pkg-config
PNG_CFLAGS C compiler flags for libpng, overriding pkg-config
PNG_LIBS Linker flags for libpng, overriding pkg-config
TIFF_CFLAGS C compiler flags for libtiff-4, overriding pkg-config
......@@ -4037,6 +4046,12 @@ if test "${with_jpeg+set}" = set; then :
fi
# Check whether --with-jxrlib was given.
if test "${with_jxrlib+set}" = set; then :
withval=$with_jxrlib;
fi
# Check whether --with-krb5 was given.
if test "${with_krb5+set}" = set; then :
withval=$with_krb5;
......@@ -15830,6 +15845,111 @@ esac
fi
if test "x$with_jxrlib" != "xno"
then
if ${JXRLIB_CFLAGS:+false} :; then :
if ${PKG_CONFIG+:} false; then :
JXRLIB_CFLAGS=`$PKG_CONFIG --cflags jxrlib 2>/dev/null`
fi
fi
test "$cross_compiling" = yes || JXRLIB_CFLAGS=${JXRLIB_CFLAGS:-${JXRLIB_CFLAGS:--I/usr/include/jxrlib}}
if ${JXRLIB_LIBS:+false} :; then :
if ${PKG_CONFIG+:} false; then :
JXRLIB_LIBS=`$PKG_CONFIG --libs jxrlib 2>/dev/null`
fi
fi
$as_echo "$as_me:${as_lineno-$LINENO}: jxrlib cflags: $JXRLIB_CFLAGS" >&5
$as_echo "$as_me:${as_lineno-$LINENO}: jxrlib libs: $JXRLIB_LIBS" >&5
ac_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $JXRLIB_CFLAGS"
for ac_header in JXRGlue.h
do :
ac_fn_c_check_header_compile "$LINENO" "JXRGlue.h" "ac_cv_header_JXRGlue_h" "#define FAR
"
if test "x$ac_cv_header_JXRGlue_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_JXRGLUE_H 1
_ACEOF
fi
done
if test "$ac_cv_header_JXRGlue_h" = "yes"
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -ljxrglue" >&5
$as_echo_n "checking for -ljxrglue... " >&6; }
if ${ac_cv_lib_soname_jxrglue+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_soname_save_LIBS=$LIBS
LIBS="-ljxrglue $JXRLIB_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char PKImageDecode_Create_WMP ();
int
main ()
{
return PKImageDecode_Create_WMP ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
case "$LIBEXT" in
dll) ac_cv_lib_soname_jxrglue=`$ac_cv_path_LDD conftest.exe | grep "jxrglue" | sed -e "s/dll.*/dll/"';2,$d'` ;;
dylib) ac_cv_lib_soname_jxrglue=`$OTOOL -L conftest$ac_exeext | grep "libjxrglue\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libjxrglue\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
*) ac_cv_lib_soname_jxrglue=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libjxrglue\\.$LIBEXT" | sed -e "s/^.*\\[\\(libjxrglue\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'`
if ${ac_cv_lib_soname_jxrglue:+false} :; then :
ac_cv_lib_soname_jxrglue=`$LDD conftest$ac_exeext | grep "libjxrglue\\.$LIBEXT" | sed -e "s/^.*\(libjxrglue\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'`
fi ;;
esac
else
ac_cv_lib_soname_jxrglue=
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_soname_save_LIBS
fi
if ${ac_cv_lib_soname_jxrglue:+false} :; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
$as_echo "not found" >&6; }
JXRLIB_CFLAGS=""
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_jxrglue" >&5
$as_echo "$ac_cv_lib_soname_jxrglue" >&6; }
cat >>confdefs.h <<_ACEOF
#define SONAME_LIBJXRGLUE "$ac_cv_lib_soname_jxrglue"
_ACEOF
fi
else
JXRLIB_CFLAGS=""
fi
CPPFLAGS=$ac_save_CPPFLAGS
fi
if test "x$ac_cv_lib_soname_jxrglue" = "x"; then :
case "x$with_jxrlib" in
x) as_fn_append wine_notices "|jxrlib ${notice_platform}development files not found, JPEG-XR won't be supported." ;;
xno) ;;
*) as_fn_error $? "jxrlib ${notice_platform}development files not found, JPEG-XR won't be supported.
This is an error since --with-jxrlib was requested." "$LINENO" 5 ;;
esac
fi
if test "x$with_png" != "xno"
then
if ${PNG_CFLAGS:+false} :; then :
......@@ -19782,6 +19902,8 @@ GSSAPI_CFLAGS = $GSSAPI_CFLAGS
GSSAPI_LIBS = $GSSAPI_LIBS
JPEG_CFLAGS = $JPEG_CFLAGS
JPEG_LIBS = $JPEG_LIBS
JXRLIB_CFLAGS = $JXRLIB_CFLAGS
JXRLIB_LIBS = $JXRLIB_LIBS
PNG_CFLAGS = $PNG_CFLAGS
PNG_LIBS = $PNG_LIBS
TIFF_CFLAGS = $TIFF_CFLAGS
......
......@@ -58,6 +58,7 @@ AC_ARG_WITH(gstreamer, AS_HELP_STRING([--without-gstreamer],[do not use GStreame
AC_ARG_WITH(hal, AS_HELP_STRING([--without-hal],[do not use HAL (dynamic device support)]))
AC_ARG_WITH(inotify, AS_HELP_STRING([--without-inotify],[do not use inotify (filesystem change notifications)]))
AC_ARG_WITH(jpeg, AS_HELP_STRING([--without-jpeg],[do not use JPEG]))
AC_ARG_WITH(jxrlib, AS_HELP_STRING([--without-jxrlib],[do not use JPEG-XR]))
AC_ARG_WITH(krb5, AS_HELP_STRING([--without-krb5],[do not use krb5 (Kerberos)]))
AC_ARG_WITH(ldap, AS_HELP_STRING([--without-ldap],[do not use LDAP]),
[if test "x$withval" = "xno"; then ac_cv_header_ldap_h=no; ac_cv_header_lber_h=no; fi])
......@@ -1829,6 +1830,21 @@ fi
WINE_WARNING_WITH(jpeg,[test "x$ac_cv_lib_soname_jpeg" = "x"],
[libjpeg ${notice_platform}development files not found, JPEG won't be supported.])
dnl **** Check for libjxrglue ****
if test "x$with_jxrlib" != "xno"
then
WINE_PACKAGE_FLAGS(JXRLIB,[jxrlib],,[${JXRLIB_CFLAGS:--I/usr/include/jxrlib}],,
[AC_CHECK_HEADERS([JXRGlue.h],,,[#define FAR])
if test "$ac_cv_header_JXRGlue_h" = "yes"
then
WINE_CHECK_SONAME(jxrglue,PKImageDecode_Create_WMP,,[JXRLIB_CFLAGS=""],[$JXRLIB_LIBS])
else
JXRLIB_CFLAGS=""
fi])
fi
WINE_NOTICE_WITH(jxrlib,[test "x$ac_cv_lib_soname_jxrglue" = "x"],
[jxrlib ${notice_platform}development files not found, JPEG-XR won't be supported.])
dnl **** Check for libpng ****
if test "x$with_png" != "xno"
then
......
......@@ -1531,8 +1531,7 @@ static void test_get_image_info(void)
for (i = 0; i < ARRAY_SIZE(test_image); ++i)
{
hr = D3DX10GetImageInfoFromMemory(test_image[i].data, test_image[i].size, NULL, &image_info, NULL);
todo_wine_if(test_image[i].expected.ImageFileFormat == D3DX10_IFF_WMP)
ok(hr == S_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
ok(hr == S_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
if (hr != S_OK)
continue;
check_image_info(&image_info, i, __LINE__);
......@@ -1552,13 +1551,11 @@ static void test_get_image_info(void)
create_file(test_filename, test_image[i].data, test_image[i].size, path);
hr = D3DX10GetImageInfoFromFileW(path, NULL, &image_info, NULL);
todo_wine_if(test_image[i].expected.ImageFileFormat == D3DX10_IFF_WMP)
ok(hr == S_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
if (hr == S_OK)
check_image_info(&image_info, i, __LINE__);
hr = D3DX10GetImageInfoFromFileA(get_str_a(path), NULL, &image_info, NULL);
todo_wine_if(test_image[i].expected.ImageFileFormat == D3DX10_IFF_WMP)
ok(hr == S_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
if (hr == S_OK)
check_image_info(&image_info, i, __LINE__);
......@@ -1583,13 +1580,11 @@ static void test_get_image_info(void)
resource_module = create_resource_module(test_resource_name, test_image[i].data, test_image[i].size);
hr = D3DX10GetImageInfoFromResourceW(resource_module, test_resource_name, NULL, &image_info, NULL);
todo_wine_if(test_image[i].expected.ImageFileFormat == D3DX10_IFF_WMP)
ok(hr == S_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
if (hr == S_OK)
check_image_info(&image_info, i, __LINE__);
hr = D3DX10GetImageInfoFromResourceA(resource_module, get_str_a(test_resource_name), NULL, &image_info, NULL);
todo_wine_if(test_image[i].expected.ImageFileFormat == D3DX10_IFF_WMP)
ok(hr == S_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
if (hr == S_OK)
check_image_info(&image_info, i, __LINE__);
......
......@@ -89,7 +89,7 @@ static void test_decode(void)
&IID_IWICBitmapDecoder, (void **)&decoder);
if (FAILED(hr))
{
todo_wine win_skip("WmpDecoder isn't available, skipping test\n");
win_skip("WmpDecoder isn't available, skipping test\n");
return;
}
......@@ -123,7 +123,7 @@ static void test_decode(void)
ok(count == 1, "unexpected count %u\n", count);
hr = IWICBitmapDecoder_GetFrame(decoder, 0, NULL);
ok(hr == E_INVALIDARG, "GetFrame(NULL) returned hr=%x\n", hr);
todo_wine ok(hr == E_INVALIDARG, "GetFrame(NULL) returned hr=%x\n", hr);
for (j = 2; j > 0; --j)
{
......
......@@ -300,6 +300,9 @@
/* Define to 1 if you have the <jpeglib.h> header file. */
#undef HAVE_JPEGLIB_H
/* Define to 1 if you have the <JXRGlue.h> header file. */
#undef HAVE_JXRGLUE_H
/* Define to 1 if you have the `kqueue' function. */
#undef HAVE_KQUEUE
......@@ -1265,6 +1268,9 @@
/* Define to the soname of the libjpeg library. */
#undef SONAME_LIBJPEG
/* Define to the soname of the libjxrglue library. */
#undef SONAME_LIBJXRGLUE
/* Define to the soname of the libkrb5 library. */
#undef SONAME_LIBKRB5
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment