Exemplo n.º 1
0
static gboolean
plugin_init (GstPlugin * plugin)
{
  GST_DEBUG_CATEGORY_INIT (v4l2_debug, "v4l2", 0, "V4L2 API calls");
  GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");

  /* initialize gst controller library */
  gst_controller_init (NULL, NULL);

  if (!gst_element_register (plugin, "v4l2src", GST_RANK_PRIMARY,
          GST_TYPE_V4L2SRC) ||
#ifdef HAVE_EXPERIMENTAL
      !gst_element_register (plugin, "v4l2sink", GST_RANK_PRIMARY,
          GST_TYPE_V4L2SINK) ||
#endif
      !gst_element_register (plugin, "v4l2radio", GST_RANK_NONE,
          GST_TYPE_V4L2RADIO) ||
      /*       !gst_element_register (plugin, "v4l2jpegsrc", */
      /*           GST_RANK_NONE, GST_TYPE_V4L2JPEGSRC) || */
      /*       !gst_element_register (plugin, "v4l2mjpegsrc", */
      /*           GST_RANK_NONE, GST_TYPE_V4L2MJPEGSRC) || */
      /*       !gst_element_register (plugin, "v4l2mjpegsink", */
      /*           GST_RANK_NONE, GST_TYPE_V4L2MJPEGSINK)) */
      FALSE)
    return FALSE;

#ifdef ENABLE_NLS
  setlocale (LC_ALL, "");
  bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif /* ENABLE_NLS */

  return TRUE;
}
Exemplo n.º 2
0
void GstPlayer::ensureInitGst(){
    if(!gstIsInit){
        gst_init(NULL,NULL);
        gst_controller_init(NULL,NULL);
        gstIsInit = true;
    }
}
Exemplo n.º 3
0
static gboolean
plugin_init (GstPlugin * plugin)
{
  gst_controller_init (NULL, NULL);

  return gst_element_register (plugin, "freeverb",
      GST_RANK_NONE, GST_TYPE_FREEVERB);
}
Exemplo n.º 4
0
/* entry point to initialize the plug-in
 * initialize the plug-in itself
 * register the element factories and other features
 */
static gboolean
plugin_init (GstPlugin * plugin)
{
  /* initialize gst controller library */
  gst_controller_init(NULL, NULL);

  return gst_element_register (plugin, "plugin", GST_RANK_NONE,
      GST_TYPE_PLUGIN_TEMPLATE);
}
Exemplo n.º 5
0
static gboolean
plugin_init (GstPlugin * plugin)
{
  gst_controller_init (NULL, NULL);

  return gst_element_register (plugin, "pitch", GST_RANK_NONE, GST_TYPE_PITCH)
      && gst_element_register (plugin, "bpmdetect", GST_RANK_NONE,
      GST_TYPE_BPM_DETECT);
}
Exemplo n.º 6
0
gboolean
gst_smpte_alpha_plugin_init (GstPlugin * plugin)
{
  GST_DEBUG_CATEGORY_INIT (gst_smpte_alpha_debug, "smptealpha", 0,
      "SMPTE alpha effect");

  /* initialize gst controller library */
  gst_controller_init (NULL, NULL);

  return gst_element_register (plugin, "smptealpha", GST_RANK_NONE,
      GST_TYPE_SMPTE_ALPHA);
}
Exemplo n.º 7
0
static gboolean
plugin_init (GstPlugin * plugin)
{
  const gchar *homedir;
  gchar *path;
  GHashTable *plugin_names;
  const gchar *frei0r_path;

  GST_DEBUG_CATEGORY_INIT (frei0r_debug, "frei0r", 0, "frei0r");

  gst_controller_init (NULL, NULL);

  gst_plugin_add_dependency_simple (plugin,
      "FREI0R_PATH:HOME/.frei0r-1/lib",
      "/usr/lib/frei0r-1:/usr/local/lib/frei0r-1:"
      "/usr/lib32/frei0r-1:/usr/local/lib32/frei0r-1:"
      "/usr/lib64/frei0r-1:/usr/local/lib64/frei0r-1",
      NULL, GST_PLUGIN_DEPENDENCY_FLAG_RECURSE);

  plugin_names =
      g_hash_table_new_full ((GHashFunc) g_str_hash, (GEqualFunc) g_str_equal,
      (GDestroyNotify) g_free, NULL);

  frei0r_path = g_getenv ("FREI0R_PATH");
  if (frei0r_path && *frei0r_path) {
    gchar **p, **paths = g_strsplit (frei0r_path, ":", -1);

    for (p = paths; *p; p++) {
      register_plugins (plugin, plugin_names, *p, *p);
    }

    g_strfreev (paths);
  } else {
#define register_plugins2(plugin, pn, p) register_plugins(plugin, pn, p, p)
    homedir = g_get_home_dir ();
    path = g_build_filename (homedir, ".frei0r-1", "lib", NULL);
    register_plugins2 (plugin, plugin_names, path);
    g_free (path);
    register_plugins2 (plugin, plugin_names, "/usr/local/lib/frei0r-1");
    register_plugins2 (plugin, plugin_names, "/usr/lib/frei0r-1");
    register_plugins2 (plugin, plugin_names, "/usr/local/lib32/frei0r-1");
    register_plugins2 (plugin, plugin_names, "/usr/lib32/frei0r-1");
    register_plugins2 (plugin, plugin_names, "/usr/local/lib64/frei0r-1");
    register_plugins2 (plugin, plugin_names, "/usr/lib64/frei0r-1");
#undef register_plugins2
  }

  g_hash_table_unref (plugin_names);

  return TRUE;
}
Exemplo n.º 8
0
static gboolean
plugin_init (GstPlugin * plugin)
{
  GST_DEBUG_CATEGORY_INIT (gst_shape_wipe_debug, "shapewipe", 0,
      "shapewipe element");

  gst_controller_init (NULL, NULL);

  if (!gst_element_register (plugin, "shapewipe", GST_RANK_NONE,
          GST_TYPE_SHAPE_WIPE))
    return FALSE;

  return TRUE;
}
Exemplo n.º 9
0
/* entry point to initialize the plug-in
 * initialize the plug-in itself
 * register the element factories and other features
 */
static gboolean
ladspavidbodeshifter_init (GstPlugin * ladspavidbodeshifter)
{
  /* debug category for fltering log messages
   *
   * exchange the string 'Template ladspavidbodeshifter' with your description
   */
  GST_DEBUG_CATEGORY_INIT (gst_ladspa_vid_bodeshifter_debug, "ladspavidbodeshifter",
      0, "Template ladspavidbodeshifter");

  gst_controller_init(NULL, NULL);

  return gst_element_register (ladspavidbodeshifter, "ladspavidbodeshifter", GST_RANK_NONE,
      GST_TYPE_LADSPAVIDBODESHIFTER);
}
Exemplo n.º 10
0
static gboolean
plugin_init (GstPlugin * plugin)
{
  gboolean ret = TRUE;

  gst_controller_init (NULL, NULL);

  ret &= gst_burn_plugin_init (plugin);
  ret &= gst_chromium_plugin_init (plugin);
  ret &= gst_dilate_plugin_init (plugin);
  ret &= gst_dodge_plugin_init (plugin);
  ret &= gst_exclusion_plugin_init (plugin);
  ret &= gst_solarize_plugin_init (plugin);
  ret &= gst_gauss_blur_plugin_init (plugin);

  return ret;
}
static gboolean
plugin_init (GstPlugin * plugin)
#endif // GSTREAMER_LITE
{
  /* initialize gst controller library */
  gst_controller_init (NULL, NULL);

#ifdef GSTREAMER_LITE
  return (gst_element_register (plugin, "audiopanorama", GST_RANK_NONE,
          GST_TYPE_AUDIO_PANORAMA));
#else // GSTREAMER_LITE
  return (gst_element_register (plugin, "audiopanorama", GST_RANK_NONE,
          GST_TYPE_AUDIO_PANORAMA) &&
      gst_element_register (plugin, "audioinvert", GST_RANK_NONE,
          GST_TYPE_AUDIO_INVERT) &&
      gst_element_register (plugin, "audiokaraoke", GST_RANK_NONE,
          GST_TYPE_AUDIO_KARAOKE) &&
      gst_element_register (plugin, "audioamplify", GST_RANK_NONE,
          GST_TYPE_AUDIO_AMPLIFY) &&
      gst_element_register (plugin, "audiodynamic", GST_RANK_NONE,
          GST_TYPE_AUDIO_DYNAMIC) &&
      gst_element_register (plugin, "audiocheblimit", GST_RANK_NONE,
          GST_TYPE_AUDIO_CHEB_LIMIT) &&
      gst_element_register (plugin, "audiochebband", GST_RANK_NONE,
          GST_TYPE_AUDIO_CHEB_BAND) &&
      gst_element_register (plugin, "audioiirfilter", GST_RANK_NONE,
          GST_TYPE_AUDIO_IIR_FILTER) &&
      gst_element_register (plugin, "audiowsinclimit", GST_RANK_NONE,
          GST_TYPE_AUDIO_WSINC_LIMIT) &&
      gst_element_register (plugin, "audiowsincband", GST_RANK_NONE,
          GST_TYPE_AUDIO_WSINC_BAND) &&
      gst_element_register (plugin, "audiofirfilter", GST_RANK_NONE,
          GST_TYPE_AUDIO_FIR_FILTER) &&
      gst_element_register (plugin, "audioecho", GST_RANK_NONE,
          GST_TYPE_AUDIO_ECHO));
#endif // GSTREAMER_LITE
}
Exemplo n.º 12
0
gint
main (gint argc, gchar ** argv)
{
    gint res = 1;
    GstElement *src, *sink;
    GstElement *bin;
    GstController *ctrl;
    GstInterpolationControlSource *csource1, *csource2;
    GstClock *clock;
    GstClockID clock_id;
    GstClockReturn wait_ret;
    GValue vol = { 0, };

    gst_init (&argc, &argv);
    gst_controller_init (&argc, &argv);

    /* build pipeline */
    bin = gst_pipeline_new ("pipeline");
    clock = gst_pipeline_get_clock (GST_PIPELINE (bin));
    src = gst_element_factory_make ("audiotestsrc", "gen_audio");
    if (!src) {
        GST_WARNING ("need audiotestsrc from gst-plugins-base");
        goto Error;
    }
    sink = gst_element_factory_make ("autoaudiosink", "play_audio");
    if (!sink) {
        GST_WARNING ("need autoaudiosink from gst-plugins-base");
        goto Error;
    }

    gst_bin_add_many (GST_BIN (bin), src, sink, NULL);
    if (!gst_element_link (src, sink)) {
        GST_WARNING ("can't link elements");
        goto Error;
    }

    /* square wave
       g_object_set (G_OBJECT(src), "wave", 1, NULL);
     */

    /* add a controller to the source */
    if (!(ctrl = gst_controller_new (G_OBJECT (src), "freq", "volume", NULL))) {
        GST_WARNING ("can't control source element");
        goto Error;
    }

    csource1 = gst_interpolation_control_source_new ();
    csource2 = gst_interpolation_control_source_new ();

    gst_controller_set_control_source (ctrl, "volume",
                                       GST_CONTROL_SOURCE (csource1));
    gst_controller_set_control_source (ctrl, "freq",
                                       GST_CONTROL_SOURCE (csource2));

    /* Set interpolation mode */

    gst_interpolation_control_source_set_interpolation_mode (csource1,
            GST_INTERPOLATE_LINEAR);
    gst_interpolation_control_source_set_interpolation_mode (csource2,
            GST_INTERPOLATE_LINEAR);

    /* set control values */
    g_value_init (&vol, G_TYPE_DOUBLE);
    g_value_set_double (&vol, 0.0);
    gst_interpolation_control_source_set (csource1, 0 * GST_SECOND, &vol);
    g_value_set_double (&vol, 1.0);
    gst_interpolation_control_source_set (csource1, 5 * GST_SECOND, &vol);

    g_object_unref (csource1);

    g_value_set_double (&vol, 220.0);
    gst_interpolation_control_source_set (csource2, 0 * GST_SECOND, &vol);
    g_value_set_double (&vol, 3520.0);
    gst_interpolation_control_source_set (csource2, 3 * GST_SECOND, &vol);
    g_value_set_double (&vol, 440.0);
    gst_interpolation_control_source_set (csource2, 6 * GST_SECOND, &vol);

    g_object_unref (csource2);

    clock_id =
        gst_clock_new_single_shot_id (clock,
                                      gst_clock_get_time (clock) + (7 * GST_SECOND));

    /* run for 7 seconds */
    if (gst_element_set_state (bin, GST_STATE_PLAYING)) {
        if ((wait_ret = gst_clock_id_wait (clock_id, NULL)) != GST_CLOCK_OK) {
            GST_WARNING ("clock_id_wait returned: %d", wait_ret);
        }
        gst_element_set_state (bin, GST_STATE_NULL);
    }

    /* cleanup */
    g_object_unref (G_OBJECT (ctrl));
    gst_clock_id_unref (clock_id);
    gst_object_unref (G_OBJECT (clock));
    gst_object_unref (G_OBJECT (bin));
    res = 0;
Error:
    return (res);
}
Exemplo n.º 13
0
gint
main (gint argc, gchar ** argv)
{
  GstElement *pipeline;
  GstElement *shapewipe;
  GstController *ctrl;
  GstLFOControlSource *csource;
  GValue val = { 0, };
  GMainLoop *loop;
  GstBus *bus;
  gchar *pipeline_string;

  if (argc != 2) {
    g_print ("Usage: shapewipe mask.png\n");
    return -1;
  }

  gst_init (&argc, &argv);
  gst_controller_init (&argc, &argv);

  pipeline_string =
      g_strdup_printf
      ("videotestsrc ! video/x-raw-yuv,width=640,height=480 ! shapewipe name=shape border=0.05 ! videomixer name=mixer ! ffmpegcolorspace ! autovideosink     filesrc location=%s ! typefind ! decodebin2 ! ffmpegcolorspace ! videoscale ! queue ! shape.mask_sink    videotestsrc pattern=snow ! video/x-raw-yuv,width=640,height=480 ! queue ! mixer.",
      argv[1]);

  pipeline = gst_parse_launch (pipeline_string, NULL);
  g_free (pipeline_string);

  if (pipeline == NULL) {
    g_print ("Failed to create pipeline\n");
    return -2;
  }

  shapewipe = gst_bin_get_by_name (GST_BIN (pipeline), "shape");

  if (!(ctrl = gst_controller_new (G_OBJECT (shapewipe), "position", NULL))) {
    g_print ("can't control shapewipe element\n");
    return -3;
  }

  csource = gst_lfo_control_source_new ();

  gst_controller_set_control_source (ctrl, "position",
      GST_CONTROL_SOURCE (csource));

  g_value_init (&val, G_TYPE_FLOAT);
  g_value_set_float (&val, 0.5);
  g_object_set (G_OBJECT (csource), "amplitude", &val, NULL);
  g_value_set_float (&val, 0.5);
  g_object_set (G_OBJECT (csource), "offset", &val, NULL);
  g_value_unset (&val);

  g_object_set (G_OBJECT (csource), "frequency", 0.5, NULL);
  g_object_set (G_OBJECT (csource), "timeshift", 500 * GST_MSECOND, NULL);

  g_object_unref (csource);

  loop = g_main_loop_new (NULL, FALSE);

  bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
  gst_bus_add_signal_watch (bus);
  g_signal_connect (G_OBJECT (bus), "message", G_CALLBACK (on_message), loop);
  gst_object_unref (GST_OBJECT (bus));

  if (gst_element_set_state (pipeline,
          GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) {
    g_error ("Failed to go into PLAYING state");
    return -4;
  }

  g_main_loop_run (loop);

  gst_element_set_state (pipeline, GST_STATE_NULL);

  g_main_loop_unref (loop);

  g_object_unref (G_OBJECT (ctrl));
  gst_object_unref (G_OBJECT (pipeline));

  return 0;
}