|
|
|
@ -198,43 +198,6 @@ await_for_server(bool *connected) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static SDL_LogPriority
|
|
|
|
|
sdl_priority_from_av_level(int level) {
|
|
|
|
|
switch (level) {
|
|
|
|
|
case AV_LOG_PANIC:
|
|
|
|
|
case AV_LOG_FATAL:
|
|
|
|
|
return SDL_LOG_PRIORITY_CRITICAL;
|
|
|
|
|
case AV_LOG_ERROR:
|
|
|
|
|
return SDL_LOG_PRIORITY_ERROR;
|
|
|
|
|
case AV_LOG_WARNING:
|
|
|
|
|
return SDL_LOG_PRIORITY_WARN;
|
|
|
|
|
case AV_LOG_INFO:
|
|
|
|
|
return SDL_LOG_PRIORITY_INFO;
|
|
|
|
|
}
|
|
|
|
|
// do not forward others, which are too verbose
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
av_log_callback(void *avcl, int level, const char *fmt, va_list vl) {
|
|
|
|
|
(void) avcl;
|
|
|
|
|
SDL_LogPriority priority = sdl_priority_from_av_level(level);
|
|
|
|
|
if (priority == 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
size_t fmt_len = strlen(fmt);
|
|
|
|
|
char *local_fmt = malloc(fmt_len + 10);
|
|
|
|
|
if (!local_fmt) {
|
|
|
|
|
LOG_OOM();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
memcpy(local_fmt, "[FFmpeg] ", 9); // do not write the final '\0'
|
|
|
|
|
memcpy(local_fmt + 9, fmt, fmt_len + 1); // include '\0'
|
|
|
|
|
SDL_LogMessageV(SDL_LOG_CATEGORY_VIDEO, priority, local_fmt, vl);
|
|
|
|
|
free(local_fmt);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
sc_demuxer_on_ended(struct sc_demuxer *demuxer, bool eos, void *userdata) {
|
|
|
|
|
(void) demuxer;
|
|
|
|
@ -426,8 +389,6 @@ scrcpy(struct scrcpy_options *options) {
|
|
|
|
|
recorder_initialized = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
av_log_set_callback(av_log_callback);
|
|
|
|
|
|
|
|
|
|
static const struct sc_demuxer_callbacks demuxer_cbs = {
|
|
|
|
|
.on_ended = sc_demuxer_on_ended,
|
|
|
|
|
};
|
|
|
|
|