I'll take another look at the code for the zebra offsets. If you have another camera it would help to see a photo of exactly what the zebra looks like when you choose 4:3 shooting mode.
I have add value output of zebra.see that code
int gui_osd_draw_zebra(int show)
....
viewport_height = vid_get_viewport_height();
viewport_width = vid_get_viewport_width();
viewport_buffer_width = vid_get_viewport_buffer_width();
viewport_xoffset = vid_get_viewport_xoffset();
viewport_yoffset = vid_get_viewport_yoffset();
// debug output begin
static char osd_buf[64];
sprintf(osd_buf, "viewport_width :%8d ", viewport_width);
draw_txt_string(28, 3, osd_buf, conf.osd_color);
sprintf(osd_buf, "viewport_buffer_width %8d ", viewport_buffer_width);
draw_txt_string(28, 4, osd_buf, conf.osd_color);
sprintf(osd_buf, "viewport_xoffset :%8d ", viewport_xoffset);
draw_txt_string(28, 5, osd_buf, conf.osd_color);
// debug output end
when zebra is ok then
viewport_width 480
viewport_buffer_width 480
viewport_xoffset 0
when a 4:3 shooting mode is select, i get that values
viewport_width 360
viewport_buffer_width 480
viewport_xoffset 60
problem is that the left pos of the zebra draw is not shift by 60 pixels to right.
as you can see, on debug output, the code in lib look correct and return the x position
Canon Firmware draw the preview from X 60.on left side there is a black gap.so zebra need shift 60 Pixels to right.
i think when G12 is in 1:1 shoot mode
you should get simular values
viewport_width 240
viewport_buffer_width 360
viewport_xoffset 60
zebra buffer G12 use, i cannot use, maybe your code work only with zebra buffer now ?
EDIT:
I add code and shift grid 60 pixel to right work ok.In 4:3 shoot mode all is ok then.
But in 16:9 shoot mode, grid size is still too small.
I try to scale the values, but it seem float seem not work or my code is wrong.
when i calc the float value size vid_get_viewport_width /360 = 480 / 360.mean 1.33 in float
so the line that is draw, should be longer.because X 360* 1.33 = 478.8
void gui_grid_draw_osd(int force) {
struct gline *ptr;
+ int xoffs = vid_get_viewport_xoffset();
+ float size = vid_get_viewport_width() /360 ;
if (force || --interval==0) {
for (ptr=head; ptr; ptr=ptr->next) {
+ float x0 = ptr->x0*size+xoffs;
+ float x1 = ptr->x1*size+xoffs;
switch (ptr->type) {
case GRID_ELEM_LINE:
- draw_line(ptr->x0, ptr->y0, ptr->x1, ptr->y1, (conf.grid_force_color)?conf.grid_color:ptr->clf);
+ draw_line(x0, ptr->y0,x1, ptr->y1, (conf.grid_force_color)?conf.grid_color:ptr->clf);
......
change in other too