Esempio n. 1
0
/* PAL call DkObjectsWaitAny: wait for any of the handles in the handle array.
   The wait can be timed out, unless NO_TIMEOUT is given for the timeout
   argument. */
PAL_HANDLE
DkObjectsWaitAny (PAL_NUM count, PAL_HANDLE * handleArray, PAL_NUM timeout)
{
    store_frame(ObjectsWaitAny);

    if (!count || !handleArray) {
        notify_failure(PAL_ERROR_INVAL);
        return NULL;
    }

    for (int i = 0 ; i < count ; i++)
        if (UNKNOWN_HANDLE(handleArray[i]))
            handleArray[i] = NULL;

    PAL_HANDLE polled = NULL;

    int ret = _DkObjectsWaitAny (count, handleArray,
                                 timeout == NO_TIMEOUT ? -1 : timeout,
                                 &polled);

    if (ret < 0) {
        notify_failure(-ret);
        return NULL;
    }

    return polled;
}
Esempio n. 2
0
void scratcher_apply(VJFrame *src,
		     int width, int height, int opacity, int n,
		     int no_reverse)
{

    unsigned int len = src->len;
    unsigned int op1 = (opacity > 255) ? 255 : opacity;
    int offset = len * nframe;
    int uv_len = src->uv_len;
    int uv_offset = uv_len * nframe;
	VJFrame copy;

    if (nframe== 0) {
		int strides[4] = { len, uv_len, uv_len, 0 };
		vj_frame_copy( src->data, frame, strides );
        return;
    }
	
	VJFrame srcB;
	veejay_memcpy( &srcB, src, sizeof(VJFrame) );
	srcB.data[0] = frame[0] + offset;
	srcB.data[1] = frame[1] + uv_offset;
	srcB.data[2] = frame[2] + uv_offset;
	opacity_applyN( src, &srcB, src->width,src->height, opacity );
	copy.uv_len = src->uv_len;
	copy.data[0] = frame[0];
	copy.data[1] = frame[1];
	copy.data[2] = frame[2];
   	
	store_frame( &copy, width, height, n, no_reverse);

}
Esempio n. 3
0
void scratcher_apply(VJFrame *src,int opacity, int n, int no_reverse)
{
    const int len = src->len;
    const int offset = len * nframe;
    const int uv_len = src->uv_len;
    const int uv_offset = uv_len * nframe;

	VJFrame tmp;
	veejay_memcpy( &tmp, src, sizeof(VJFrame) );
	
	tmp.data[0] = frame[0] + offset;
	tmp.data[1] = frame[1] + uv_offset;
	tmp.data[2] = frame[2] + uv_offset;

	if( no_reverse != last_reverse || n != last_n )
	{
		last_reverse = no_reverse;
		nframe = n;
		last_n = n;
	}		

	if( nframe == 0 ) {
		tmp.data[0] = src->data[0];
		tmp.data[1] = src->data[1];
		tmp.data[2] = src->data[2];
	}

	opacity_applyN( src, &tmp, opacity );
	
	store_frame( src, n, no_reverse);
}
Esempio n. 4
0
/* PAL call DkObjectClose: Close the given object handle. This function is
   different from DkStreamDelete. It works on all kinds of handles, and it
   simply close the reference to the object, the stream is not actually
   deleted. */
void DkObjectClose (PAL_HANDLE objectHandle)
{
    store_frame(ObjectClose);

    int ret = _DkObjectClose(objectHandle);

    if (ret < 0)
        notify_failure(-ret);
}