screencast: Also send the header when we just send the cursor update

When sending a frame that just updates the cursor, also increment the
sequential value of the frame
This commit is contained in:
Aleix Pol 2022-06-27 21:13:18 +02:00 committed by Xaver Hugl
parent 84acb768ee
commit 7f73264f66
2 changed files with 9 additions and 3 deletions

View file

@ -488,7 +488,13 @@ void ScreenCastStream::recordFrame(const QRegion &damagedRegion)
}
}
spa_meta_header *spaHeader = (spa_meta_header *)spa_buffer_find_meta_data(spa_buffer, SPA_META_Header, sizeof(spaHeader));
addHeader(spa_buffer);
tryEnqueue(buffer);
}
void ScreenCastStream::addHeader(spa_buffer *spaBuffer)
{
spa_meta_header *spaHeader = (spa_meta_header *)spa_buffer_find_meta_data(spaBuffer, SPA_META_Header, sizeof(spaHeader));
if (spaHeader) {
spaHeader->flags = 0;
spaHeader->dts_offset = 0;
@ -500,8 +506,6 @@ void ScreenCastStream::recordFrame(const QRegion &damagedRegion)
}
spaHeader->pts = (timestamp - m_start.value()).count();
}
tryEnqueue(buffer);
}
void ScreenCastStream::recordCursor()
@ -531,6 +535,7 @@ void ScreenCastStream::recordCursor()
spa_buffer->datas[0].chunk->size = 0;
sendCursorData(Cursors::self()->currentCursor(),
(spa_meta_cursor *)spa_buffer_find_meta_data(spa_buffer, SPA_META_Cursor, sizeof(spa_meta_cursor)));
addHeader(spa_buffer);
enqueue();
}

View file

@ -80,6 +80,7 @@ private:
void updateParams();
void coreFailed(const QString &errorMessage);
void sendCursorData(Cursor *cursor, spa_meta_cursor *spa_cursor);
void addHeader(spa_buffer *spaBuffer);
void newStreamParams();
void tryEnqueue(pw_buffer *buffer);
void enqueue();