On Sat, Mar 15, 2025 at 8:11 PM Phyllis Smith <[email protected]> wrote:
>
> Andrew, am trying to test this but I forgot how to do it so reading the 
> manual and still having trouble.  Will update you when I figure how to run it.


I think slightly better patch follow (apply on top of this one), it
does not disable shm screen capture for platform, but at runtime (with
fallback) if shmGetImage fails



>
> On Fri, Mar 14, 2025 at 4:01 AM Andrew Randrianasulu via Cin 
> <[email protected]> wrote:
>>
>> Tried to record desktop, found out screencapture does not work :(
>>
>> It seems even ffmpeg fall back to non-shm capture (slower) under
>> NetBSD, so I tried to
>> to change logic in guicast/bccapture.C so if compiled on netBSD it
>> hard disable shm for capture (playback is fine)
>>
>> Please try on Linux and other systems ... Pay attention to
>> screencapture slowdowns!
>> --
>> Cin mailing list
>> [email protected]
>> https://lists.cinelerra-gg.org/mailman/listinfo/cin
From 8ac357d20b030c11bcf5872b25bd963abdfb509b Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Mon, 17 Mar 2025 07:29:53 +0300
Subject: [PATCH 4/4] Do not disable shm on NetBSD, just set use_shm as result
 of XShmGetImage call (it is boolean)

src:
https://github.com/cubanismo/libXext/blob/master/src/XShm.c
---
 cinelerra-5.1/guicast/bccapture.C | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cinelerra-5.1/guicast/bccapture.C b/cinelerra-5.1/guicast/bccapture.C
index 317f96ae..9ba27edb 100644
--- a/cinelerra-5.1/guicast/bccapture.C
+++ b/cinelerra-5.1/guicast/bccapture.C
@@ -86,9 +86,9 @@ int BC_Capture::init_window(const char *display_path)
 
 // test shared memory
 // This doesn't ensure the X Server is on the local host
-#ifndef __NetBSD__
+
 	if( use_shm && !XShmQueryExtension(display) )
-#endif
+
 		use_shm = 0;
 	return 0;
 }
@@ -169,7 +169,7 @@ int BC_Capture::allocate_data()
 
 // Crashes here if remote server.
 		BC_Resources::error = 0;
-		XShmAttach(display, &shm_info);
+		use_shm = XShmAttach(display, &shm_info);
 		XSync(display, False);
 		if( BC_Resources::error ) {
 			XDestroyImage(ximage);
@@ -238,7 +238,7 @@ int BC_Capture::capture_frame(VFrame *frame, int &x1, int &y1,
 
 // Read the raw data
 	if( use_shm )
-		XShmGetImage(display, rootwin, ximage, x1, y1, 0xffffffff);
+		use_shm = XShmGetImage(display, rootwin, ximage, x1, y1, 0xffffffff);
 	else
 		XGetSubImage(display, rootwin, x1, y1, w, h, 0xffffffff, ZPixmap, ximage, 0, 0);
 
-- 
2.47.1

-- 
Cin mailing list
[email protected]
https://lists.cinelerra-gg.org/mailman/listinfo/cin

Reply via email to