Esempio n. 1
0
 /**
     @brief    The function synchronizes multiple SPs as well as OS events. Zero SPs or OS events are skipped automatically.
     If the idx argument is NULL, the function waits until all events are signaled.
     If the idx argument is not NULL, the function waits until any of the events is signaled and returns the index of the signalled events.
     @param[in] n                The number of SPs to be synchronized.
     @param[in] sps              The SP array.
     @param[out] idx             The event index, to be returned. 
     @param[in] timeout          The timeout value in ms.
     @return PXCM_STATUS_NO_ERROR        Successful execution.
     @return PXCM_STATUS_EXEC_TIMEOUT    The timeout value is reached.
 */
 public static pxcmStatus SynchronizeEx(PXCMSyncPoint[] sps, out Int32 idx, Int32 timeout)
 {
     IntPtr[] sps2 = new IntPtr[sps.Length];
     for (int i = 0; i < sps.Length; i++)
         sps2[i] = sps[i] != null ? sps[i].instance : IntPtr.Zero;
     return PXCMSyncPoint_SynchronizeExA(sps.Length, sps2, out idx, timeout);
 }
Esempio n. 2
0
    /**
     *  @brief Feed captured samples to module for processing. If the samples are not available
     *  immediately, the function will register to run the module processing when the samples
     *  are ready. This is an asynchronous function. The application must synchronize the
     *  returned SP before retrieving any module data, which is not available during processing.
     *  @param[in]  images	The samples from the capture device.
     *  @param[out] sp		The SP, to be returned.
     *  @return PXCM_STATUS_NO_ERROR	Successful execution.
     */
    public pxcmStatus ProcessImageAsync(PXCMCapture.Sample sample, out PXCMSyncPoint sp)
    {
        IntPtr     sp2;
        pxcmStatus sts = PXCMVideoModule_ProcessImageAsync(instance, sample, out sp2);

        sp = (sts >= pxcmStatus.PXCM_STATUS_NO_ERROR) ? new PXCMSyncPoint(sp2, true) : null;
        return(sts);
    }
Esempio n. 3
0
    /**
     *  @brief	Read the image samples for a specified module.
     *  @param[in]	mid					The module identifier.
     *  @param[out]	sample				The captured sample, to be returned.
     *  @param[out] sp					The SP, to be returned.
     *  @return PXCM_STATUS_NO_ERROR	Successful execution.
     */
    public pxcmStatus ReadModuleStreamsAsync(Int32 mid, PXCMCapture.Sample sample, out PXCMSyncPoint sp)
    {
        IntPtr     sp2;
        pxcmStatus sts = PXCMCaptureManager_ReadModuleStreamsAsync(instance, mid, sample.images, out sp2);

        sp = (sts >= pxcmStatus.PXCM_STATUS_NO_ERROR) ? new PXCMSyncPoint(sp2, true) : null;
        return(sts);
    }
Esempio n. 4
0
 /** 
     @brief Read the all configured streams asynchronously. The function returns immediately. The application must
     synchronize SP to get the stream samples. The configured streams must have the same frame rate or the function 
     will return error.
     @param[in] sample				The output sample.
     @param[in] sp					The pointer to the SP to be returned.
     @return PXCM_STATUS_NO_ERROR			successful execution.
     @return PXCM_STATUS_DEVICE_LOST			the device is disconnected.
     @return PXCM_STATUS_PARAM_UNSUPPORTED	the streams are of different frame rates.
 */
 public pxcmStatus ReadStreamsAsync(Sample sample, out PXCMSyncPoint sp)
 {
     return ReadStreamsAsync(StreamType.STREAM_TYPE_ANY, sample, out sp);
 }
Esempio n. 5
0
 /** 
     @brief Read the selected streams asynchronously. The function returns immediately. The application must
     synchronize SP to get the stream samples. The application can read more than a single stream using the scope
     parameter, provided that all streams have the same frame rate. Otherwise, the function will return error.
     @param[in] scope				The bit-OR'ed value of stream types of interest.
     @param[in] sample				The output sample.
     @param[in] sp					The pointer to the SP to be returned.
     @return PXCM_STATUS_NO_ERROR			successful execution.
     @return PXCM_STATUS_DEVICE_LOST			the device is disconnected.
     @return PXCM_STATUS_PARAM_UNSUPPORTED	the streams are of different frame rates.
 */
 public pxcmStatus ReadStreamsAsync(StreamType scope, Sample sample, out PXCMSyncPoint sp)
 {
     IntPtr sp2;
     pxcmStatus sts = PXCMCapture_Device_ReadStreamsAsync(instance, scope, sample.images, out sp2);
     sp = (sts >= pxcmStatus.PXCM_STATUS_NO_ERROR) ? new PXCMSyncPoint(sp2, true) : null;
     return sts;
 }
Esempio n. 6
0
 public static pxcmStatus SynchronizeEx(PXCMSyncPoint[] sps, out Int32 idx)
 {
     return SynchronizeEx(sps, out idx, TIMEOUT_INFINITE);
 }
Esempio n. 7
0
 public static void ReleaseSP(PXCMSyncPoint[] sps)
 {
     ReleaseSP(sps, 0, sps.Length);
 }
Esempio n. 8
0
 /* A convenient function to release an array of objects */
 public static void ReleaseSP(PXCMSyncPoint[] sps, Int32 startIndex, Int32 nsps)
 {
     for (int i = startIndex; i < startIndex + nsps; i++)
     {
         if (sps[i] == null) continue;
         sps[i].Dispose();
         sps[i] = null;
     }
 }
Esempio n. 9
0
 /**
     @brief    The function synchronizes multiple SPs. Zero SPs are skipped automatically.
     If the idx argument is NULL, the function waits until all events are signaled.
     If the idx argument is not NULL, the function waits until any of the events is signaled and returns the index of the signalled events.
     @param[in] sps              The SP array.
     @return PXCM_STATUS_NO_ERROR        Successful execution.
     @return PXCM_STATUS_EXEC_TIMEOUT    The timeout value is reached.
 */
 public static pxcmStatus SynchronizeEx(PXCMSyncPoint[] sps)
 {
     return SynchronizeEx(sps, TIMEOUT_INFINITE);
 }
Esempio n. 10
0
 /** 
     @brief Feed captured samples to module for processing. If the samples are not available 
     immediately, the function will register to run the module processing when the samples 
     are ready. This is an asynchronous function. The application must synchronize the 
     returned SP before retrieving any module data, which is not available during processing.
     @param[in]  images	The samples from the capture device.
     @param[out] sp		The SP, to be returned.
     @return PXCM_STATUS_NO_ERROR	Successful execution.
 */
 public pxcmStatus ProcessImageAsync(PXCMCapture.Sample sample, out PXCMSyncPoint sp)
 {
     IntPtr sp2;
     pxcmStatus sts = PXCMVideoModule_ProcessImageAsync(instance, sample, out sp2);
     sp = (sts >= pxcmStatus.PXCM_STATUS_NO_ERROR) ? new PXCMSyncPoint(sp2, true) : null;
     return sts;
 }
Esempio n. 11
0
 /**
     @brief	Read the image samples for a specified module.
     @param[in]	mid					The module identifier.
     @param[out]	sample				The captured sample, to be returned.
     @param[out] sp					The SP, to be returned.
     @return PXCM_STATUS_NO_ERROR	Successful execution.
 */
 public pxcmStatus ReadModuleStreamsAsync(Int32 mid, PXCMCapture.Sample sample, out PXCMSyncPoint sp)
 {
     IntPtr sp2;
     pxcmStatus sts = PXCMCaptureManager_ReadModuleStreamsAsync(instance, mid, sample.images, out sp2);
     sp = (sts >= pxcmStatus.PXCM_STATUS_NO_ERROR) ? new PXCMSyncPoint(sp2, true) : null;
     return sts;
 }