Use current FFmpeg profile constants and qualify video port status

This commit is contained in:
evgeny committed 2026-10-14 22:39:56 +02:00
1 parent af35d03399
commit d01bc395fa
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -59,7 +59,7 @@ bool CallVideoDecoder::decode(const call_video_frame& f, QImage& image) {
} }
bool valid = result >= 0 && decoded->pts == f.pts_us && decoded->width == f.format.width && decoded->height == f.format.height bool valid = result >= 0 && decoded->pts == f.pts_us && decoded->width == f.format.width && decoded->height == f.format.height
&& decoded->format == AV_PIX_FMT_YUV420P && !m->codec->has_b_frames && m->codec->level <= f.format.level; && decoded->format == AV_PIX_FMT_YUV420P && !m->codec->has_b_frames && m->codec->level <= f.format.level;
int profile = f.format.codec == CALL_VIDEO_H265 ? FF_PROFILE_HEVC_MAIN : FF_PROFILE_H264_CONSTRAINED_BASELINE; int profile = f.format.codec == CALL_VIDEO_H265 ? AV_PROFILE_HEVC_MAIN : AV_PROFILE_H264_CONSTRAINED_BASELINE;
valid = valid && m->codec->profile == profile; valid = valid && m->codec->profile == profile;
if (valid) { if (valid) {
QImage output(decoded->width, decoded->height, QImage::Format_RGB888); QImage output(decoded->width, decoded->height, QImage::Format_RGB888);
@@ -67,7 +67,7 @@ bool CallVideoDecoder::decode(const call_video_frame& f, QImage& image) {
decoded->width, decoded->height, AV_PIX_FMT_RGB24, SWS_FAST_BILINEAR, nullptr, nullptr, nullptr); decoded->width, decoded->height, AV_PIX_FMT_RGB24, SWS_FAST_BILINEAR, nullptr, nullptr, nullptr);
if (!m->scale || output.isNull()) valid = false; if (!m->scale || output.isNull()) valid = false;
else { else {
uint8_t* planes[4] = {output.bits(), nullptr, nullptr, nullptr}; int strides[4] = {output.bytesPerLine(), 0, 0, 0}; uint8_t* planes[4] = {output.bits(), nullptr, nullptr, nullptr}; int strides[4] = {(int)output.bytesPerLine(), 0, 0, 0};
valid = sws_scale(m->scale, decoded->data, decoded->linesize, 0, decoded->height, planes, strides) == decoded->height; valid = sws_scale(m->scale, decoded->data, decoded->linesize, 0, decoded->height, planes, strides) == decoded->height;
if (valid) image = f.format.rotation ? output.transformed(QTransform().rotate(f.format.rotation)) : output; if (valid) image = f.format.rotation ? output.transformed(QTransform().rotate(f.format.rotation)) : output;
} }
+1 -1
View File
@@ -148,7 +148,7 @@ void CallVideoEngine::transmit() {
int64_t lastPts = -1, lastKey = -1; int64_t lastPts = -1, lastKey = -1;
bool forceKey = true; bool forceKey = true;
while (m->running) { while (m->running) {
call_video_port_status state{}; struct call_video_port_status state{};
if (call_video_port_status(m->id, &state) < 0) break; if (call_video_port_status(m->id, &state) < 0) break;
uint64_t revision; bool enabled; int width, height, codec; int64_t pts; uint64_t revision; bool enabled; int width, height, codec; int64_t pts;
#ifdef HAVE_STREAM_CAPTURE #ifdef HAVE_STREAM_CAPTURE