Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/flickernoise
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 619f863
Choose a base ref
...
head repository: m-labs/flickernoise
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a4b3833
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Jan 27, 2012

  1. videoin: add fullscreen button

    Xiangfu Liu committed Jan 27, 2012
    Copy the full SHA
    8b029fd View commit details
  2. videoin: finish fullscreen function

    Xiangfu Liu committed Jan 27, 2012
    Copy the full SHA
    a4b3833 View commit details
Showing with 46 additions and 3 deletions.
  1. +46 −3 src/gui/videoin.c
49 changes: 46 additions & 3 deletions src/gui/videoin.c
Original file line number Diff line number Diff line change
@@ -32,6 +32,8 @@
#include "cp.h"
#include "../input.h"
#include "videoin.h"
#include "../compiler/compiler.h"
#include "guirender.h"

static int appid;

@@ -193,6 +195,43 @@ static void close_videoin_window(void)
resmgr_release(RESOURCE_VIDEOIN);
}

static void dummy_rmc(const char *msg)
{
}

static void stop_callback(void)
{
if(!resmgr_acquire("Video in settings", RESOURCE_VIDEOIN))
return;

video_fd = open("/dev/video", O_RDWR);
if(video_fd == -1) {
perror("Unable to open video device");
resmgr_release(RESOURCE_VIDEOIN);
return;
}
input_add_callback(preview_update);
}

static void fullscreen_callback(mtk_event *e, void *arg)
{
struct patch *p;
char *dummy_filename = "FS";
char *code = "video_a=1;decay=0;";

p = patch_compile_filename(dummy_filename, code, dummy_rmc);
if(p == NULL)
return;

close(video_fd);
input_delete_callback(preview_update);
resmgr_release(RESOURCE_VIDEOIN);

guirender(appid, p, stop_callback);

patch_free(p);
}

static void ok_callback(mtk_event *e, void *arg)
{
set_config();
@@ -280,11 +319,13 @@ void init_videoin(void)
"g.rowconfig(10, -size 10)",

"g_btn = new Grid()",
"b_fullscreen = new Button(-text \"Full Screen\")",
"b_ok = new Button(-text \"OK\")",
"b_cancel = new Button(-text \"Cancel\")",
"g_btn.columnconfig(1, -size 190)",
"g_btn.place(b_ok, -column 2 -row 1)",
"g_btn.place(b_cancel, -column 3 -row 1)",
"g_btn.place(b_fullscreen, -column 1 -row 1)",
"g_btn.columnconfig(2, -size 100)",
"g_btn.place(b_ok, -column 3 -row 1)",
"g_btn.place(b_cancel, -column 4 -row 1)",
"g.place(g_btn, -column 1 -row 11)",

"w = new Window(-content g -title \"Video input settings\" -worky 30)",
@@ -302,6 +343,8 @@ void init_videoin(void)
mtk_bind(appid, "s_contrast", "change", slide_callback, (void *)CONTROL_CONTRAST);
mtk_bind(appid, "s_hue", "change", slide_callback, (void *)CONTROL_HUE);

mtk_bind(appid, "b_fullscreen", "commit", fullscreen_callback, NULL);

mtk_bind(appid, "b_ok", "commit", ok_callback, NULL);
mtk_bind(appid, "b_cancel", "commit", close_callback, NULL);