Example #1
0
/**
 * In order to use this driver three functions have
 * to be called in the following order:
 * 1. stk1160_init() (might be optional if you use RIOT's auto_init module)
 * 2. stk1160_set_videosource
 * 3. stk1160_start_streaming
 */
int main(void)
{
    printf("\n\t\t\tWelcome to RIOT\n\n");

    buffer = malloc(BUFFER_SIZE); // allocate a buffer video data
    buf_p = buffer;
    frame_counter = 0;
    packet_counter = 0;

    // set video source to composite0
    stk1160_set_videosource(STK1160_VIDEO_SOURCE_COMPOSITE0);

    // stk1160_start_streaming calls a provided handler
    // every time video data arrives from the grabber.
    int ret;
    ret = stk1160_start_streaming(our_handler);
    printf("ret = %d\n", ret);

    return 0;
}
Example #2
0
static int start_streaming(struct vb2_queue *vq, unsigned int count)
{
	struct stk1160 *dev = vb2_get_drv_priv(vq);
	return stk1160_start_streaming(dev);
}