本文整理汇总了C++中VC_HTOV32函数的典型用法代码示例。如果您正苦于以下问题:C++ VC_HTOV32函数的具体用法?C++ VC_HTOV32怎么用?C++ VC_HTOV32使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了VC_HTOV32函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vc_dispmanx_resource_write_data_handle
VCHPRE_ int VCHPOST_ vc_dispmanx_resource_write_data_handle( DISPMANX_RESOURCE_HANDLE_T handle, VC_IMAGE_TYPE_T src_type /* not used */,
int src_pitch, VCHI_MEM_HANDLE_T mem_handle, uint32_t offset,
const VC_RECT_T * rect ) {
int32_t bulk_len;
uint32_t param[3];
uint32_t success = 0;
//Note that x coordinate of the rect is NOT used
//Address of data in host
offset += src_pitch * rect->y;
bulk_len = src_pitch * rect->height;
//Now send the bulk transfer across
//command parameters: resource handle, destination y, bulk length
param[0] = VC_HTOV32(handle);
param[1] = VC_HTOV32(rect->y);
param[2] = VC_HTOV32(bulk_len);
success = dispmanx_send_command( EDispmanBulkWrite | DISPMANX_NO_REPLY_MASK, param, sizeof(param));
if(success == 0)
{
lock_obtain();
success = vchi_bulk_queue_transmit_reloc( dispmanx_client.client_handle[0],
mem_handle, offset,
bulk_len,
VCHI_FLAGS_BLOCK_UNTIL_DATA_READ,
NULL );
lock_release();
}
return (int) success;
}
示例2: vc_dispmanx_resource_write_data
/***********************************************************
* Name: vc_dispmanx_resource_write_data
*
* Arguments:
* DISPMANX_RESOURCE_HANDLE_T res
* int src_pitch
* void * src_address
* const VC_RECT_T * rect
*
* Description: Copy the bitmap data to VideoCore memory
*
* Returns: 0 or failure
*
***********************************************************/
VCHPRE_ int VCHPOST_ vc_dispmanx_resource_write_data( DISPMANX_RESOURCE_HANDLE_T handle, VC_IMAGE_TYPE_T src_type /* not used */,
int src_pitch, void * src_address, const VC_RECT_T * rect ) {
(void)src_type;
//Note that x coordinate of the rect is NOT used
//Address of data in host
uint8_t *host_start = (uint8_t *)src_address + src_pitch * rect->y;
int32_t bulk_len = src_pitch * rect->height, success = 0;
//Now send the bulk transfer across
//command parameters: resource handle, destination y, bulk length
uint32_t param[] = {VC_HTOV32(handle), VC_HTOV32(rect->y), VC_HTOV32(bulk_len)};
success = dispmanx_send_command( EDispmanBulkWrite | DISPMANX_NO_REPLY_MASK, param, sizeof(param));
if(success == 0)
{
lock_obtain();
success = vchi_bulk_queue_transmit( dispmanx_client.client_handle[0],
host_start,
bulk_len,
VCHI_FLAGS_BLOCK_UNTIL_DATA_READ,
NULL );
lock_release();
}
return (int) success;
}
示例3: vc_dispmanx_resource_read_data
/***********************************************************
* Name: vc_dispmanx_resource_read_data
*
* Arguments:
* DISPMANX_RESOURCE_HANDLE_T res
* int src_pitch
* void * src_address
* const VC_RECT_T * rect
*
* Description: Copy the bitmap data to VideoCore memory
*
* Returns: 0 or failure
*
***********************************************************/
VCHPRE_ int VCHPOST_
vc_dispmanx_resource_read_data(
DISPMANX_RESOURCE_HANDLE_T handle,
const VC_RECT_T* p_rect,
void * dst_address,
uint32_t dst_pitch )
{
uint8_t* host_start;
int32_t bulk_len;
int32_t success = 0;
if ( p_rect == 0 || dst_address == 0 || dst_pitch == 0 )
{
return -1;
}
host_start = (uint8_t *)dst_address + (dst_pitch * p_rect->y);
bulk_len = (int32_t)dst_pitch * (p_rect->height-p_rect->y);
// Now send the bulk transfer across
// command parameters: resource handle, destination y, bulk length
uint32_t param[] = { VC_HTOV32(handle), VC_HTOV32(p_rect->y), VC_HTOV32(bulk_len) };
success = dispmanx_send_command( EDispmanBulkRead | DISPMANX_NO_REPLY_MASK, param, sizeof(param));
if (success == 0)
{
lock_obtain();
success = vchi_bulk_queue_receive( dispmanx_client.client_handle[0],
host_start,
bulk_len,
VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE,
0 );
lock_release();
}
return (int) success;
}
示例4: vc_dispmanx_display_set_background
/***********************************************************
* Name: vc_dispmanx_display_set_background
*
* Arguments:
* DISPMANX_UPDATE_HANDLE_T update
* DISPMANX_DISPLAY_HANDLE_T display
* uint8_t red
* uint8_t green
* uint8_t blue
*
* Description:
*
* Returns:
*
***********************************************************/
VCHPRE_ int VCHPOST_ vc_dispmanx_display_set_background( DISPMANX_UPDATE_HANDLE_T update, DISPMANX_DISPLAY_HANDLE_T display,
uint8_t red, uint8_t green, uint8_t blue ) {
uint32_t display_param[] = {(uint32_t)VC_HTOV32(update), (uint32_t) VC_HTOV32(display), VC_HTOV32(red), VC_HTOV32(green), VC_HTOV32(blue)};
int success = (int) dispmanx_send_command( EDispmanDisplaySetBackground | DISPMANX_NO_REPLY_MASK,
display_param, sizeof(display_param));
return success;
}
示例5: vc_dispmanx_display_open_offscreen
/***********************************************************
* Name: vc_dispmanx_display_open_offscreen
*
* Arguments:
* DISPMANX_RESOURCE_HANDLE_T dest
* VC_IMAGE_TRANSFORM_T orientation
*
* Description:
*
* Returns:
*
***********************************************************/
VCHPRE_ DISPMANX_DISPLAY_HANDLE_T VCHPOST_ vc_dispmanx_display_open_offscreen( DISPMANX_RESOURCE_HANDLE_T dest, VC_IMAGE_TRANSFORM_T orientation ) {
uint32_t display_open_param[] = {(uint32_t)VC_HTOV32(dest), (uint32_t)VC_HTOV32(orientation)};
uint32_t display_handle = dispmanx_get_handle(EDispmanDisplayOpenOffscreen,
&display_open_param, sizeof(display_open_param));
return (DISPMANX_DISPLAY_HANDLE_T) display_handle;
}
示例6: vc_dispmanx_display_open_mode
/***********************************************************
* Name: vc_dispmanx_display_open_mode
*
* Arguments:
* uint32_t device
* uint32_t mode
*
* Description:
*
* Returns:
*
***********************************************************/
VCHPRE_ DISPMANX_DISPLAY_HANDLE_T VCHPOST_ vc_dispmanx_display_open_mode( uint32_t device, uint32_t mode ) {
uint32_t display_open_param[] = {VC_HTOV32(device), VC_HTOV32(mode)};
uint32_t display_handle = dispmanx_get_handle(EDispmanDisplayOpenMode,
&display_open_param, sizeof(display_open_param));
return (DISPMANX_DISPLAY_HANDLE_T) display_handle;
}
示例7: vc_dispmanx_vsync_callback
/***********************************************************
* Name: vc_dispmanx_vsync_callback
*
* Arguments:
* DISPMANX_DISPLAY_HANDLE_T display
* DISPMANX_CALLBACK_FUNC_T cb_func
* void *cb_arg
*
* Description: start sending callbacks on vsync events
* Use a NULL cb_func to stop the callbacks
* Returns: 0 or failure
*
***********************************************************/
VCHPRE_ int VCHPOST_ vc_dispmanx_vsync_callback( DISPMANX_DISPLAY_HANDLE_T display, DISPMANX_CALLBACK_FUNC_T cb_func, void *cb_arg )
{
// Steal the invalid 0 handle to indicate this is a vsync request
DISPMANX_UPDATE_HANDLE_T update = 0;
int enable = (cb_func != NULL);
uint32_t update_param[] = {(uint32_t) VC_HTOV32(display), VC_HTOV32(update), (int32_t)enable};
int success;
// Set the callback
dispmanx_client.vsync_callback = cb_func;
dispmanx_client.vsync_callback_param = cb_arg;
if (!dispmanx_client.vsync_enabled && enable) {
// An extra "use" is required while a vsync callback is registered.
// The corresponding "release" is below.
vchi_service_use(dispmanx_client.notify_handle[0]);
}
success = (int) dispmanx_send_command( EDispmanVsyncCallback | DISPMANX_NO_REPLY_MASK,
update_param, sizeof(update_param));
if (dispmanx_client.vsync_enabled && !enable) {
// The extra "use" added above is no longer required.
vchi_service_release(dispmanx_client.notify_handle[0]);
}
dispmanx_client.vsync_enabled = enable;
return (int) success;
}
示例8: vc_dispmanx_element_change_source
/***********************************************************
* Name: vc_dispmanx_element_change_source
*
* Arguments:
* DISPMANX_UPDATE_HANDLE_T update
* DISPMANX_ELEMENT_HANDLE_T element
* DISPMANX_RESOURCE_HANDLE_T src
*
* Description:
*
* Returns: VCHI error code
*
***********************************************************/
VCHPRE_ int VCHPOST_ vc_dispmanx_element_change_source( DISPMANX_UPDATE_HANDLE_T update, DISPMANX_ELEMENT_HANDLE_T element,
DISPMANX_RESOURCE_HANDLE_T src ) {
uint32_t element_param[] = { (uint32_t) VC_HTOV32(update),
(uint32_t) VC_HTOV32(element),
(uint32_t) VC_HTOV32(src) };
int success = (int) dispmanx_send_command( EDispmanElementChangeSource | DISPMANX_NO_REPLY_MASK,
element_param, sizeof(element_param));
return success;
}
示例9: vc_dispmanx_update_submit
/***********************************************************
* Name: vc_dispmanx_update_submit
*
* Arguments:
* DISPMANX_UPDATE_HANDLE_T update
* DISPMANX_CALLBACK_FUNC_T cb_func
* void *cb_arg
*
* Description:
*
* Returns:
*
***********************************************************/
VCHPRE_ int VCHPOST_ vc_dispmanx_update_submit( DISPMANX_UPDATE_HANDLE_T update, DISPMANX_CALLBACK_FUNC_T cb_func, void *cb_arg ) {
uint32_t update_param[] = {(uint32_t) VC_HTOV32(update), (uint32_t) ((cb_func)? VC_HTOV32(1) : 0)};
int success;
//Set the callback
dispmanx_client.update_callback = cb_func;
dispmanx_client.update_callback_param = cb_arg;
dispmanx_client.pending_update_handle = update;
vchi_service_use(dispmanx_client.notify_handle[0]); // corresponding release is in dispmanx_notify_func
success = (int) dispmanx_send_command( EDispmanUpdateSubmit | DISPMANX_NO_REPLY_MASK,
update_param, sizeof(update_param));
return success;
}
示例10: vc_dispmanx_resource_create
/***********************************************************
* Name: vc_dispmanx_resource_create
*
* Arguments:
* VC_IMAGE_TYPE_T type
* uint32_t width
* uint32_t height
*
* Description: Create a new resource (in Videocore memory)
*
* Returns: resource handle
*
***********************************************************/
VCHPRE_ DISPMANX_RESOURCE_HANDLE_T VCHPOST_ vc_dispmanx_resource_create( VC_IMAGE_TYPE_T type, uint32_t width, uint32_t height, uint32_t *native_image_handle ) {
uint32_t resourceCreateParams[] = { (uint32_t)VC_HTOV32(type), VC_HTOV32(width), VC_HTOV32(height) };
uint32_t resource = 0;
resource = dispmanx_get_handle(EDispmanResourceCreate, resourceCreateParams, sizeof(resourceCreateParams));
//We don't get an image handle back, so explicitly set this to zero to let the caller know
*native_image_handle = 0;
//The caller should call vc_dispmanx_resource_get_image_handle below to get the VC_IMAGE_T *
//This will be deprecated soon, however
return (DISPMANX_RESOURCE_HANDLE_T) resource;
}
示例11: vc_dispmanx_snapshot
/***********************************************************
* Name: vc_dispmanx_snapshot
*
* Arguments:
* DISPMANX_DISPLAY_HANDLE_T display
* DISPMANX_RESOURCE_HANDLE_T snapshot_resource
* VC_IMAGE_TRANSFORM_T transform
*
* Description: Take a snapshot of a display in its current state
*
* Returns:
*
***********************************************************/
VCHPRE_ int VCHPOST_ vc_dispmanx_snapshot( DISPMANX_DISPLAY_HANDLE_T display,
DISPMANX_RESOURCE_HANDLE_T snapshot_resource,
VC_IMAGE_TRANSFORM_T transform )
{
uint32_t display_snapshot_param[] = {
VC_HTOV32(display),
VC_HTOV32(snapshot_resource),
VC_HTOV32(transform)};
int success = (int) dispmanx_send_command( EDispmanSnapshot,
display_snapshot_param,
sizeof(display_snapshot_param));
return success;
}
示例12: vc_dispmanx_update_submit_sync
/***********************************************************
* Name: vc_dispmanx_update_submit_sync
*
* Arguments:
* DISPMANX_UPDATE_HANDLE_T update
*
* Description:
*
* Returns: VCHI error code
*
***********************************************************/
VCHPRE_ int VCHPOST_ vc_dispmanx_update_submit_sync( DISPMANX_UPDATE_HANDLE_T update ) {
int success;
update = VC_HTOV32(update);
success = (int) dispmanx_send_command( EDispmanUpdateSubmitSync,
&update, sizeof(update));
return success;
}
示例13: vc_dispmanx_display_close
/***********************************************************
* Name: vc_dispmanx_display_close
*
* Arguments:
* DISPMANX_DISPLAY_HANDLE_T display
*
* Description:
*
* Returns:
*
***********************************************************/
VCHPRE_ int VCHPOST_ vc_dispmanx_display_close( DISPMANX_DISPLAY_HANDLE_T display ) {
int success;
display = VC_HTOV32(display);
success = (int) dispmanx_send_command( EDispmanDisplayClose | DISPMANX_NO_REPLY_MASK,
&display, sizeof(display));
return success;
}
示例14: vc_cec_send_message
/***********************************************************
* Name: vc_cec_send_message
*
* Arguments:
* Follower's logical address
* Message payload WITHOUT the header byte (can be NULL)
* Payload length WITHOUT the header byte (can be zero)
* VC_TRUE if the message is a reply to an incoming message
* (For poll message set payload to NULL and length to zero)
*
* Description
* Remove all commands to be forwarded. This does not affect
* the button presses which are always forwarded
*
* Returns: if the command is successful (zero) or not (non-zero)
* If the command is successful, there will be a Tx callback
* in due course to indicate whether the message has been
* acknowledged by the recipient or not
***********************************************************/
VCHPRE_ int VCHPOST_ vc_cec_send_message(uint32_t follower,
const uint8_t *payload,
uint32_t length,
bool_t is_reply) {
int success = -1;
CEC_SEND_MSG_PARAM_T param;
vcos_assert(length <= CEC_MAX_XMIT_LENGTH);
param.follower = VC_HTOV32(follower);
param.length = VC_HTOV32(length);
param.is_reply = VC_HTOV32(is_reply);
memset(param.payload, 0, sizeof(param.payload));
if(length > 0 && vcos_verify(payload)) {
memcpy(param.payload, payload, _min(length, CEC_MAX_XMIT_LENGTH));
}
success = cecservice_send_command( VC_CEC_SEND_MSG, ¶m, sizeof(param), 1);
return success;
}
示例15: vc_dispmanx_update_start
/***********************************************************
* Name: vc_dispmanx_update_start
*
* Arguments:
* int32_t priority
*
* Description:
*
* Returns:
*
***********************************************************/
VCHPRE_ DISPMANX_UPDATE_HANDLE_T VCHPOST_ vc_dispmanx_update_start( int32_t priority ) {
uint32_t handle;
priority = VC_HTOV32(priority);
handle = dispmanx_get_handle(EDispmanUpdateStart,
&priority, sizeof(priority));
return (DISPMANX_UPDATE_HANDLE_T) handle;
}