From ec0992e938de257fe046ac214a6f17ab802b1e45 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 10 May 2017 12:35:20 +0200 Subject: [PATCH 1/2] Added pkg-config to cmake OpenH264 detection. --- cmake/FindOpenH264.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/FindOpenH264.cmake b/cmake/FindOpenH264.cmake index 404c8b6cf..2efe2cd59 100644 --- a/cmake/FindOpenH264.cmake +++ b/cmake/FindOpenH264.cmake @@ -7,17 +7,22 @@ # OPENH264_INCLUDE_DIR - the OpenH264 include directory # OPENH264_LIBRARIES - libopenh264 library +if (UNIX AND NOT ANDROID) + find_package(PkgConfig QUIET) + pkg_check_modules(PC_OPENH264 QUIET openh264) +endif (UNIX AND NOT ANDROID) + if (OPENH264_INCLUDE_DIR AND OPENH264_LIBRARY) set(OPENH264_FIND_QUIETLY TRUE) endif (OPENH264_INCLUDE_DIR AND OPENH264_LIBRARY) find_path(OPENH264_INCLUDE_DIR NAMES wels/codec_api.h wels/codec_app_def.h wels/codec_def.h PATH_SUFFIXES include - HINTS ${OPENH264_ROOT}) + HINTS ${OPENH264_ROOT} ${PC_OPENH264_INCLUDE_DIRS}) find_library(OPENH264_LIBRARY NAMES openh264_dll openh264 welsdec PATH_SUFFIXES lib - HINTS ${OPENH264_ROOT}) + HINTS ${OPENH264_ROOT} ${PC_OPENH264_LIBRARY_DIRS}) include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenH264 DEFAULT_MSG OPENH264_LIBRARY OPENH264_INCLUDE_DIR) From 21e20ac9f26af9f31d5c417fc3c26927b59e2d36 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 10 May 2017 12:36:08 +0200 Subject: [PATCH 2/2] Initialize H264 context size for GFX surfaces. --- libfreerdp/gdi/gfx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libfreerdp/gdi/gfx.c b/libfreerdp/gdi/gfx.c index 05a5e3140..a78a2a152 100644 --- a/libfreerdp/gdi/gfx.c +++ b/libfreerdp/gdi/gfx.c @@ -424,6 +424,9 @@ static UINT gdi_SurfaceCommand_AVC420(rdpGdi* gdi, WLog_ERR(TAG, "%s: unable to create h264 context", __FUNCTION__); return ERROR_NOT_ENOUGH_MEMORY; } + + if (!h264_context_reset(surface->h264, surface->width, surface->height)) + return ERROR_INTERNAL_ERROR; } bs = (RDPGFX_AVC420_BITMAP_STREAM*) cmd->extra; @@ -493,6 +496,9 @@ static UINT gdi_SurfaceCommand_AVC444(rdpGdi* gdi, RdpgfxClientContext* context, WLog_ERR(TAG, "%s: unable to create h264 context", __FUNCTION__); return ERROR_NOT_ENOUGH_MEMORY; } + + if (!h264_context_reset(surface->h264, surface->width, surface->height)) + return ERROR_INTERNAL_ERROR; } bs = (RDPGFX_AVC444_BITMAP_STREAM*) cmd->extra;