I have this code, its puts a green frame around a black rectangle, I was going for a green screen but close enough!
- Code: Select all
int32_t success = 0;
success = graphics_get_display_size(0 /* LCD */, &screen_width, &screen_height);
assert( success >= 0 );
dispman_display = vc_dispmanx_display_open( 0 /* LCD */);
dispman_update = vc_dispmanx_update_start( 0 );
dst_rect.x = 0;
dst_rect.y = 0;
dst_rect.width = screen_width;
dst_rect.height = screen_height;
src_rect.x = 0;
src_rect.y = 0;
src_rect.width = 720;
src_rect.height = 576;
dispman_element = vc_dispmanx_element_add ( dispman_update, dispman_display,
0/*layer*/, &dst_rect, 0/*src*/,
&src_rect, DISPMANX_PROTECTION_NONE, 0 /*alpha*/, 0/*clamp*/, 0/*transform*/);
vc_dispmanx_display_set_background( dispman_update, dispman_display, 0x00, 0xaa, 0x00 );
vc_dispmanx_update_submit_sync( dispman_update );
Im not sure of the next step, do I need to set up a YUV resource then call vc_dispmanx_resource_write_data? and how do I pass data to that? It needs some kind of address and I'm not quite sure how to get that!
Then I guess something needs to be called to show the resource? Is it just vc_dispmanx_display_set_destination? Or do more things need to be done with updates?
Also - sorry for the re-post but there's no edit and my original thread wasn't very clear!