Skip to content

Commit

Permalink
Removed all detection logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Vouk committed Sep 10, 2020
1 parent 510878c commit ca3ba94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 40 deletions.
42 changes: 4 additions & 38 deletions Core/EncoderUtils.cpp
Expand Up @@ -116,71 +116,41 @@ bool EncoderUtils::IsEncoderAvailable(const wxString name)
// Hack for FFmpeg 4.3: NVENC
if (name.Lower().EndsWith("_nvenc"))
{
vkLogInfoVA("• Checking for 'nvcuda.dll' ...");

HINSTANCE lib = LoadLibraryA("nvcuda.dll");
if (lib == NULL)
{
vkLogInfoVA("• NVENC is not supported on this system!");
return false;
}
else
{
FreeLibrary(lib);
vkLogInfoVA("• Dynamic library 'nvcuda.dll' is present.");
}
}

// Hack for FFmpeg 4.3: AMD AMF
if (name.Lower().EndsWith("_amf"))
{
vkLogInfoVA("• Checking for 'amfrt64.dll' ...");

HINSTANCE lib = LoadLibraryA("amfrt64.dll");
if (lib == NULL)
{
vkLogInfoVA("• AMF is not supported on this system!");
return false;
}
else
{
FreeLibrary(lib);
vkLogInfoVA("• Dynamic library 'amfrt64.dll' is present.");
}
}

// Hack for FFmpeg 4.3: FDK AAC
if (name.Lower() == "libfdk_aac")
{
vkLogInfoVA("• Checking for 'libfdk-aac-2.dll' ...");

HINSTANCE lib = LoadLibraryA("libfdk-aac-2.dll");
if (lib == NULL)
{
vkLogInfoVA("• FDK AAC is not supported on this system!");
return false;
}
else
{
FreeLibrary(lib);
vkLogInfoVA("• Dynamic library 'libfdk-aac-2.dll' is present.");
}
}

vkLogInfoVA("• Trying to open the encoder ...");

AVCodec* codec = avcodec_find_encoder_by_name(name);
if (codec != NULL)
{
vkLogInfoVA("• Codec found");

AVCodecContext* codecContext = avcodec_alloc_context3(codec);
if (codecContext != NULL)
{
codecContext->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;

vkLogInfoVA("• Codec context created");

if (codec->type == AVMEDIA_TYPE_VIDEO)
{
codecContext->width = 320;
Expand All @@ -200,7 +170,7 @@ bool EncoderUtils::IsEncoderAvailable(const wxString name)
}
else
{
vkLogInfoVA("• This media type is not supported: %d", codec->type);
//vkLogInfoVA("• This media type is not supported: %d", codec->type);
return false;
}

Expand All @@ -212,21 +182,17 @@ bool EncoderUtils::IsEncoderAvailable(const wxString name)
// Only 0 is successful
ret = res == 0;

if (!ret)
vkLogInfoVA("• Encoder initialization failed (Code: %d)", res);
//if (!ret)
// vkLogInfoVA("• Encoder initialization failed (Code: %d)", res);
}
catch (...)
{
vkLogInfo("• Exception cought!");
//vkLogInfo("• Exception cought!");
return false;
}

vkLogInfoVA("• Codec successfully opened");

// Close the codec
avcodec_free_context(&codecContext);

vkLogInfoVA("• Cleaned up");
}
}

Expand Down
4 changes: 2 additions & 2 deletions Core/Voukoder.cpp
Expand Up @@ -108,8 +108,8 @@ BOOL Voukoder::Config::EnumNamesFunc(HMODULE hModule, LPCTSTR lpType, LPTSTR lpN
audioEncoderInfos.push_back(encoderInfo);
}
}
else
vkLogInfoVA("Unloading: encoders/%s.json", id);
//else
// vkLogInfoVA("Unloading: encoders/%s.json", id);
}
else if (lpType == MAKEINTRESOURCE(ID_MUXER))
{
Expand Down

0 comments on commit ca3ba94

Please sign in to comment.