Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fullscreen button in video-in doesn't use the current settings #35

Closed
sbourdeauducq opened this issue Feb 26, 2012 · 4 comments
Closed

Comments

@sbourdeauducq
Copy link
Member

Which kinda defeats its purpose.

@ghost ghost assigned xiangfu Feb 26, 2012
@xiangfu
Copy link

xiangfu commented Mar 1, 2012

Fixed in http://git.io/6uQuRg

@sbourdeauducq
Copy link
Member Author

  • Breaks the "Cancel" button
  • Does not take format changes into account
  • Loses synchronization if contrast/format/... adjustment keys (Fx) are pressed during rendering

I think you'd be better off with reverting this change, and adding an option to the renderer so it does not touch the video input settings and ignores the adjustment keys.

@xiangfu
Copy link

xiangfu commented Mar 1, 2012

How about this patch:

  • fix the "Cancel" button
  • Sync the contrast/format/..., since the F5/F6 do change the sysconfig. I leave them there.
  • The format changes works fine.
diff --git a/src/gui/videoin.c b/src/gui/videoin.c
index 231d31b..0221df4 100644
--- a/src/gui/videoin.c
+++ b/src/gui/videoin.c
@@ -44,6 +44,11 @@ static int brightness;
 static int contrast;
 static int hue;
 
+static int old_format;
+static int old_brightness;
+static int old_contrast;
+static int old_hue;
+
 static unsigned short preview_fb[180*144];
 
 enum {
@@ -58,7 +63,6 @@ static void set_config(void)
    config_write_int("vin_brightness", brightness);
    config_write_int("vin_contrast", contrast);
    config_write_int("vin_hue", hue);
-   cp_notify_changed();
 }
 
 static void set_format(int f)
@@ -211,6 +215,7 @@ static void stop_callback(void)
        resmgr_release(RESOURCE_VIDEOIN);
        return;
    }
+   load_videoin_config();
    input_add_callback(preview_update);
 }
 
@@ -236,11 +241,18 @@ static void fullscreen_callback(mtk_event *e, void *arg)
 static void ok_callback(mtk_event *e, void *arg)
 {
    set_config();
+   cp_notify_changed();
    close_videoin_window();
 }
 
 static void close_callback(mtk_event *e, void *arg)
 {
+   format = old_format;
+   brightness = old_brightness;
+   contrast = old_contrast;
+   hue = old_hue;
+   set_config();
+
    close_videoin_window();
 }
 
@@ -368,6 +380,11 @@ void open_videoin_window(void)
    
    w_open = 1;
    load_videoin_config();
+   old_format = format;
+   old_brightness = brightness;
+   old_contrast = contrast;
+   old_hue = hue;
+
    next_update = rtems_clock_get_ticks_since_boot() + UPDATE_PERIOD;
    input_add_callback(preview_update);
    mtk_cmd(appid, "w.open()");

@xiangfu
Copy link

xiangfu commented Mar 1, 2012

@xiangfu xiangfu closed this as completed Mar 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants