Example #1
0
static void
native_play (JNIEnv * env, jobject thiz)
{
  Player *player = GET_CUSTOM_DATA (env, thiz, native_player_field_id);

  if (!player)
    return;

  gst_player_play (player->player);
}
Example #2
0
static void
toggle_paused (GstPlay * play)
{
  if (play->desired_state == GST_STATE_PLAYING) {
    play->desired_state = GST_STATE_PAUSED;
    gst_player_pause (play->player);
  } else {
    play->desired_state = GST_STATE_PLAYING;
    gst_player_play (play->player);
  }
}
Example #3
0
static void
play_uri (GstPlay * play, const gchar * next_uri)
{
  gchar *loc;

  play_reset (play);

  loc = play_uri_get_display_name (play, next_uri);
  g_print ("Now playing %s\n", loc);
  g_free (loc);

  g_object_set (play->player, "uri", next_uri, NULL);
  gst_player_play (play->player);
}
Example #4
0
gboolean
ges_playable_play (GESPlayable *playable)
{
  GstPlayer *player;
  GMainLoop *loop = g_main_loop_new (NULL, FALSE);

  player = ges_playable_make_player (playable);
  g_signal_connect (player, "error", G_CALLBACK (_on_error_cb), loop);
  g_signal_connect (player, "end-of-stream", G_CALLBACK (_on_eos_cb), loop);
  gst_player_play (player);

  g_main_loop_run (loop);
  g_main_loop_unref (loop);

  g_object_unref (player);

  return TRUE;
}