]> git.sesse.net Git - x264/blob - gtk/test.c
remove the restriction on number of threads as a function of resolution (it was wrong...
[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
8 #include "../x264.h"
9 #include "../common/common.h"
10
11 #include "x264_gtk.h"
12 #include "x264_gtk_private.h"
13 #include "x264_gtk_i18n.h"
14
15
16 int
17 main (int argc, char *argv[])
18 {
19   GtkWidget    *window;
20   X264_Gtk     *x264_gtk;
21   x264_param_t *param;
22   x264_param_t  param_default;
23   char         *res;
24   char         *res_default;
25
26   BIND_X264_TEXTDOMAIN();
27
28   gtk_init (&argc, &argv);
29
30   window = x264_gtk_window_create (NULL);
31   x264_gtk_shutdown (window);
32
33   x264_gtk = x264_gtk_load ();
34   param = x264_gtk_param_get (x264_gtk);
35
36   /* do what you want with these data */
37   /* for example, displaying them and compare with default*/
38   res = x264_param2string (param, 0);
39   printf ("%s\n", res);
40
41   x264_param_default (&param_default);
42   res_default = x264_param2string (&param_default, 0);
43   printf ("\n%s\n", res_default);
44
45   if (strcmp (res, res_default) == 0)
46     printf (_("\nSame result !\n"));
47   else
48     printf (_("\nDifferent from default values\n"));
49
50   x264_free (res);
51   x264_free (res_default);
52
53   x264_gtk_free (x264_gtk);
54   g_free (param);
55
56   return 1;
57 }