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:
parent
84acb768ee
commit
7f73264f66
2 changed files with 9 additions and 3 deletions
|
@ -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) {
|
if (spaHeader) {
|
||||||
spaHeader->flags = 0;
|
spaHeader->flags = 0;
|
||||||
spaHeader->dts_offset = 0;
|
spaHeader->dts_offset = 0;
|
||||||
|
@ -500,8 +506,6 @@ void ScreenCastStream::recordFrame(const QRegion &damagedRegion)
|
||||||
}
|
}
|
||||||
spaHeader->pts = (timestamp - m_start.value()).count();
|
spaHeader->pts = (timestamp - m_start.value()).count();
|
||||||
}
|
}
|
||||||
|
|
||||||
tryEnqueue(buffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenCastStream::recordCursor()
|
void ScreenCastStream::recordCursor()
|
||||||
|
@ -531,6 +535,7 @@ void ScreenCastStream::recordCursor()
|
||||||
spa_buffer->datas[0].chunk->size = 0;
|
spa_buffer->datas[0].chunk->size = 0;
|
||||||
sendCursorData(Cursors::self()->currentCursor(),
|
sendCursorData(Cursors::self()->currentCursor(),
|
||||||
(spa_meta_cursor *)spa_buffer_find_meta_data(spa_buffer, SPA_META_Cursor, sizeof(spa_meta_cursor)));
|
(spa_meta_cursor *)spa_buffer_find_meta_data(spa_buffer, SPA_META_Cursor, sizeof(spa_meta_cursor)));
|
||||||
|
addHeader(spa_buffer);
|
||||||
enqueue();
|
enqueue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,7 @@ private:
|
||||||
void updateParams();
|
void updateParams();
|
||||||
void coreFailed(const QString &errorMessage);
|
void coreFailed(const QString &errorMessage);
|
||||||
void sendCursorData(Cursor *cursor, spa_meta_cursor *spa_cursor);
|
void sendCursorData(Cursor *cursor, spa_meta_cursor *spa_cursor);
|
||||||
|
void addHeader(spa_buffer *spaBuffer);
|
||||||
void newStreamParams();
|
void newStreamParams();
|
||||||
void tryEnqueue(pw_buffer *buffer);
|
void tryEnqueue(pw_buffer *buffer);
|
||||||
void enqueue();
|
void enqueue();
|
||||||
|
|
Loading…
Reference in a new issue