mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 23:41:26 +12:00
cli: add ability to log ffmpeg codecs
This commit is contained in:
parent
f11770b88b
commit
911cd678ff
3 changed files with 68 additions and 3 deletions
|
@ -65,6 +65,7 @@ DYNAMIC_IMPORT("ntdll.dll", NtSetTimerResolution, NTSTATUS(ULONG DesiredResoluti
|
|||
#include "Utilities/Thread.h"
|
||||
#include "Utilities/File.h"
|
||||
#include "Utilities/StrUtil.h"
|
||||
#include "util/media_utils.h"
|
||||
#include "rpcs3_version.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/system_utils.hpp"
|
||||
|
@ -303,6 +304,7 @@ constexpr auto arg_rsx_capture = "rsx-capture";
|
|||
constexpr auto arg_timer = "high-res-timer";
|
||||
constexpr auto arg_verbose_curl = "verbose-curl";
|
||||
constexpr auto arg_any_location = "allow-any-location";
|
||||
constexpr auto arg_codecs = "codecs";
|
||||
|
||||
int find_arg(std::string arg, int& argc, char* argv[])
|
||||
{
|
||||
|
@ -664,12 +666,36 @@ int main(int argc, char** argv)
|
|||
parser.addOption(QCommandLineOption(arg_timer, "Enable high resolution timer for better performance (windows)", "enabled", "1"));
|
||||
parser.addOption(QCommandLineOption(arg_verbose_curl, "Enable verbose curl logging."));
|
||||
parser.addOption(QCommandLineOption(arg_any_location, "Allow RPCS3 to be run from any location. Dangerous"));
|
||||
const QCommandLineOption codec_option(arg_codecs, "List ffmpeg codecs");
|
||||
parser.addOption(codec_option);
|
||||
parser.process(app->arguments());
|
||||
|
||||
// Don't start up the full rpcs3 gui if we just want the version or help.
|
||||
if (parser.isSet(version_option) || parser.isSet(help_option))
|
||||
return 0;
|
||||
|
||||
if (parser.isSet(codec_option))
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (AttachConsole(ATTACH_PARENT_PROCESS) || AllocConsole())
|
||||
{
|
||||
[[maybe_unused]] const auto con_out = freopen("CONOUT$", "w", stdout);
|
||||
[[maybe_unused]] const auto con_err = freopen("CONOUT$", "w", stderr);
|
||||
}
|
||||
#endif
|
||||
for (const utils::ffmpeg_codec& codec : utils::list_ffmpeg_decoders())
|
||||
{
|
||||
fprintf(stdout, "Found ffmpeg decoder: %s (%d, %s)\n", codec.name.c_str(), codec.codec_id, codec.long_name.c_str());
|
||||
sys_log.success("Found ffmpeg decoder: %s (%d, %s)", codec.name, codec.codec_id, codec.long_name);
|
||||
}
|
||||
for (const utils::ffmpeg_codec& codec : utils::list_ffmpeg_encoders())
|
||||
{
|
||||
fprintf(stdout, "Found ffmpeg encoder: %s (%d, %s)\n", codec.name.c_str(), codec.codec_id, codec.long_name.c_str());
|
||||
sys_log.success("Found ffmpeg encoder: %s (%d, %s)", codec.name, codec.codec_id, codec.long_name);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Set curl to verbose if needed
|
||||
rpcs3::curl::g_curl_verbose = parser.isSet(arg_verbose_curl);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue