If no library can be loaded at runtime ignore H264 capabilities.
This allows a build with only OpenH264 support and dynamic loading
enabled to function when no openh264 library was detected.
find_feature(GSSAPI ${GSSAPI_FEATURE_TYPE} ${GSSAPI_FEATURE_PURPOSE} ${GSSAPI_FEATURE_DESCRIPTION})
if (WITH_OPENH264 AND NOT WITH_OPENH264_LOADING)
- set(WITH_OPENH264_LOADING OFF)
+ option(WITH_OPENH264_LOADING "Use LoadLibrary to load openh264 at runtime" OFF)
endif (WITH_OPENH264 AND NOT WITH_OPENH264_LOADING)
if ((WITH_FFMPEG OR WITH_DSP_FFMPEG) AND NOT FFMPEG_FOUND)
if (!(codecs->h264 = h264_context_new(FALSE)))
{
WLog_ERR(TAG, "Failed to create h264 codec context");
+#ifndef WITH_OPENH264_LOADING
return FALSE;
+#endif
}
}
#endif
if (!context->codecs)
return FALSE;
- return freerdp_client_codecs_prepare(context->codecs, FREERDP_CODEC_ALL,
- settings->DesktopWidth, settings->DesktopHeight);
+ if (!freerdp_client_codecs_prepare(context->codecs, FREERDP_CODEC_ALL,
+ settings->DesktopWidth, settings->DesktopHeight))
+ return FALSE;
+
+/* Runtime H264 detection. (only available if dynamic backend loading is defined)
+ * If no backend is available disable it before the channel is loaded.
+ */
+#if defined(WITH_GFX_H264) && defined(WITH_OPENH264_LOADING)
+ if (!context->codecs->h264)
+ {
+ settings->GfxH264 = FALSE;
+ settings->GfxAVC444 = FALSE;
+ settings->GfxAVC444v2 = FALSE;
+ }
+#endif
+ return TRUE;
+
}
/**
gdiGfxSurface* surface;
RDPGFX_H264_METABLOCK* meta;
RDPGFX_AVC420_BITMAP_STREAM* bs;
+
surface = (gdiGfxSurface*) context->GetSurfaceData(context, cmd->surfaceId);
if (!surface)
return ERROR_INTERNAL_ERROR;
}
+ if (!surface->h264)
+ return ERROR_NOT_SUPPORTED;
+
bs = (RDPGFX_AVC420_BITMAP_STREAM*) cmd->extra;
if (!bs)
return ERROR_INTERNAL_ERROR;
}
+ if (!surface->h264)
+ return ERROR_NOT_SUPPORTED;
+
bs = (RDPGFX_AVC444_BITMAP_STREAM*) cmd->extra;
if (!bs)