Post

Replies

Boosts

Views

Activity

display capture issue
I have an app which captures a display (CGDisplayCapture or CGDisplayCaptureWithOptions), grabs its drawing context, and then draw image on it: //1. capture auto cpErr = CGDisplayCaptureWithOptions( mDid, kCGCaptureNoOptions );   if ( cpErr != kCGErrorSuccess )   {     LOGEX( "😂 Failed to capture Display, ID:%d", mDId );     return;   } // Grab context context = CGDisplayGetDrawingContext( mDId ); //Draw image CGContextDrawImage( context, rect, image ); CGContextFlush( context ); The video is pretty good, but two issues: When captured, according to the document, it only capture the event on that display, actually, when the app running, all system key event (i.g. Shift+Cmd+R) and swipe won't work. CGContextDrawImage is taking pretty high CPU usage, in my Mac mini 2018, it is taking over 20% Anyone got the solution to the above issues? -Thanks :)
0
0
943
Aug ’22
Privacy for XPC module
I have an application which is doing screen recording, now I move the screen recording feature to a standalone native XPC module for better performance due to some reason that the app is tied an old lib which cannot generate native code for M1 (Intel only). My question is that, this new xpc module is belong to the App (demanded by the app), if I give the screen recording permission to the app, will the xpc screen scraping module be granted to the permission? Right now looks like it is not after I granted the application with the screen recording permission since display stream won't produce the frame data.
11
0
3.2k
Jun ’22
network.framework handshaking failure occasionally
I have an application, it was using OpenSSL + Socket, recently I migrated the client to use Network.framework, basically it is running well, but occasionally it encounter the handshaking problem: default 11:54:01.757515-0600 caphost boringssl_context_info_handler(2028) [C80:1][0x7f8e2413ad90] Client handshake started default 11:54:01.757546-0600 caphost boringssl_context_info_handler(2045) [C80:1][0x7f8e2413ad90] Client handshake state: TLS client enter_early_data default 11:54:01.757643-0600 caphost boringssl_context_info_handler(2045) [C80:1][0x7f8e2413ad90] Client handshake state: TLS client read_server_hello default 11:54:01.786245-0600 caphost boringssl_context_info_handler(2045) [C80:1][0x7f8e2413ad90] Client handshake state: TLS client read_server_certificate default 11:54:01.786361-0600 caphost boringssl_context_info_handler(2045) [C80:1][0x7f8e2413ad90] Client handshake state: TLS client read_certificate_status default 11:54:01.786386-0600 caphost boringssl_context_info_handler(2045) [C80:1][0x7f8e2413ad90] Client handshake state: TLS client verify_server_certificate default 11:54:01.786588-0600 caphost boringssl_context_evaluate_trust_async(1635) [C80:1][0x7f8e2413ad90] Performing local trust evaluation default 11:54:01.786619-0600 caphost boringssl_context_evaluate_trust_async_internal(1508) [C80:1][0x7f8e2413ad90] Asyncing for internal verify block default 11:54:01.788428-0600 caphost Trust evaluate failure: [leaf AnchorTrusted SSLHostname] default 11:54:01.788604-0600 caphost boringssl_context_evaluate_trust_async_internal_block_invoke_2(1481) [C80:1][0x7f8e2413ad90] Returning from internal verify block with result: false (Error Domain=NSOSStatusErrorDomain Code=-67843 "“Vodde” certificate is not trusted" UserInfo={NSLocalizedDescription=“Solstice” certificate is not trusted, NSUnderlyingError=0x600001ffbc00 {Error Domain=NSOSStatusErrorDomain Code=-67843 "Certificate 0 “Vodde” has errors: SSL hostname does not match name(s) in certificate, Root is not trusted;" UserInfo={NSLocalizedDescription=Certificate 0 “Vodde” has errors: SSL hostname does not match name(s) in certificate, Root is not trusted;}}}) when this problem happens, I use old OpenSSL+Socket client to connect to it, it will be successful and grab the video stream w/o problem. This problem happens about 1 in 10, I supposed if this happen, it shall always happen, don't get why it is not consistent, is it the bug of Network.framework? my system is Monterey 12.3.1 on 2018 Mac mini. Thanks :)
4
0
891
Apr ’22
xpc module won't get loaded
I have a xpc module (wrote in Swift using NSXPCConnection), it works well with test application (simple swift test app), my plan is to put this module under XPCService of a DAL plugIn, since the plugin written in C++, I created an Objective-C dylib which response for talking to the XPC, and this dylib using NSXConnection to activate the XPC module(as the Swift test App), it exports C API to the plugin. Somehow when application using the plugin, the plugin call the API of the dylib to activate the XPC, but the XPC won't get loaded (from Activity Monitor). Any idea to get this working? I cannot put XPCService folder inside the Obj-C dylib instead of inside the plugin bundle, and I don't want load the xpc as daemon, want it be loaded as plugin demanded. Adding Obj-C into current C plugin is pretty headache, is there any C++ version NSXPConnection for this kind of situation? =======this is the code in the dylib for activating the connection ====== - (int) initXPC {   connection = [[NSXPCConnection alloc] initWithServiceName:@"com....."];   connection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MyProtocol)];       [connection resume];   self->started = false;   NSLog(@"😂 XPC connection setup, result:%@", ((connection == nil) ? @"Failed":@"Succeed!") );   return connection != nil ; } Thanks Steven
7
0
1.7k
Feb ’22
Anyway to start working while waiting approval from Apple
I'm working on new virtual camera by using IOUSBHostControllerInterface, when I run my code, it asks for the approval of com.apple.usb.hostcontrollerinterface entitlement from Apple, I disabled SIP of the system and it won't let me go further. I submitted the FB9203842 by middle of last month and no response from Apple yet, submitted DTS and that won't speed up the approval process. Is there any way I could continue working on it while waiting for Apple's approval? I believe the entitlement approval is only for distribute the product, not developing the product. Thanks Steven
2
1
1.9k
Feb ’22
network.framework client talk to OpenSSL Java Server
The old client was using OpenSSL and Socket, it works just fine, and the server is using TLS1.2 with public signed certificate, the TLS and TCP configuration of the new network.framework client are as below, The server always complains the handshake failed. I tried default TLS, TLS version min to 1.0 max to 1.3, none of them working.  auto config_tcp = ^(nw_protocol_options_t tcp_op) {     nw_tcp_options_set_connection_timeout(tcp_op, connection_timeout); //set timeout to 5 seconds     nw_tcp_options_set_enable_keepalive(tcp_op, true); //keep_live     nw_tcp_options_set_no_delay(tcp_op, true); //enable no delay     nw_tcp_options_set_enable_fast_open(tcp_op, true);   };       auto config_tls = ^(nw_protocol_options_t tls_options) {     sec_protocol_options_t sec_options = nw_tls_copy_sec_protocol_options(tls_options);     sec_protocol_options_set_min_tls_protocol_version(sec_options, tls_protocol_version_TLSv12);     sec_protocol_options_set_max_tls_protocol_version(sec_options, tls_protocol_version_TLSv12);           sec_protocol_options_append_tls_ciphersuite_group(sec_options,tls_ciphersuite_group_default);     nw_release(sec_options);   };       auto endpoint = nw_endpoint_create_host(sip.c_str(), std::to_string( srvPort).c_str());       auto param = nw_parameters_create_secure_tcp(config_tls, //TLSv1.2 for now                          config_tcp);           // create the connection   auto connect = nw_connection_create(endpoint, param);
2
0
916
Dec ’21
Could I bind smartpointer to xpc connection?
I want to bind a smartpointer to xpc connection, will below work? I have class A like this: class A { }; Initialization with xpc_connection currentConnection auto aObj = std::make_shared<A>(); xpc_connection_set_context(currentConnection, aObj.get()) After I done with the connection, I get back the raw pointer: auto pObj = reinterpret_cast<A*>(xpc_connection_get_context(currentConnection)); if (pObj != nullptr) { std::shared_ptr<A> asmarter(pObj);      asmarter.reset(); //release the smart pointer } Will this work?
10
0
1.7k
Nov ’21
Audio server plugin cannot receive mute event
We have a Audio Server Plugin which is pretty similar to NullAudio plugin and Blackhole audio plugin, it works pretty well except one problem, when user click the mic button on Zoom or MS Teams to mute and unmute the microphone, only unmute can receive event of: SetControlPropertyData 0x6:kObjectID_Mute_Input_Master select=0x6263766c(Boolean) value=0 I supposed it would receive the same event but with the value to 1 when we click mute, but according the message dump (I dumped set/get/has/isSetable), totally no event received! Anyone met the same issue and have solution? Thanks
0
0
812
Jul ’21
ScreenCaptureKit sample malfunction with Safari
We can use the sample code to generate the SCK capture tool, Run safari with youtube video. Run the SCK capture tool Select Application capture with the above Safari youtube video, the video shall be playing well. Toggle the youtube video to full screen, you will not able to see the YouTube video.
Replies
0
Boosts
0
Views
1.4k
Activity
Sep ’22
display capture issue
I have an app which captures a display (CGDisplayCapture or CGDisplayCaptureWithOptions), grabs its drawing context, and then draw image on it: //1. capture auto cpErr = CGDisplayCaptureWithOptions( mDid, kCGCaptureNoOptions );   if ( cpErr != kCGErrorSuccess )   {     LOGEX( "😂 Failed to capture Display, ID:%d", mDId );     return;   } // Grab context context = CGDisplayGetDrawingContext( mDId ); //Draw image CGContextDrawImage( context, rect, image ); CGContextFlush( context ); The video is pretty good, but two issues: When captured, according to the document, it only capture the event on that display, actually, when the app running, all system key event (i.g. Shift+Cmd+R) and swipe won't work. CGContextDrawImage is taking pretty high CPU usage, in my Mac mini 2018, it is taking over 20% Anyone got the solution to the above issues? -Thanks :)
Replies
0
Boosts
0
Views
943
Activity
Aug ’22
Quartz Display service to hide/unhide, disable or deactive one display
I want to hide specific display with displayId for my special purpose, anyway, didn't find any related API like CGDisplayHide(displayId), anyone has a way for that? I'm thinking of mirroring the other display but it is not ideal. Thanks Stang
Replies
0
Boosts
0
Views
749
Activity
Jul ’22
Privacy for XPC module
I have an application which is doing screen recording, now I move the screen recording feature to a standalone native XPC module for better performance due to some reason that the app is tied an old lib which cannot generate native code for M1 (Intel only). My question is that, this new xpc module is belong to the App (demanded by the app), if I give the screen recording permission to the app, will the xpc screen scraping module be granted to the permission? Right now looks like it is not after I granted the application with the screen recording permission since display stream won't produce the frame data.
Replies
11
Boosts
0
Views
3.2k
Activity
Jun ’22
network.framework handshaking failure occasionally
I have an application, it was using OpenSSL + Socket, recently I migrated the client to use Network.framework, basically it is running well, but occasionally it encounter the handshaking problem: default 11:54:01.757515-0600 caphost boringssl_context_info_handler(2028) [C80:1][0x7f8e2413ad90] Client handshake started default 11:54:01.757546-0600 caphost boringssl_context_info_handler(2045) [C80:1][0x7f8e2413ad90] Client handshake state: TLS client enter_early_data default 11:54:01.757643-0600 caphost boringssl_context_info_handler(2045) [C80:1][0x7f8e2413ad90] Client handshake state: TLS client read_server_hello default 11:54:01.786245-0600 caphost boringssl_context_info_handler(2045) [C80:1][0x7f8e2413ad90] Client handshake state: TLS client read_server_certificate default 11:54:01.786361-0600 caphost boringssl_context_info_handler(2045) [C80:1][0x7f8e2413ad90] Client handshake state: TLS client read_certificate_status default 11:54:01.786386-0600 caphost boringssl_context_info_handler(2045) [C80:1][0x7f8e2413ad90] Client handshake state: TLS client verify_server_certificate default 11:54:01.786588-0600 caphost boringssl_context_evaluate_trust_async(1635) [C80:1][0x7f8e2413ad90] Performing local trust evaluation default 11:54:01.786619-0600 caphost boringssl_context_evaluate_trust_async_internal(1508) [C80:1][0x7f8e2413ad90] Asyncing for internal verify block default 11:54:01.788428-0600 caphost Trust evaluate failure: [leaf AnchorTrusted SSLHostname] default 11:54:01.788604-0600 caphost boringssl_context_evaluate_trust_async_internal_block_invoke_2(1481) [C80:1][0x7f8e2413ad90] Returning from internal verify block with result: false (Error Domain=NSOSStatusErrorDomain Code=-67843 "“Vodde” certificate is not trusted" UserInfo={NSLocalizedDescription=“Solstice” certificate is not trusted, NSUnderlyingError=0x600001ffbc00 {Error Domain=NSOSStatusErrorDomain Code=-67843 "Certificate 0 “Vodde” has errors: SSL hostname does not match name(s) in certificate, Root is not trusted;" UserInfo={NSLocalizedDescription=Certificate 0 “Vodde” has errors: SSL hostname does not match name(s) in certificate, Root is not trusted;}}}) when this problem happens, I use old OpenSSL+Socket client to connect to it, it will be successful and grab the video stream w/o problem. This problem happens about 1 in 10, I supposed if this happen, it shall always happen, don't get why it is not consistent, is it the bug of Network.framework? my system is Monterey 12.3.1 on 2018 Mac mini. Thanks :)
Replies
4
Boosts
0
Views
891
Activity
Apr ’22
Embedded WindowController inside XPC module
Is it possible we embed a windowcontroller inside an XPC module and pop/hide the window as demanded? right now the window cannot pop due to not in main thread. What is the better alternative under the condition that xpc cannot modify the caller for permission.
Replies
3
Boosts
0
Views
1.6k
Activity
Mar ’22
xpc module won't get loaded
I have a xpc module (wrote in Swift using NSXPCConnection), it works well with test application (simple swift test app), my plan is to put this module under XPCService of a DAL plugIn, since the plugin written in C++, I created an Objective-C dylib which response for talking to the XPC, and this dylib using NSXConnection to activate the XPC module(as the Swift test App), it exports C API to the plugin. Somehow when application using the plugin, the plugin call the API of the dylib to activate the XPC, but the XPC won't get loaded (from Activity Monitor). Any idea to get this working? I cannot put XPCService folder inside the Obj-C dylib instead of inside the plugin bundle, and I don't want load the xpc as daemon, want it be loaded as plugin demanded. Adding Obj-C into current C plugin is pretty headache, is there any C++ version NSXPConnection for this kind of situation? =======this is the code in the dylib for activating the connection ====== - (int) initXPC {   connection = [[NSXPCConnection alloc] initWithServiceName:@"com....."];   connection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MyProtocol)];       [connection resume];   self->started = false;   NSLog(@"😂 XPC connection setup, result:%@", ((connection == nil) ? @"Failed":@"Succeed!") );   return connection != nil ; } Thanks Steven
Replies
7
Boosts
0
Views
1.7k
Activity
Feb ’22
Anyway to start working while waiting approval from Apple
I'm working on new virtual camera by using IOUSBHostControllerInterface, when I run my code, it asks for the approval of com.apple.usb.hostcontrollerinterface entitlement from Apple, I disabled SIP of the system and it won't let me go further. I submitted the FB9203842 by middle of last month and no response from Apple yet, submitted DTS and that won't speed up the approval process. Is there any way I could continue working on it while waiting for Apple's approval? I believe the entitlement approval is only for distribute the product, not developing the product. Thanks Steven
Replies
2
Boosts
1
Views
1.9k
Activity
Feb ’22
network.framework client talk to OpenSSL Java Server
The old client was using OpenSSL and Socket, it works just fine, and the server is using TLS1.2 with public signed certificate, the TLS and TCP configuration of the new network.framework client are as below, The server always complains the handshake failed. I tried default TLS, TLS version min to 1.0 max to 1.3, none of them working.  auto config_tcp = ^(nw_protocol_options_t tcp_op) {     nw_tcp_options_set_connection_timeout(tcp_op, connection_timeout); //set timeout to 5 seconds     nw_tcp_options_set_enable_keepalive(tcp_op, true); //keep_live     nw_tcp_options_set_no_delay(tcp_op, true); //enable no delay     nw_tcp_options_set_enable_fast_open(tcp_op, true);   };       auto config_tls = ^(nw_protocol_options_t tls_options) {     sec_protocol_options_t sec_options = nw_tls_copy_sec_protocol_options(tls_options);     sec_protocol_options_set_min_tls_protocol_version(sec_options, tls_protocol_version_TLSv12);     sec_protocol_options_set_max_tls_protocol_version(sec_options, tls_protocol_version_TLSv12);           sec_protocol_options_append_tls_ciphersuite_group(sec_options,tls_ciphersuite_group_default);     nw_release(sec_options);   };       auto endpoint = nw_endpoint_create_host(sip.c_str(), std::to_string( srvPort).c_str());       auto param = nw_parameters_create_secure_tcp(config_tls, //TLSv1.2 for now                          config_tcp);           // create the connection   auto connect = nw_connection_create(endpoint, param);
Replies
2
Boosts
0
Views
916
Activity
Dec ’21
Could I bind smartpointer to xpc connection?
I want to bind a smartpointer to xpc connection, will below work? I have class A like this: class A { }; Initialization with xpc_connection currentConnection auto aObj = std::make_shared<A>(); xpc_connection_set_context(currentConnection, aObj.get()) After I done with the connection, I get back the raw pointer: auto pObj = reinterpret_cast<A*>(xpc_connection_get_context(currentConnection)); if (pObj != nullptr) { std::shared_ptr<A> asmarter(pObj);      asmarter.reset(); //release the smart pointer } Will this work?
Replies
10
Boosts
0
Views
1.7k
Activity
Nov ’21
iOS client access airplay device
Does the client app developer need any special entitlement for that ?
Replies
1
Boosts
0
Views
890
Activity
Oct ’21
Audio server plugin cannot receive mute event
We have a Audio Server Plugin which is pretty similar to NullAudio plugin and Blackhole audio plugin, it works pretty well except one problem, when user click the mic button on Zoom or MS Teams to mute and unmute the microphone, only unmute can receive event of: SetControlPropertyData 0x6:kObjectID_Mute_Input_Master select=0x6263766c(Boolean) value=0 I supposed it would receive the same event but with the value to 1 when we click mute, but according the message dump (I dumped set/get/has/isSetable), totally no event received! Anyone met the same issue and have solution? Thanks
Replies
0
Boosts
0
Views
812
Activity
Jul ’21