]> git.sesse.net Git - x264/blob - gtk/test.c
GTK update. patch by Vincent Torri.
[x264] / gtk / test.c
1 #include <stdint.h>
2 #include <string.h>
3
4 #include <gtk/gtk.h>
5
6 #       define DECLARE_ALIGNED( type, var, n ) type var __attribute__((aligned(n)))
7 #include "../x264.h"
8 #include "../common/common.h"
9
10 #include "x264_gtk.h"
11 #include "x264_gtk_private.h"
12 #include "x264_gtk_i18n.h"
13
14
15 int
16 main (int argc, char *argv[])
17 {
18   GtkWidget    *window;
19   X264_Gtk     *x264_gtk;
20   x264_param_t *param;
21   x264_param_t  param_default;
22   char         *res;
23   char         *res_default;
24
25   BIND_X264_TEXTDOMAIN();
26
27   gtk_init (&argc, &argv);
28
29   window = x264_gtk_window_create (NULL);
30   x264_gtk_shutdown (window);
31
32   x264_gtk = x264_gtk_load ();
33   param = x264_gtk_param_get (x264_gtk);
34
35   /* do what you want with these data */
36   /* for example, displaying them and compare with default*/
37   res = x264_param2string (param, 0);
38   printf ("%s\n", res);
39
40   x264_param_default (&param_default);
41   res_default = x264_param2string (&param_default, 0);
42   printf ("\n%s\n", res_default);
43
44   if (strcmp (res, res_default) == 0)
45     printf (_("\nSame result !\n"));
46   else
47     printf (_("\nDifferent from default values\n"));
48
49   x264_free (res);
50   x264_free (res_default);
51
52   x264_gtk_free (x264_gtk);
53   g_free (param);
54
55   return 1;
56 }