Software Archive
Read-only legacy content
Annonces
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

simultaneously and independently access the SDK through two threads (dll + app)

hape
Débutant
381 Visites
I have several questions regarding the following situation:
 
I wanna implement my algorithm which uses at least one module of the realsense SDK and also accesses the
raw image data in a dll such that other applications can start/stop the dll's algorithm and obtain
data/information from the algorithm through callbacks. Since I wanna keep the burden for the application
and application writer using my dll as low as possible, I do not want to expose any SDK related headers,
data structures or functions. In other words I regard the SDK as an implementation detail and want to
hide it from the application. Threfore, my dll shall only expose one start(...) and one stop() functions
which start and stop a thread where my algorithm runs in.
 
Nevertheless, I still wanna give the application the freedom to itself use the SDK in every kind of
possible way like using modules and accessing the RAW image data of the same F200 camera. I noticed that
different programs can (with some restrictions) independently use the SDK to access a camera.
 
In my algorithm I currently use the sensemanager Init() - Release() and AcquireFrame() - ReleaseFrame()
method. Unfortunately I ran into problems in the case that an application uses the dll and also acceses
the SDK itself, both during start and stop of processing.
 
Naively also releasing the ressources leads to problems. But it turned out, that in the case
the application's SDK thread does not actually release the SenseManager pointer after before the processing
thread ends, the program also crashes from time to time.
 
My questions therefore are:
 
1) Which method in the dll and in an application shall be used in order to access the modules and image data from
both threads (dll+app processing) such that they can independently decide when to start and stop to process data
from the SDK? Without additionally synchronisation. Currently I use on the application's side a similar way like in the
FaceTrackingProcessor::Process() function of the FaceTracking sample.
 
2) In the API documentation there are some brief information about accessing the modules data without streaming through
the SenseManager by using PXCSession::CreateImpl(...) instead. Unfortunately, I did not find any more details about the
(dis)advantages of using this method compared the SenseManager one. I would be happy about any hint and information regarding
this method.
 
3) Could the Handler/Callback method or the StreamFrames method an alternative in order to solve my problem?
 
4) In the case I want to ship/deliver/share my dll/app to/with others, are there any conditions regarding how I link
to the SDK's header and dll's?
 
Thank you for sharing your thoughts!
0 Compliments
1 Répondre
hape
Débutant
381 Visites

please help, even you only now the answer or have a hint for one question, thank you and happy new year :)

0 Compliments
Répondre