|
|
|
|
@ -141,8 +141,8 @@ void StreamPlayerWindow::tick() {
|
|
|
|
|
} |
|
|
|
|
if (!image.isNull()) { |
|
|
|
|
m_render->setFrame(image); |
|
|
|
|
m_status->setText(text("Live")); |
|
|
|
|
if (!p.shown++) { |
|
|
|
|
m_status->setText(text("Live")); |
|
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_STREAM, "desktop first frame id=%llu %dx%d", (unsigned long long)p.id, image.width(), image.height()); |
|
|
|
|
} |
|
|
|
|
emit framePresented(); |
|
|
|
|
@ -275,7 +275,8 @@ void StreamPlayerWindow::decode() {
|
|
|
|
|
frame->width, frame->height, AV_PIX_FMT_RGB24, SWS_BILINEAR, nullptr, nullptr, nullptr); |
|
|
|
|
QImage image(frame->width, frame->height, QImage::Format_RGB888); |
|
|
|
|
if (!converter || image.isNull()) { fail(text("Stream decoder allocation failed")); p.running = false; break; } |
|
|
|
|
uint8_t* destination[] = {image.bits(), nullptr, nullptr, nullptr}; int strides[] = {image.bytesPerLine(), 0, 0, 0}; |
|
|
|
|
uint8_t* destination[] = {image.bits(), nullptr, nullptr, nullptr}; |
|
|
|
|
int strides[] = {static_cast<int>(image.bytesPerLine()), 0, 0, 0}; |
|
|
|
|
if (sws_scale(converter, frame->data, frame->linesize, 0, frame->height, destination, strides) != frame->height) { |
|
|
|
|
fail(text("Stream video conversion failed")); p.running = false; break; |
|
|
|
|
} |
|
|
|
|
|