summaryrefslogtreecommitdiffstats
path: root/test/test-gobject.c
blob: 44a13cbd714ccb460a289173e5d6fd70e169f197 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <glib-object.h>
#include "uca-camera.h"
#include "uca-pco-camera.h"

int main(int argc, char **argv)
{
    g_type_init();

    GError *error = NULL;
    UcaPcoCamera *cam = uca_pco_camera_new(&error);

    if (cam == NULL) {
        g_error("Camera could not be initialized\n");
    }

    guint width, height;
    g_object_get(cam,
            "sensor-width", &width,
            "sensor-height", &height,
            NULL);
    g_print("resolution %ix%i\n", width, height);

    g_object_unref(cam);
}