Example #1
0
/***********************************************************
 * Name: dispmanx_notify_handle
 *
 * Arguments: not used
 *
 * Description: this purely notifies the update callback
 *
 * Returns: does not return
 *
 ***********************************************************/
static void *dispmanx_notify_func( void *arg ) {
    int32_t success;
    VCOS_STATUS_T status;

    (void)arg;

    while (1) {
        DISPMANX_UPDATE_HANDLE_T handle;
        status = vcos_event_wait(&dispmanx_notify_available_event);
        if (status != VCOS_SUCCESS || !dispmanx_client.initialised)
            break;
        success = vchi_msg_dequeue( dispmanx_client.notify_handle[0], dispmanx_client.notify_buffer, sizeof(dispmanx_client.notify_buffer), &dispmanx_client.notify_length, VCHI_FLAGS_NONE );
        if (success != 0)
            continue;

        handle = (DISPMANX_UPDATE_HANDLE_T)dispmanx_client.notify_buffer[0];
        if (handle) {
            // This is the response to an update submit
            // Decrement the use count - the corresponding "use" is in vc_dispmanx_update_submit.
            vchi_service_release(dispmanx_client.notify_handle[0]);
            if (dispmanx_client.update_callback ) {
                vcos_assert( dispmanx_client.pending_update_handle == handle);
                dispmanx_client.update_callback(handle, dispmanx_client.update_callback_param);
            }
        } else {
            // This is a vsync notification
            if (dispmanx_client.vsync_callback ) {
                dispmanx_client.vsync_callback(handle, dispmanx_client.vsync_callback_param);
            }
        }
    }
    return 0;
}
Example #2
0
/***********************************************************
 * Name: dispmanx_notify_handle
 *
 * Arguments: not used
 *
 * Description: this purely notifies the update callback
 *
 * Returns: does not return
 *
 ***********************************************************/
static void *dispmanx_notify_func( void *arg ) {
   int32_t success;
   VCOS_STATUS_T status;

   (void)arg;

   while(1) {
      status = vcos_event_wait(&dispmanx_notify_available_event);
      if(status != VCOS_SUCCESS || !dispmanx_client.initialised)
         break;
      success = vchi_msg_dequeue( dispmanx_client.notify_handle[0], dispmanx_client.notify_buffer, sizeof(dispmanx_client.notify_buffer), &dispmanx_client.notify_length, VCHI_FLAGS_NONE );
      vchi_service_release(dispmanx_client.notify_handle[0]); // corresponding use in vc_dispmanx_update_submit
      if(success != 0)
         continue;
   
      if(dispmanx_client.update_callback ) {
         vcos_assert( dispmanx_client.pending_update_handle == (DISPMANX_UPDATE_HANDLE_T) dispmanx_client.notify_buffer[1]);
         dispmanx_client.update_callback((DISPMANX_UPDATE_HANDLE_T) dispmanx_client.notify_buffer[1], dispmanx_client.update_callback_param);
      }
   }
   return 0;
}