Allocate padded RGB frames for FFmpeg video conversion
This commit is contained in:
1 parent
88e3e27145
commit
f81b93ad0d
3 files changed
+39
-4
No files matched your search
@@ -1,4 +1,5 @@
|
||||
#include "call_video_decoder.h"
|
||||
#include "video_frame_image.h"
|
||||
#include "debug_config.h"
|
||||
#include "../../../src/call/call_video_bitstream.h"
|
||||
#include <QTransform>
|
||||
@@ -88,7 +89,7 @@ bool CallVideoDecoder::decode(const call_video_frame& f, QImage& image) {
|
||||
valid = valid && (m->codec->profile == profile || (f.format.codec == CALL_VIDEO_H264
|
||||
&& f.format.profile == CALL_VIDEO_BASELINE && m->codec->profile == AV_PROFILE_H264_BASELINE));
|
||||
if (valid) {
|
||||
QImage output(decoded->width, decoded->height, QImage::Format_RGB888);
|
||||
QImage output = video_frame_image(decoded->width, decoded->height);
|
||||
m->scale = sws_getCachedContext(m->scale, decoded->width, decoded->height, AV_PIX_FMT_YUV420P,
|
||||
decoded->width, decoded->height, AV_PIX_FMT_RGB24, SWS_FAST_BILINEAR, nullptr, nullptr, nullptr);
|
||||
if (!m->scale || output.isNull()) valid = false;
|
||||
|
||||
Reference in new issue
Block a user