Ejemplo n.º 1
0
void get_x264_log(void *param, int i_level, const char *psz, va_list argptr)
{
    String chi;

    chi << TEXT("x264: ") << String(psz);
    chi.FindReplace(TEXT("%s"), TEXT("%S"));

    OSDebugOutva(chi, argptr);

    chi.FindReplace(TEXT("\r"), TEXT(""));
    chi.FindReplace(TEXT("\n"), TEXT(""));

    if (chi == TEXT("x264: OpenCL: fatal error, aborting encode") || chi == TEXT("x264: OpenCL: Invalid value."))
    {
        if (App->IsRunning())
        {
            // FIXME: currently due to the way OBS handles the stream report, if reconnect is enabled and this error happens
            // outside of the 30 second "no reconnect" window, no error dialog is shown to the user. usually x264 opencl errors
            // will happen immediately though.
            Log(TEXT("Aborting stream due to x264 opencl error"));
            App->SetStreamReport(TEXT("x264 OpenCL Error\r\n\r\nx264 encountered an error attempting to use OpenCL. This may be due to unsupported hardware or outdated drivers.\r\n\r\nIt is recommended that you remove opencl=true from your x264 advanced settings."));
            PostMessage(hwndMain, OBS_REQUESTSTOP, 1, 0);
        }
    }

    Logva(chi.Array(), argptr);
}
Ejemplo n.º 2
0
void __cdecl OSDebugOut(const TCHAR *format, ...)
{
    va_list arglist;

    va_start(arglist, format);

    OSDebugOutva(format, arglist);
}
Ejemplo n.º 3
0
void get_x264_log(void *param, int i_level, const char *psz, va_list argptr)
{
    String chi;
    
    chi << TEXT("x264: ") << String(psz);
    chi.FindReplace(TEXT("%s"), TEXT("%S"));

    OSDebugOutva(chi, argptr);

    chi.FindReplace(TEXT("\r"), TEXT(""));
    chi.FindReplace(TEXT("\n"), TEXT(""));

    Logva(chi.Array(), argptr);
}
Ejemplo n.º 4
0
void __cdecl AppWarning(const TCHAR *format, ...)
{
    if(!format) return;

    va_list arglist;

    va_start(arglist, format);

    String strOut(L"Warning -- ");
    strOut << FormattedStringva(format, arglist);

    if(bLogStarted)
    {
        OpenLogFile();
        LogFile.WriteAsUTF8(strOut, strOut.Length());
        LogFile.WriteAsUTF8(TEXT("\r\n"));
        CloseLogFile();
    }

    OSDebugOut(TEXT("Warning -- "));
    OSDebugOutva(format, arglist);
    OSDebugOut(TEXT("\r\n"));

    //------------------------------------------------------
    // NOTE:
    // If you're seeting this, you can safely continue running, but I recommend fixing whatever's causing this warning.
    //
    // The debug output window contains the warning that has occured.
    //------------------------------------------------------

#if defined(_DEBUG) && defined(_WIN32)
    if(bDebugBreak && OSDebuggerPresent())
    {
        ProgramBreak();
    }
#endif

    StringLog.Append(strOut);
}
Ejemplo n.º 5
0
void get_x264_log(void *param, int i_level, const char *psz, va_list argptr)
{
	String chi;

	chi << TEXT("x264: ") << String(psz);
	chi.FindReplace(TEXT("%s"), TEXT("%S"));

	OSDebugOutva(chi, argptr);

	chi.FindReplace(TEXT("\r"), TEXT(""));
	chi.FindReplace(TEXT("\n"), TEXT(""));

	if (chi == TEXT("x264: OpenCL: fatal error, aborting encode") || chi == TEXT("x264: OpenCL: Invalid value."))
	{
		// FIXME: currently due to the way BLive handles the stream report, if reconnect is enabled and this error happens
		// outside of the 30 second "no reconnect" window, no error dialog is shown to the user. usually x264 opencl errors
		// will happen immediately though.
		Log::writeError(LOG_RTSPSERV,1,"LiveSDK_Log:Aborting stream due to x264 opencl error!!x264 OpenCL Error\r\n\r\nx264 encountered an error attempting to use OpenCL. This may be due to unsupported hardware or outdated drivers.\r\n\r\nIt is recommended that you remove opencl=true from your x264 advanced settings.");
	}
	
	//Log::writeError(LOG_RTSPSERV, 1, chi);
}
Ejemplo n.º 6
0
void __cdecl Logva(const TCHAR *format, va_list argptr)
{
    if(!format) return;

#ifdef _DEBUG
    OSDebugOutva(format, argptr);
    OSDebugOut(L"\n");
#endif

    String strCurTime = CurrentTimeString();
    strCurTime << TEXT(": ");
    String strOut = strCurTime;
    strOut << FormattedStringva(format, argptr);

    strOut.FindReplace(TEXT("\n"), String() << TEXT("\n") << strCurTime);

    OpenLogFile();
    LogFile.WriteAsUTF8(strOut, strOut.Length());
    LogFile.WriteAsUTF8(TEXT("\r\n"));
    CloseLogFile();

    StringLog.Append(strOut);
}