]> git.sesse.net Git - x264/blob - gtk/test.c
Update file headers throughout x264
[x264] / gtk / test.c
1 /*****************************************************************************
2  * test.c: h264 gtk encoder frontend
3  *****************************************************************************
4  * Copyright (C) 2006 Vincent Torri
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
19  *****************************************************************************/
20
21 #include <stdint.h>
22 #include <string.h>
23
24 #include <gtk/gtk.h>
25
26 #include "../x264.h"
27 #include "../common/common.h"
28
29 #include "x264_gtk.h"
30 #include "x264_gtk_private.h"
31 #include "x264_gtk_i18n.h"
32
33
34 int
35 main (int argc, char *argv[])
36 {
37   GtkWidget    *window;
38   X264_Gtk     *x264_gtk;
39   x264_param_t *param;
40   x264_param_t  param_default;
41   char         *res;
42   char         *res_default;
43
44   BIND_X264_TEXTDOMAIN();
45
46   gtk_init (&argc, &argv);
47
48   window = x264_gtk_window_create (NULL);
49   x264_gtk_shutdown (window);
50
51   x264_gtk = x264_gtk_load ();
52   param = x264_gtk_param_get (x264_gtk);
53
54   /* do what you want with these data */
55   /* for example, displaying them and compare with default*/
56   res = x264_param2string (param, 0);
57   printf ("%s\n", res);
58
59   x264_param_default (&param_default);
60   res_default = x264_param2string (&param_default, 0);
61   printf ("\n%s\n", res_default);
62
63   if (strcmp (res, res_default) == 0)
64     printf (_("\nSame result !\n"));
65   else
66     printf (_("\nDifferent from default values\n"));
67
68   x264_free (res);
69   x264_free (res_default);
70
71   x264_gtk_free (x264_gtk);
72   g_free (param);
73
74   return 1;
75 }