-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call Emit inside a c++ Lambda fucnction #887
Comments
Hi @shadow111 If the lambda passed to framePool.FrameArrived is run on a different thread you cannot directly call javascript functions in it. I recommend to take a look at the ThreadSafeFunction API which should suit your use case. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I’ve hidden the off-topic comments here as off-topic, if you have another problem please open another issue (in e.g. https://github.com/nodejs/help/issues/). Also, pinging a bunch of people for no good reason is not cool and is not going to get your problem solved any faster. |
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made. |
Hello This actually not an issue but i'm seeking some recommendation
I'm working on a N-API addon to capture video frame using windows graphic capture API , extract frame bytes and send it back to JavaScript. I have tried the event emitter but I can't get the data.
Here is my C++ code:
here my JavaScript code calling the start capture function
Normally my output should be an infinite loop of data messages until I stop it
###
Start Recording …
data
data
. . .
data
But i just get
Start Recording …
After looking to the lambda function framePool.FrameArrived it seems that it's running on a different thread than the startCapture function if I understand the lambda function concept correctly, I just wanna to found a way on how I can stream those messages to JavaScript using event Emitter or any other recommendation is well welcoming.
The text was updated successfully, but these errors were encountered: