forked from bartvdbraak/blender
Added new command-line arguments --debug-ffmpeg and --debug-libmv to
be able to see debug prints coming from FFmpeg or libmv independently of general blender debug messages.
This commit is contained in:
parent
81e3db364d
commit
785373b03a
@ -332,6 +332,9 @@ def creator(env):
|
||||
incs.append('#/extern/libmv')
|
||||
defs.append('WITH_LIBMV')
|
||||
|
||||
if env['WITH_BF_FFMPEG']:
|
||||
defs.append('WITH_FFMPEG')
|
||||
|
||||
if env['WITH_BF_PYTHON']:
|
||||
incs.append('#/source/blender/python')
|
||||
defs.append('WITH_PYTHON')
|
||||
|
@ -107,6 +107,7 @@ typedef struct Global {
|
||||
#define G_DEBUG (1 << 12)
|
||||
#define G_SCRIPT_AUTOEXEC (1 << 13)
|
||||
#define G_SCRIPT_OVERRIDE_PREF (1 << 14) /* when this flag is set ignore the userprefs */
|
||||
#define G_DEBUG_FFMPEG (1 << 15)
|
||||
|
||||
/* #define G_NOFROZEN (1 << 17) also removed */
|
||||
/* #define G_GREASEPENCIL (1 << 17) also removed */
|
||||
|
@ -281,7 +281,7 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
|
||||
|
||||
/* special cases, override loaded flags: */
|
||||
if (G.f != bfd->globalf) {
|
||||
const int flags_keep= (G_DEBUG | G_SWAP_EXCHANGE | G_SCRIPT_AUTOEXEC | G_SCRIPT_OVERRIDE_PREF);
|
||||
const int flags_keep= (G_DEBUG | G_DEBUG_FFMPEG | G_SWAP_EXCHANGE | G_SCRIPT_AUTOEXEC | G_SCRIPT_OVERRIDE_PREF);
|
||||
bfd->globalf= (bfd->globalf & ~flags_keep) | (G.f & flags_keep);
|
||||
}
|
||||
|
||||
|
@ -231,8 +231,7 @@ void do_init_ffmpeg(void)
|
||||
ffmpeg_init = 1;
|
||||
av_register_all();
|
||||
avdevice_register_all();
|
||||
|
||||
if ((G.f & G_DEBUG) == 0) {
|
||||
if ((G.f & G_DEBUG_FFMPEG) == 0) {
|
||||
silence_log_ffmpeg(1);
|
||||
}
|
||||
else {
|
||||
|
@ -49,6 +49,10 @@ if(WITH_LIBMV)
|
||||
add_definitions(-DWITH_LIBMV)
|
||||
endif()
|
||||
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
add_definitions(-DWITH_FFMPEG)
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON)
|
||||
blender_include_dirs(../blender/python)
|
||||
add_definitions(-DWITH_PYTHON)
|
||||
|
@ -247,6 +247,15 @@ static int print_help(int UNUSED(argc), const char **UNUSED(argv), void *data)
|
||||
printf("Misc Options:\n");
|
||||
BLI_argsPrintArgDoc(ba, "--debug");
|
||||
BLI_argsPrintArgDoc(ba, "--debug-fpe");
|
||||
|
||||
#ifdef WITH_FFMPEG
|
||||
BLI_argsPrintArgDoc(ba, "--debug-ffmpeg");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_LIBMV
|
||||
BLI_argsPrintArgDoc(ba, "--debug-libmv");
|
||||
#endif
|
||||
|
||||
printf("\n");
|
||||
BLI_argsPrintArgDoc(ba, "--factory-startup");
|
||||
printf("\n");
|
||||
@ -359,14 +368,28 @@ static int debug_mode(int UNUSED(argc), const char **UNUSED(argv), void *data)
|
||||
printf("Build: %s %s %s %s\n", build_date, build_time, build_platform, build_type);
|
||||
#endif // WITH_BUILDINFO
|
||||
|
||||
#ifdef WITH_LIBMV
|
||||
libmv_startDebugLogging();
|
||||
#endif
|
||||
|
||||
BLI_argsPrint(data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef WITH_LIBMV
|
||||
static int debug_mode_libmv(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
|
||||
{
|
||||
libmv_startDebugLogging();
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WITH_FFMPEG
|
||||
static int debug_mode_ffmpeg(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
|
||||
{
|
||||
G.f |= G_DEBUG_FFMPEG;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int set_fpe(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
|
||||
{
|
||||
#if defined(__linux__) || defined(_WIN32) || defined(OSX_SSE_FPE)
|
||||
@ -1079,6 +1102,14 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
|
||||
BLI_argsAdd(ba, 1, "-d", "--debug", debug_doc, debug_mode, ba);
|
||||
BLI_argsAdd(ba, 1, NULL, "--debug-fpe", "\n\tEnable floating point exceptions", set_fpe, NULL);
|
||||
|
||||
#ifdef WITH_FFMPEG
|
||||
BLI_argsAdd(ba, 1, NULL, "--debug-ffmpeg", "\n\tEnable debug messages from FFmpeg library", debug_mode_ffmpeg, NULL);
|
||||
#endif
|
||||
|
||||
#ifdef WITH_LIBMV
|
||||
BLI_argsAdd(ba, 1, NULL, "--debug-libmv", "\n\tEnable debug messages from libmv library", debug_mode_libmv, NULL);
|
||||
#endif
|
||||
|
||||
BLI_argsAdd(ba, 1, NULL, "--factory-startup", "\n\tSkip reading the "STRINGIFY (BLENDER_STARTUP_FILE)" in the users home directory", set_factory_startup, NULL);
|
||||
|
||||
/* TODO, add user env vars? */
|
||||
|
Loading…
Reference in New Issue
Block a user