Commit 833cf973 authored by François Grisez's avatar François Grisez
Browse files

Fixes detection of VideoToobox presence

Experience has shown that using lazy binding to detect the
presence of VideoToolbox on the system at runtime was not
accurate. At now, VideoToolbox is enabled at runtime only
if the system version is higher than 8.0 for iOS and 10.8
for MacOSX
parent e3dc3a02
...@@ -832,15 +832,17 @@ MSFilterDesc ms_vt_h264_dec = { ...@@ -832,15 +832,17 @@ MSFilterDesc ms_vt_h264_dec = {
}; };
void _register_videotoolbox_if_supported(MSFactory *factory) { void _register_videotoolbox_if_supported(MSFactory *factory) {
if (VTCompressionSessionCreate != NULL #ifdef IOS
&& VTDecompressionSessionCreate != NULL if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_8_0) {
&& CMVideoFormatDescriptionCreateFromH264ParameterSets != NULL) { #else
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_8) {
#endif
ms_message("Registering VideoToobox H264 codec");
ms_factory_register_filter(factory, &ms_vt_h264_enc); ms_factory_register_filter(factory, &ms_vt_h264_enc);
ms_factory_register_filter(factory, &ms_vt_h264_dec); ms_factory_register_filter(factory, &ms_vt_h264_dec);
} else { } else {
ms_warning("Cannot register VideoToolbox filters. Those filters" ms_warning("Cannot register VideoToolbox H264 codec. That"
" require iOS 8 or MacOSX 10.8"); " requires iOS 8 or MacOSX 10.8");
} }
} }
......
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