test.c
Upload User: hjq518
Upload Date: 2021-12-09
Package Size: 5084k
Code Size: 2k
Category:

Audio program

Development Platform:

Visual 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. #include <stdint.h>
  21. #include <string.h>
  22. #include <gtk/gtk.h>
  23. #include "../x264.h"
  24. #include "../common/common.h"
  25. #include "x264_gtk.h"
  26. #include "x264_gtk_private.h"
  27. #include "x264_gtk_i18n.h"
  28. int
  29. main (int argc, char *argv[])
  30. {
  31.   GtkWidget    *window;
  32.   X264_Gtk     *x264_gtk;
  33.   x264_param_t *param;
  34.   x264_param_t  param_default;
  35.   char         *res;
  36.   char         *res_default;
  37.   BIND_X264_TEXTDOMAIN();
  38.   gtk_init (&argc, &argv);
  39.   window = x264_gtk_window_create (NULL);
  40.   x264_gtk_shutdown (window);
  41.   x264_gtk = x264_gtk_load ();
  42.   param = x264_gtk_param_get (x264_gtk);
  43.   /* do what you want with these data */
  44.   /* for example, displaying them and compare with default*/
  45.   res = x264_param2string (param, 0);
  46.   printf ("%sn", res);
  47.   x264_param_default (&param_default);
  48.   res_default = x264_param2string (&param_default, 0);
  49.   printf ("n%sn", res_default);
  50.   if (strcmp (res, res_default) == 0)
  51.     printf (_("nSame result !n"));
  52.   else
  53.     printf (_("nDifferent from default valuesn"));
  54.   x264_free (res);
  55.   x264_free (res_default);
  56.   x264_gtk_free (x264_gtk);
  57.   g_free (param);
  58.   return 1;
  59. }