Replace references to libav.

This commit is contained in:
Joel Linn 2020-06-19 22:34:06 +02:00 committed by Rick Gibbed
parent 47e36e6aee
commit d4cf474665
3 changed files with 12 additions and 13 deletions

View File

@ -14,6 +14,6 @@ project("xenia-apu")
defines({ defines({
}) })
includedirs({ includedirs({
project_root.."/third_party/libav/", project_root.."/third_party/FFmpeg/",
}) })
local_platform_files() local_platform_files()

View File

@ -2,7 +2,7 @@
****************************************************************************** ******************************************************************************
* Xenia : Xbox 360 Emulator Research Project * * 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. * * Released under the BSD license - see LICENSE in the root for more details. *
****************************************************************************** ******************************************************************************
*/ */
@ -20,9 +20,8 @@
#include "xenia/base/ring_buffer.h" #include "xenia/base/ring_buffer.h"
extern "C" { extern "C" {
#include "third_party/libav/libavcodec/avcodec.h" #include "third_party/FFmpeg/libavcodec/avcodec.h"
#include "third_party/libav/libavcodec/xma2dec.h" #include "third_party/FFmpeg/libavcodec/wma.h"
#include "third_party/libav/libavutil/channel_layout.h"
extern AVCodec ff_xma2_decoder; extern AVCodec ff_xma2_decoder;
} // extern "C" } // extern "C"
@ -559,7 +558,7 @@ void XmaContext::DecodePackets(XMA_CONTEXT_DATA* data) {
} }
} else if (len < 0) { } else if (len < 0) {
// Did not get frame // Did not get frame
XELOGAPU("libav failed to decode a frame!"); XELOGAPU("FFmpeg failed to decode a frame!");
if (frame_size && frame_size != 0x7FFF) { if (frame_size && frame_size != 0x7FFF) {
data->input_buffer_read_offset += frame_size; data->input_buffer_read_offset += frame_size;
} else { } 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; channels == 2 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
if (avcodec_open2(context_, codec_, NULL) < 0) { if (avcodec_open2(context_, codec_, NULL) < 0) {
XELOGE("XmaContext: Failed to reopen libav context"); XELOGE("XmaContext: Failed to reopen FFmpeg context");
return 1; return 1;
} }
} }

View File

@ -2,7 +2,7 @@
****************************************************************************** ******************************************************************************
* Xenia : Xbox 360 Emulator Research Project * * 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. * * Released under the BSD license - see LICENSE in the root for more details. *
****************************************************************************** ******************************************************************************
*/ */
@ -21,7 +21,7 @@
#include "xenia/kernel/xthread.h" #include "xenia/kernel/xthread.h"
extern "C" { extern "C" {
#include "third_party/libav/libavutil/log.h" #include "third_party/FFmpeg/libavutil/log.h"
} // extern "C" } // extern "C"
// As with normal Microsoft, there are like twelve different ways to access // 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 // do this, it's likely they are either passing the context to XAudio or
// using the XMA* functions. // 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"); "APU");
namespace xe { namespace xe {
@ -60,7 +60,7 @@ XmaDecoder::XmaDecoder(cpu::Processor* processor)
XmaDecoder::~XmaDecoder() = default; XmaDecoder::~XmaDecoder() = default;
void av_log_callback(void* avcl, int level, const char* fmt, va_list va) { 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; return;
} }
@ -101,12 +101,12 @@ void av_log_callback(void* avcl, int level, const char* fmt, va_list va) {
StringBuffer buff; StringBuffer buff;
buff.AppendVarargs(fmt, va); buff.AppendVarargs(fmt, va);
xe::logging::AppendLogLineFormat(log_level, level_char, "libav: {}", xe::logging::AppendLogLineFormat(log_level, level_char, "ffmpeg: {}",
buff.to_string_view()); buff.to_string_view());
} }
X_STATUS XmaDecoder::Setup(kernel::KernelState* kernel_state) { X_STATUS XmaDecoder::Setup(kernel::KernelState* kernel_state) {
// Setup libav logging callback // Setup ffmpeg logging callback
av_log_set_callback(av_log_callback); av_log_set_callback(av_log_callback);
// Let the processor know we want register access callbacks. // Let the processor know we want register access callbacks.