您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ vc_dispmanx_update_start函数代码示例

51自学网 2021-06-03 09:35:01
  C++
这篇教程C++ vc_dispmanx_update_start函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中vc_dispmanx_update_start函数的典型用法代码示例。如果您正苦于以下问题:C++ vc_dispmanx_update_start函数的具体用法?C++ vc_dispmanx_update_start怎么用?C++ vc_dispmanx_update_start使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了vc_dispmanx_update_start函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: vo_display_frame

void vo_display_frame (RECT_VARS_T* vars, int width, int height,                      int chroma_width, int chroma_height,                      uint8_t * const * buf, int num){  int ret;  static VC_RECT_T       src_rect;  static VC_RECT_T       dst_rect;  static VC_DISPMANX_ALPHA_T alpha = { DISPMANX_FLAGS_ALPHA_FROM_SOURCE | DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS,                                 255, /*alpha 0->255*/			        0 };  int pitch = VO_ALIGN_UP(width,32);  assert((height % 16) == 0);  assert((chroma_height % 16) == 0);  if (num == 0) {    vars->resource = vc_dispmanx_resource_create( VC_IMAGE_YUV420,                                                  width,                                                  height,                                                  &vars->vc_image_ptr );    assert( vars->resource );    vars->update = vc_dispmanx_update_start( 10 );    assert( vars->update );    vc_dispmanx_rect_set( &src_rect, 0, 0, width << 16, height << 16 );    vc_dispmanx_rect_set( &dst_rect, 0, 0, vars->info.width, vars->info.height);    vars->element = vc_dispmanx_element_add(    vars->update,                                                vars->display,                                                2000,               // layer                                                &dst_rect,                                                vars->resource,                                                &src_rect,                                                DISPMANX_PROTECTION_NONE,                                                &alpha,                                                NULL,             // clamp                                                VC_IMAGE_ROT0 );    ret = vc_dispmanx_update_submit( vars->update, NULL, NULL);    vc_dispmanx_rect_set( &dst_rect, 0, 0, width, (3*height)/2);  }  ret = vc_dispmanx_resource_write_data(  vars->resource,                                          VC_IMAGE_YUV420,                                          pitch,                                          buf[0],                                          &dst_rect );  assert( ret == 0 );  vars->update = vc_dispmanx_update_start( 10 );  assert( vars->update );  //ret = vc_dispmanx_update_submit_sync( vars->update );    ret = vc_dispmanx_update_submit( vars->update, NULL, NULL);    assert( ret == 0 );}
开发者ID:adamsutton,项目名称:pidvbip,代码行数:59,


示例2: display_subpicture

static void display_subpicture(vout_display_t *vd, subpicture_t *subpicture){    vout_display_sys_t *sys = vd->sys;    struct dmx_region_t **dmx_region = &sys->dmx_region;    struct dmx_region_t *unused_dmx_region;    DISPMANX_UPDATE_HANDLE_T update = 0;    picture_t *picture;    video_format_t *fmt;    struct dmx_region_t *dmx_region_next;    if(subpicture) {        subpicture_region_t *region = subpicture->p_region;        while(region) {            picture = region->p_picture;            fmt = &region->fmt;            if(!*dmx_region) {                if(!update)                    update = vc_dispmanx_update_start(10);                *dmx_region = dmx_region_new(vd, update, region);            } else if(((*dmx_region)->bmp_rect.width != (int32_t)fmt->i_visible_width) ||                    ((*dmx_region)->bmp_rect.height != (int32_t)fmt->i_visible_height) ||                    ((*dmx_region)->pos_x != region->i_x) ||                    ((*dmx_region)->pos_y != region->i_y) ||                    ((*dmx_region)->alpha.opacity != (uint32_t)region->i_alpha)) {                dmx_region_next = (*dmx_region)->next;                if(!update)                    update = vc_dispmanx_update_start(10);                dmx_region_delete(*dmx_region, update);                *dmx_region = dmx_region_new(vd, update, region);                (*dmx_region)->next = dmx_region_next;            } else if((*dmx_region)->picture != picture) {                if(!update)                    update = vc_dispmanx_update_start(10);                dmx_region_update(*dmx_region, update, picture);            }            dmx_region = &(*dmx_region)->next;            region = region->p_next;        }    }    /* Remove remaining regions */    unused_dmx_region = *dmx_region;    while(unused_dmx_region) {        dmx_region_next = unused_dmx_region->next;        if(!update)            update = vc_dispmanx_update_start(10);        dmx_region_delete(unused_dmx_region, update);        unused_dmx_region = dmx_region_next;    }    *dmx_region = NULL;    if(update)        vc_dispmanx_update_submit_sync(update);}
开发者ID:Kubink,项目名称:vlc,代码行数:56,


示例3: show_cursor

static void show_cursor(ALLEGRO_DISPLAY_RASPBERRYPI *d){    if (d->cursor_data == NULL || cursor_added) {        return;    }    int width = d->cursor_width;    int height = d->cursor_height;    uint32_t unused;    cursor_resource = vc_dispmanx_resource_create(VC_IMAGE_ARGB8888, width, height, &unused);    VC_RECT_T r;    r.x = 0;    r.y = 0;    r.width = width;    r.height = height;    int dpitch = pot(sizeof(uint32_t) * width);    dispman_update = vc_dispmanx_update_start(0);    vc_dispmanx_resource_write_data(cursor_resource, VC_IMAGE_ARGB8888, dpitch, d->cursor_data, &r);    vc_dispmanx_update_submit_sync(dispman_update);    ALLEGRO_MOUSE_STATE state;    al_get_mouse_state(&state);    dst_rect.x = state.x+d->cursor_offset_x;    dst_rect.y = state.y+d->cursor_offset_y;    dst_rect.width = width;    dst_rect.height = height;    src_rect.x = 0;    src_rect.y = 0;    src_rect.width = width << 16;    src_rect.height = height << 16;    dispman_update = vc_dispmanx_update_start(0);    cursor_element = vc_dispmanx_element_add(                         dispman_update,                         dispman_display,                         0/*layer*/,                         &dst_rect,                         cursor_resource,                         &src_rect,                         DISPMANX_PROTECTION_NONE,                         0 /*alpha*/,                         0/*clamp*/,                         0/*transform*/                     );    vc_dispmanx_update_submit_sync(dispman_update);    cursor_added = true;}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:55,


示例4: dispmanxtest

void dispmanxtest() {	DISPMANX_DISPLAY_HANDLE_T display;	int ret;	DISPMANX_MODEINFO_T displayinfo;	DISPMANX_RESOURCE_HANDLE_T res;	int width = 1024;	int height = 576;	uint32_t vc_image_ptr;	DISPMANX_UPDATE_HANDLE_T update;	VC_RECT_T dst_rect,src_rect;	DISPMANX_ELEMENT_HANDLE_T element;		bcm_host_init();	display = vc_dispmanx_display_open(0);	ret = vc_dispmanx_display_get_info( display, &displayinfo);	assert(ret==0);	printf("display is %dx%d/n",displayinfo.width,displayinfo.height);	res = vc_dispmanx_resource_create(VC_IMAGE_YUV420,width,height,&vc_image_ptr);	vc_image_ptr = vc_dispmanx_resource_get_image_handle(res);	printf("vc_image_ptr %x/n",vc_image_ptr);	assert(res);	update = vc_dispmanx_update_start(10);	assert(update);	vc_dispmanx_rect_set(&src_rect,0,0,width<<16,height<<16);	vc_dispmanx_rect_set(&dst_rect,0,(displayinfo.height - height)/2,width-32,height);	element = vc_dispmanx_element_add(update,display,2000,&dst_rect,res,&src_rect,DISPMANX_PROTECTION_NONE,NULL,NULL,DISPMANX_NO_ROTATE);	ret = vc_dispmanx_update_submit_sync(update);	assert(ret==0);	uint8_t *rawfb = (uint8_t*)mapmem(vc_image_ptr,0x1000);	for (int i=0; i<0x100; i++) {		printf("%02x ",rawfb[i]);	}	printf("/n");	unmapmem(rawfb,0x1000);	puts("sleeping");	sleep(10);	update = vc_dispmanx_update_start(10);	assert(update);	ret = vc_dispmanx_element_remove(update,element);	assert(ret==0);	ret = vc_dispmanx_update_submit_sync(update);	assert(ret==0);	ret = vc_dispmanx_resource_delete(res);	assert(ret==0);	ret = vc_dispmanx_display_close(display);	assert(ret==0);}
开发者ID:cleverca22,项目名称:hackdriver,代码行数:48,


示例5: dispmanx_flip

static void dispmanx_flip(struct dispmanx_page *page, void *data){   struct dispmanx_video *_dispvars = data;   if (!_dispvars)      return;   /* Dispmanx doesn't support issuing more than one pageflip.     * If we do, the second CB isn't called. */   if (_dispvars->pageflip_pending > 0)   {      slock_lock(_dispvars->vsync_cond_mutex);      scond_wait(_dispvars->vsync_condition, _dispvars->vsync_cond_mutex);      slock_unlock(_dispvars->vsync_cond_mutex);   }   /* Issue a page flip at the next vblank interval     * (will be done at vsync anyway). */   _dispvars->update = vc_dispmanx_update_start(0);   vc_dispmanx_element_change_source(_dispvars->update, _dispvars->element,         _dispvars->resources[page->numpage]);   vc_dispmanx_update_submit(_dispvars->update, vsync_callback, (void*)page);   slock_lock(_dispvars->pending_mutex);   _dispvars->pageflip_pending++;	   slock_unlock(_dispvars->pending_mutex);}
开发者ID:CautiousAlbino,项目名称:RetroArch,代码行数:29,


示例6: destroyBackgroundLayer

booldestroyBackgroundLayer(    BACKGROUND_LAYER_T *bg){    int result = 0;    bool res = true;    if(bg->element) {      DISPMANX_UPDATE_HANDLE_T update = vc_dispmanx_update_start(0);      if(update) {	result = vc_dispmanx_element_remove(update, bg->element);	if(result != DISPMANX_SUCCESS) res = false;		result = vc_dispmanx_update_submit_sync(update);	if(result != DISPMANX_SUCCESS) res = false;	      }else{	res = false;      }    }    result = vc_dispmanx_resource_delete(bg->resource);    if(result != DISPMANX_SUCCESS) res = false;    return res;}
开发者ID:gvsurenderreddy,项目名称:kano-toolset,代码行数:27,


示例7: vsync

void vsync(DISPMANX_UPDATE_HANDLE_T u, void* arg){    int ret;    DISPMANX_UPDATE_HANDLE_T    update;    update = vc_dispmanx_update_start( 10 );    assert( update );    ret = vc_dispmanx_element_change_source( update, element, resource[next_resource]);    assert( ret == 0 );    ret = vc_dispmanx_update_submit_sync( update );    assert( ret == 0 );    if(next_resource != 2) {        int real_next_resource = next_resource ^ 1;        next_resource = 2; // use filler if next callback called before this one ends        // fill image        int n;        for (n=0; n<HEIGHT; n+=2) {            get_packet(ROW(n)+24); // +24 because clock never changes            memcpy(ROW(n+1)+24, ROW(n)+24, 336); // double it up because the hardware scaler                                                 // will introduce blurring between lines        }        // write to resource        ret = vc_dispmanx_resource_write_data(  resource[real_next_resource], TYPE, PITCH, image, &image_rect );        assert( ret == 0 );        next_resource = real_next_resource; // queue up next real resource    }}
开发者ID:Tachiorz,项目名称:raspi-teletext,代码行数:34,


示例8: fbDispmanSetNativeCursor

static void fbDispmanSetNativeCursor(jlong nativeCursorHandle) {    DISPMANX_UPDATE_HANDLE_T update;    DispmanCursorImage *cursorImage = (DispmanCursorImage *)jlong_to_ptr(nativeCursorHandle);    if (cursorImage != NULL && cursor.element != 0) {        if (cursorImage->width != cursor.cursorWidth ||                cursorImage->height != cursor.cursorHeight) {            fbDispmanRemoveDispmanxElement();            cursor.cursorWidth = cursorImage->width;            cursor.cursorHeight = cursorImage->height;            fbDispmanAddDispmanxElement();        }        cursor.currentCursor = nativeCursorHandle;        if (cursor.isVisible) {            update = vc_dispmanx_update_start(0);            vc_dispmanx_element_change_source(update, cursor.element, cursorImage->resource);            vc_dispmanx_update_submit_sync(update);        }    }}
开发者ID:166MMX,项目名称:openjdk.java.net-openjfx-8u40-rt,代码行数:27,


示例9: vc_dispmanx_update_start

void ViewBackend::commitBuffer(uint32_t handle, uint32_t width, uint32_t height){    if (handle != elementHandle || width != this->width || height != this->height)        return;    DISPMANX_UPDATE_HANDLE_T updateHandle = vc_dispmanx_update_start(0);    VC_RECT_T srcRect, destRect;    vc_dispmanx_rect_set(&srcRect, 0, 0, width << 16, height << 16);    vc_dispmanx_rect_set(&destRect, 0, 0, width, height);    vc_dispmanx_element_change_attributes(updateHandle, elementHandle, 1 << 3 | 1 << 2, 0, 0, &destRect, &srcRect, 0, DISPMANX_NO_ROTATE);    vc_dispmanx_update_submit(updateHandle,        [](DISPMANX_UPDATE_HANDLE_T, void* data)        {            auto& backend = *static_cast<ViewBackend*>(data);            struct timeval tv;            gettimeofday(&tv, nullptr);            uint64_t time = tv.tv_sec * 1000 + tv.tv_usec / 1000;            ssize_t ret = write(backend.updateFd, &time, sizeof(time));            if (ret != sizeof(time))                fprintf(stderr, "ViewBackend: failed to write to the update eventfd/n");        },        this);}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:28,


示例10: exit_func

static void exit_func(void)// Function to be passed to atexit().{   DISPMANX_UPDATE_HANDLE_T dispman_update;   int s;   // clear screen   glClear( GL_COLOR_BUFFER_BIT );   eglSwapBuffers(state->display, state->surface);   glDeleteTextures(6, state->tex);   eglDestroySurface( state->display, state->surface );   dispman_update = vc_dispmanx_update_start( 0 );   s = vc_dispmanx_element_remove(dispman_update, state->dispman_element);   assert(s == 0);   vc_dispmanx_update_submit_sync( dispman_update );   s = vc_dispmanx_display_close(state->dispman_display);   assert (s == 0);   // Release OpenGL resources   eglMakeCurrent( state->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT );   eglDestroyContext( state->display, state->context );   eglTerminate( state->display );#ifndef __circle__   // release texture buffers   free(state->tex_buf1);   free(state->tex_buf2);   free(state->tex_buf3);#endif   printk("/ncube closed/n");} // exit_func()
开发者ID:rsta2,项目名称:circle,代码行数:33,


示例11: createDispmanxLayer

static EGLNativeWindowType createDispmanxLayer(const QPoint &pos, const QSize &size, int z, DISPMANX_FLAGS_ALPHA_T flags){    VC_RECT_T dst_rect;    dst_rect.x = pos.x();    dst_rect.y = pos.y();    dst_rect.width = size.width();    dst_rect.height = size.height();    VC_RECT_T src_rect;    src_rect.x = 0;    src_rect.y = 0;    src_rect.width = size.width() << 16;    src_rect.height = size.height() << 16;    DISPMANX_UPDATE_HANDLE_T dispman_update = vc_dispmanx_update_start(0);    VC_DISPMANX_ALPHA_T alpha;    alpha.flags = flags;    alpha.opacity = 0xFF;    alpha.mask = 0;    DISPMANX_ELEMENT_HANDLE_T dispman_element = vc_dispmanx_element_add(            dispman_update, dispman_display, z, &dst_rect, 0, &src_rect,            DISPMANX_PROTECTION_NONE, &alpha, (DISPMANX_CLAMP_T *)NULL, (DISPMANX_TRANSFORM_T)0);    vc_dispmanx_update_submit_sync(dispman_update);    EGL_DISPMANX_WINDOW_T *eglWindow = new EGL_DISPMANX_WINDOW_T;    eglWindow->element = dispman_element;    eglWindow->width = size.width();    eglWindow->height = size.height();    return eglWindow;}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:34,


示例12: dispmanx_surface_update

static void dispmanx_surface_update(void *data, const void *frame, struct dispmanx_surface *surface){   struct dispmanx_video *_dispvars = data;   struct dispmanx_page *page = NULL;      /* Wait until last issued flip completes to get a free page. Also,       dispmanx doesn't support issuing more than one pageflip.*/   slock_lock(_dispvars->pending_mutex);   if (_dispvars->pageflip_pending > 0)   {      scond_wait(_dispvars->vsync_condition, _dispvars->pending_mutex);   }   slock_unlock(_dispvars->pending_mutex);     page = dispmanx_get_free_page(_dispvars, surface);    /* Frame blitting */   vc_dispmanx_resource_write_data(page->resource, surface->pixformat,      surface->pitch, (void*)frame, &(surface->bmp_rect));      /* Issue a page flip that will be done at the next vsync. */   _dispvars->update = vc_dispmanx_update_start(0);   vc_dispmanx_element_change_source(_dispvars->update, surface->element,         page->resource);   vc_dispmanx_update_submit(_dispvars->update, dispmanx_vsync_callback, (void*)page);   slock_lock(_dispvars->pending_mutex);   _dispvars->pageflip_pending++;	   slock_unlock(_dispvars->pending_mutex);}
开发者ID:luiseduardohdbackup,项目名称:RetroArch,代码行数:32,


示例13: vc_dispmanx_update_start

int SliceMngr::blankScreen(){  DISPMANX_UPDATE_HANDLE_T update;  update = vc_dispmanx_update_start(0);  vc_dispmanx_element_change_layer(update, mBackground.element, 1);  vc_dispmanx_element_change_layer(update, mImage.element, 0);  return vc_dispmanx_update_submit_sync(update);}
开发者ID:sphereinabox,项目名称:littlerp,代码行数:7,


示例14: RPI_WarpMouseGlobal

/* Warp the mouse to (x,y) */static voidRPI_WarpMouseGlobal(int x, int y){    RPI_CursorData *curdata;    DISPMANX_UPDATE_HANDLE_T update;    int ret;    VC_RECT_T dst_rect;    SDL_Mouse *mouse = SDL_GetMouse();        if (mouse != NULL && mouse->cur_cursor != NULL && mouse->cur_cursor->driverdata != NULL) {        curdata = (RPI_CursorData *) mouse->cur_cursor->driverdata;        if (curdata->element != DISPMANX_NO_HANDLE) {            update = vc_dispmanx_update_start( 10 );            SDL_assert( update );            vc_dispmanx_rect_set( &dst_rect, x, y, curdata->w, curdata->h);            ret = vc_dispmanx_element_change_attributes(                update,                curdata->element,                ELEMENT_CHANGE_DEST_RECT,                0,                0,                &dst_rect,                NULL,                DISPMANX_NO_HANDLE,                DISPMANX_NO_ROTATE);            SDL_assert( ret == DISPMANX_SUCCESS );            /* Submit asynchronously, otherwise the peformance suffers a lot */            ret = vc_dispmanx_update_submit( update, 0, NULL );            SDL_assert( ret == DISPMANX_SUCCESS );        }    }    }
开发者ID:KonradJanica,项目名称:SDL2,代码行数:33,


示例15: DISPMANX_BlankBackground

static void DISPMANX_BlankBackground(void){  //MAC: Funcion que simplemente pone un element nuevo cuyo resource es de un solo pixel de color negro,  //se escala a pantalla completa y listo.    // we create a 1x1 black pixel image that is added to display just behind video  VC_IMAGE_TYPE_T type = VC_IMAGE_RGB565;  uint32_t vc_image_ptr;  uint16_t image = 0x0000; // black  VC_RECT_T dst_rect, src_rect;  dispvars->b_resource = vc_dispmanx_resource_create( type, 1 /*width*/, 1 /*height*/, &vc_image_ptr );  vc_dispmanx_rect_set( &dst_rect, 0, 0, 1, 1);  vc_dispmanx_resource_write_data( dispvars->b_resource, type, sizeof(image), &image, &dst_rect );  vc_dispmanx_rect_set( &src_rect, 0, 0, 1<<16, 1<<16);  vc_dispmanx_rect_set( &dst_rect, 0, 0, 0, 0);  dispvars->b_update = vc_dispmanx_update_start(0);  dispvars->b_element = vc_dispmanx_element_add(dispvars->b_update, dispvars->display, -1 /*layer*/, &dst_rect, 	dispvars->b_resource, &src_rect, DISPMANX_PROTECTION_NONE, NULL, NULL, (DISPMANX_TRANSFORM_T)0 );    vc_dispmanx_update_submit_sync( dispvars->b_update );}
开发者ID:kuronekodaisuki,项目名称:SDL12-kms-dispmanx,代码行数:29,


示例16: RPI_FreeCursor

/* Free a window manager cursor */static voidRPI_FreeCursor(SDL_Cursor * cursor){    int ret;    DISPMANX_UPDATE_HANDLE_T update;    RPI_CursorData *curdata;        if (cursor != NULL) {        curdata = (RPI_CursorData *) cursor->driverdata;                if (curdata != NULL) {            if (curdata->element != DISPMANX_NO_HANDLE) {                update = vc_dispmanx_update_start( 10 );                SDL_assert( update );                ret = vc_dispmanx_element_remove( update, curdata->element );                SDL_assert( ret == DISPMANX_SUCCESS );                ret = vc_dispmanx_update_submit_sync( update );                SDL_assert( ret == DISPMANX_SUCCESS );            }                        if (curdata->resource != DISPMANX_NO_HANDLE) {                ret = vc_dispmanx_resource_delete( curdata->resource );                SDL_assert( ret == DISPMANX_SUCCESS );            }                    SDL_free(cursor->driverdata);        }        SDL_free(cursor);    }}
开发者ID:KonradJanica,项目名称:SDL2,代码行数:31,


示例17: DISPMANX_DirectUpdate

static void DISPMANX_DirectUpdate(_THIS, int numrects, SDL_Rect *rects){		//En OpenGL también va así
C++ vcalloc函数代码示例
C++ vc_dispmanx_element_add函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。