Skip to content

Commit

Permalink
Simplify debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jp9000 committed May 18, 2022
1 parent cbbcf98 commit dce17e5
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions plugins/obs-ffmpeg/texture-amf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ struct adapter_caps {

/* ------------------------------------------------------------------------- */

class obs_amf_trace_writer;
static std::unique_ptr<obs_amf_trace_writer> amf_trace_writer;
static std::map<uint32_t, adapter_caps> caps;
static bool h264_supported = false;
static AMFFactory *amf_factory = nullptr;
Expand Down Expand Up @@ -961,22 +959,6 @@ static void register_hevc()
/* ========================================================================= */
/* Global Stuff */

class obs_amf_trace_writer : public amf::AMFTraceWriter {
public:
void AMF_CDECL_CALL Write(const wchar_t *scope,
const wchar_t *text) override
{
#if DEBUG_AMF_STUFF
blog(LOG_DEBUG, "[AMF] [%ls] %ls", scope, text);
#else
(void)scope;
(void)text;
#endif
}

void AMF_CDECL_CALL Flush() override {}
};

extern "C" void amf_load(void)
try {
AMF_RESULT res;
Expand Down Expand Up @@ -1067,11 +1049,10 @@ try {
if (res != AMF_OK)
throw amf_error("AMFQueryVersion failed", res);

amf_trace_writer.reset(new obs_amf_trace_writer);
amf_trace->RegisterWriter(L"obs_amf_trace_writer",
amf_trace_writer.get(), true);
#ifndef DEBUG_AMF_STUFF
amf_trace->EnableWriter(AMF_TRACE_WRITER_DEBUG_OUTPUT, false);
amf_trace->EnableWriter(AMF_TRACE_WRITER_CONSOLE, false);
#endif

/* ----------------------------------- */
/* Register encoders */
Expand Down

0 comments on commit dce17e5

Please sign in to comment.