mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-07-31 12:58:39 +00:00
add:转发ffmpeg log
This commit is contained in:
parent
eded0d1f78
commit
43c1b6870f
2 changed files with 33 additions and 1 deletions
|
@ -22,14 +22,44 @@ Decoder::~Decoder()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void avLogCallback(void *avcl, int level, const char *fmt, va_list vl) {
|
||||||
|
Q_UNUSED(avcl);
|
||||||
|
Q_UNUSED(vl);
|
||||||
|
|
||||||
|
QString localFmt = QString::fromUtf8(fmt);
|
||||||
|
localFmt.prepend("[FFmpeg] ");
|
||||||
|
switch (level) {
|
||||||
|
case AV_LOG_PANIC:
|
||||||
|
case AV_LOG_FATAL:
|
||||||
|
qFatal(localFmt.toUtf8());
|
||||||
|
break;
|
||||||
|
case AV_LOG_ERROR:
|
||||||
|
qCritical(localFmt.toUtf8());
|
||||||
|
break;
|
||||||
|
case AV_LOG_WARNING:
|
||||||
|
qWarning(localFmt.toUtf8());
|
||||||
|
break;
|
||||||
|
case AV_LOG_INFO:
|
||||||
|
qInfo(localFmt.toUtf8());
|
||||||
|
break;
|
||||||
|
case AV_LOG_DEBUG:
|
||||||
|
//qDebug(localFmt.toUtf8());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// do not forward others, which are too verbose
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool Decoder::init()
|
bool Decoder::init()
|
||||||
{
|
{
|
||||||
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
|
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
|
||||||
av_register_all();
|
av_register_all();
|
||||||
#endif
|
#endif
|
||||||
if (avformat_network_init()) {
|
if (avformat_network_init()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
av_log_set_callback(avLogCallback);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
TODO.txt
2
TODO.txt
|
@ -8,7 +8,9 @@ Mac
|
||||||
|
|
||||||
最后更新scrcpy 7764a836f1ee02a4540cfc4118c20729018daaac
|
最后更新scrcpy 7764a836f1ee02a4540cfc4118c20729018daaac
|
||||||
|
|
||||||
|
TODO b35733edb6df2a00b6af9b1c98627d344c377963 鼠标事件相关系列
|
||||||
|
|
||||||
|
video window always_on_top options
|
||||||
mark:
|
mark:
|
||||||
|
|
||||||
ffmpeg编译参数详解
|
ffmpeg编译参数详解
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue