Last active
August 30, 2022 07:56
-
-
Save sayap/f343bff7700d45b555aea7e581097314 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/plugins/screencast/screencaststream.cpp b/src/plugins/screencast/screencaststream.cpp | |
index 6f25b563a..a38261e9e 100644 | |
--- a/src/plugins/screencast/screencaststream.cpp | |
+++ b/src/plugins/screencast/screencaststream.cpp | |
@@ -107,13 +107,17 @@ void ScreenCastStream::newStreamParams() | |
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, | |
SPA_PARAM_META_type, SPA_POD_Id(SPA_META_VideoDamage), | |
SPA_PARAM_META_size, SPA_POD_CHOICE_RANGE_Int(sizeof(struct spa_meta_region) * videoDamageRegionCount, sizeof(struct spa_meta_region) * 1, sizeof(struct spa_meta_region) * videoDamageRegionCount)), | |
+ (spa_pod *)spa_pod_builder_add_object(&pod_builder, | |
+ SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, | |
+ SPA_PARAM_META_type, SPA_POD_Id(SPA_META_VideoCrop), | |
+ SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_region))), | |
(spa_pod *)spa_pod_builder_add_object(&pod_builder, | |
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, | |
SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header), | |
SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header))), | |
}; | |
- pw_stream_update_params(pwStream, params, 4); | |
+ pw_stream_update_params(pwStream, params, 5); | |
} | |
void ScreenCastStream::onStreamParamChanged(void *data, uint32_t id, const struct spa_pod *format) | |
@@ -446,6 +450,7 @@ void ScreenCastStream::recordFrame(const QRegion &damagedRegion) | |
addDamage(spa_buffer, damagedRegion | QRect({0, 0}, size)); | |
addHeader(spa_buffer); | |
+ addVideoCrop(spa_buffer); | |
tryEnqueue(buffer); | |
} | |
@@ -465,6 +470,17 @@ void ScreenCastStream::addHeader(spa_buffer *spaBuffer) | |
} | |
} | |
+void ScreenCastStream::addVideoCrop(spa_buffer *spaBuffer) | |
+{ | |
+ spa_meta_region *spaVideoCrop = (spa_meta_region *)spa_buffer_find_meta_data(spaBuffer, SPA_META_VideoCrop, sizeof(spaVideoCrop)); | |
+ if (spaVideoCrop) { | |
+ spaVideoCrop->region.position.x = 0; | |
+ spaVideoCrop->region.position.y = 0; | |
+ spaVideoCrop->region.size.width = m_resolution.width(); | |
+ spaVideoCrop->region.size.height = m_resolution.height(); | |
+ } | |
+} | |
+ | |
void ScreenCastStream::addDamage(spa_buffer *spaBuffer, const QRegion &damagedRegion) | |
{ | |
if (spa_meta *vdMeta = spa_buffer_find_meta(spaBuffer, SPA_META_VideoDamage)) { | |
@@ -525,6 +541,7 @@ void ScreenCastStream::recordCursor() | |
sendCursorData(Cursors::self()->currentCursor(), | |
(spa_meta_cursor *)spa_buffer_find_meta_data(spa_buffer, SPA_META_Cursor, sizeof(spa_meta_cursor))); | |
addHeader(spa_buffer); | |
+ addVideoCrop(spa_buffer); | |
addDamage(spa_buffer, {}); | |
enqueue(); | |
} | |
diff --git a/src/plugins/screencast/screencaststream.h b/src/plugins/screencast/screencaststream.h | |
index 872d01b02..6dbf755f3 100644 | |
--- a/src/plugins/screencast/screencaststream.h | |
+++ b/src/plugins/screencast/screencaststream.h | |
@@ -80,6 +80,7 @@ private: | |
void coreFailed(const QString &errorMessage); | |
void sendCursorData(Cursor *cursor, spa_meta_cursor *spa_cursor); | |
void addHeader(spa_buffer *spaBuffer); | |
+ void addVideoCrop(spa_buffer *spaBuffer); | |
void addDamage(spa_buffer *spaBuffer, const QRegion &damagedRegion); | |
void newStreamParams(); | |
void tryEnqueue(pw_buffer *buffer); |
kanwarplaha
commented
Jul 22, 2022
via email
Hmm I'll give it another go and see if doing something useful with the
shared screen will make it appear for the participants the first time
itself.
I'll also check package versions of the entire desktop sharing stack, so to
say.
Thanks for the reply btw, and please send your patch to kwin upstream. It
really is awesome!
Cheers.
…On Fri, 22 July 2022, 7:50 pm Yap Sok Ann, ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
Heh, interesting. I did experience once where initially the receiving side
only got a blank black screen, but once the sending side started to do
something on the shared window (e.g. scrolling), then the receiving side
can see the shared window.
No idea about the glitch you experienced, but good to know that you found
a workaround, as crazy as it is :)
Is Zoom PWA the same thing as Zoom web? With Zoom web, there are indeed
multiple share screen prompts, firstly from the browser, and then from KDE.
Wayland screen sharing with Zoom web has been working for quite some time
already, but my whole chromium browser would freeze for minutes
intermittently when doing that. The Zoom web experience is generally worse
anyway, so 🤷♂️
Currently, I have:
- patched kwin 5.25.3
- xdg-desktop-portal-kde 5.25.3
- xdg-desktop-portal 1.14.5 (just upgraded, 1.14.4 works fine too)
- pipewire 0.3.56 (just upgraded, was using pipewire-0.3.55-r1 with
some cherry-picked fixes from gentoo official repo)
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/f343bff7700d45b555aea7e581097314#gistcomment-4241272>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AO2H6JZIDICA6IP4FS4N2NLVVJVH5ANCNFSM53355SUQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
Forgot to add that yes pwa is the web application, and at least on Chrome
I've found it handy in the absence of proper screen sharing from KDE....
until now that is :)
…On Fri, 22 July 2022, 7:50 pm Yap Sok Ann, ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
Heh, interesting. I did experience once where initially the receiving side
only got a blank black screen, but once the sending side started to do
something on the shared window (e.g. scrolling), then the receiving side
can see the shared window.
No idea about the glitch you experienced, but good to know that you found
a workaround, as crazy as it is :)
Is Zoom PWA the same thing as Zoom web? With Zoom web, there are indeed
multiple share screen prompts, firstly from the browser, and then from KDE.
Wayland screen sharing with Zoom web has been working for quite some time
already, but my whole chromium browser would freeze for minutes
intermittently when doing that. The Zoom web experience is generally worse
anyway, so 🤷♂️
Currently, I have:
- patched kwin 5.25.3
- xdg-desktop-portal-kde 5.25.3
- xdg-desktop-portal 1.14.5 (just upgraded, 1.14.4 works fine too)
- pipewire 0.3.56 (just upgraded, was using pipewire-0.3.55-r1 with
some cherry-picked fixes from gentoo official repo)
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/f343bff7700d45b555aea7e581097314#gistcomment-4241272>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AO2H6JZIDICA6IP4FS4N2NLVVJVH5ANCNFSM53355SUQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
Hey is this patch submitted as PR to kwin?
I think this patch is no longer necessary with Zoom 5.11.9.
That's right! I tested on 5.11.10 (latest update) and it works .... except for the odd case of zoom toolbar showing in the middle of the screen 🙂
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment