From d4cf474665f150f9d2f86f32223f2f8a6d1ac853 Mon Sep 17 00:00:00 2001 From: Joel Linn Date: Fri, 19 Jun 2020 22:34:06 +0200 Subject: [PATCH] Replace references to libav. --- src/xenia/apu/premake5.lua | 2 +- src/xenia/apu/xma_context.cc | 11 +++++------ src/xenia/apu/xma_decoder.cc | 12 ++++++------ 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/xenia/apu/premake5.lua b/src/xenia/apu/premake5.lua index a3284fe0e..3f1b45aed 100644 --- a/src/xenia/apu/premake5.lua +++ b/src/xenia/apu/premake5.lua @@ -14,6 +14,6 @@ project("xenia-apu") defines({ }) includedirs({ - project_root.."/third_party/libav/", + project_root.."/third_party/FFmpeg/", }) local_platform_files() diff --git a/src/xenia/apu/xma_context.cc b/src/xenia/apu/xma_context.cc index e5cdb2561..21a597046 100644 --- a/src/xenia/apu/xma_context.cc +++ b/src/xenia/apu/xma_context.cc @@ -2,7 +2,7 @@ ****************************************************************************** * Xenia : Xbox 360 Emulator Research Project * ****************************************************************************** -* Copyright 2015 Ben Vanik. All rights reserved. * +* Copyright 2021 Ben Vanik. All rights reserved. * * Released under the BSD license - see LICENSE in the root for more details. * ****************************************************************************** */ @@ -20,9 +20,8 @@ #include "xenia/base/ring_buffer.h" extern "C" { -#include "third_party/libav/libavcodec/avcodec.h" -#include "third_party/libav/libavcodec/xma2dec.h" -#include "third_party/libav/libavutil/channel_layout.h" +#include "third_party/FFmpeg/libavcodec/avcodec.h" +#include "third_party/FFmpeg/libavcodec/wma.h" extern AVCodec ff_xma2_decoder; } // extern "C" @@ -559,7 +558,7 @@ void XmaContext::DecodePackets(XMA_CONTEXT_DATA* data) { } } else if (len < 0) { // Did not get frame - XELOGAPU("libav failed to decode a frame!"); + XELOGAPU("FFmpeg failed to decode a frame!"); if (frame_size && frame_size != 0x7FFF) { data->input_buffer_read_offset += frame_size; } else { @@ -638,7 +637,7 @@ int XmaContext::PrepareDecoder(uint8_t* block, size_t size, int sample_rate, channels == 2 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO; if (avcodec_open2(context_, codec_, NULL) < 0) { - XELOGE("XmaContext: Failed to reopen libav context"); + XELOGE("XmaContext: Failed to reopen FFmpeg context"); return 1; } } diff --git a/src/xenia/apu/xma_decoder.cc b/src/xenia/apu/xma_decoder.cc index ee1c9aa45..5c0476eea 100644 --- a/src/xenia/apu/xma_decoder.cc +++ b/src/xenia/apu/xma_decoder.cc @@ -2,7 +2,7 @@ ****************************************************************************** * Xenia : Xbox 360 Emulator Research Project * ****************************************************************************** - * Copyright 2013 Ben Vanik. All rights reserved. * + * Copyright 2021 Ben Vanik. All rights reserved. * * Released under the BSD license - see LICENSE in the root for more details. * ****************************************************************************** */ @@ -21,7 +21,7 @@ #include "xenia/kernel/xthread.h" extern "C" { -#include "third_party/libav/libavutil/log.h" +#include "third_party/FFmpeg/libavutil/log.h" } // extern "C" // As with normal Microsoft, there are like twelve different ways to access @@ -48,7 +48,7 @@ extern "C" { // do this, it's likely they are either passing the context to XAudio or // using the XMA* functions. -DEFINE_bool(libav_verbose, false, "Verbose libav output (debug and above)", +DEFINE_bool(ffmpeg_verbose, false, "Verbose FFmpeg output (debug and above)", "APU"); namespace xe { @@ -60,7 +60,7 @@ XmaDecoder::XmaDecoder(cpu::Processor* processor) XmaDecoder::~XmaDecoder() = default; void av_log_callback(void* avcl, int level, const char* fmt, va_list va) { - if (!cvars::libav_verbose && level > AV_LOG_WARNING) { + if (!cvars::ffmpeg_verbose && level > AV_LOG_WARNING) { return; } @@ -101,12 +101,12 @@ void av_log_callback(void* avcl, int level, const char* fmt, va_list va) { StringBuffer buff; buff.AppendVarargs(fmt, va); - xe::logging::AppendLogLineFormat(log_level, level_char, "libav: {}", + xe::logging::AppendLogLineFormat(log_level, level_char, "ffmpeg: {}", buff.to_string_view()); } X_STATUS XmaDecoder::Setup(kernel::KernelState* kernel_state) { - // Setup libav logging callback + // Setup ffmpeg logging callback av_log_set_callback(av_log_callback); // Let the processor know we want register access callbacks.