gst_engine.h 2.71 KB
Newer Older
1
/*
2
 * snappy - 0.3
3
 *
4 5
 * Copyright (C) 2011-2013 Collabora Ltd.
 * Luis de Bethencourt <luis@debethencourt.com>
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
 * USA
 */

#ifndef __GST_ENGINE_H__
#define __GST_ENGINE_H__

26 27
#include <gst/gst.h>

28
/* GStreamer Interfaces */
29
#include <gst/video/navigation.h>
30

31 32 33
G_BEGIN_DECLS

typedef struct _GstEngine GstEngine;
34 35 36

struct _GstEngine
{
37
  gboolean playing, direction_foward, prev_done;
38 39
  gboolean has_started;
  gboolean has_video, has_audio;
40
  gboolean loop;
41
  gboolean secret;
42
  gboolean queries_blocked;
43 44

  guint media_width, media_height;
45
  gint64 media_duration;
46
  gint64 second;
47
  gint64 av_offset;
48
  gdouble rate;
49

50
  gchar *uri;
51

52 53
  GstElement *player;
  GstElement *sink;
54

55
  GstBus *bus;
56 57

  GstNavigation *navigation;
58 59 60
};

// Declaration of non-static functions
61 62
gboolean add_uri_unfinished (GstEngine * engine);
gboolean at_the_eos (GstEngine * engine);
63
gboolean bus_call (GstBus * bus, GstMessage * msg, gpointer data);
64
gboolean change_state (GstEngine * engine, gchar * state);
65
gboolean check_missing_plugins_error (GstEngine * engine, GstMessage * msg);
66
gboolean cycle_streams (GstEngine * engine, guint streamid);
67
gboolean engine_init (GstEngine * engine, GstElement * sink);
68
gboolean engine_change_offset (GstEngine * engine, gint64 av_offest);
69
gboolean engine_change_speed (GstEngine * engine, gdouble rate);
70 71
void engine_load_uri (GstEngine * engine, gchar * uri);
void engine_open_uri (GstEngine * engine, gchar * uri);
72
gboolean engine_play (GstEngine * engine);
73
gboolean engine_seek (GstEngine * engine, gint64 position, gboolean accurate);
74
gboolean engine_stop (GstEngine * engine);
75
void engine_volume (GstEngine * engine, gdouble level);
76
gboolean frame_stepping (GstEngine * engine, gboolean foward);
77
gchar **get_recently_viewed ();
78
GstState get_state (GstEngine * engine);
79
gboolean has_subtitles (GstEngine * engine);
80
gint64 query_position (GstEngine * engine);
81
void set_subtitle_uri (GstEngine * engine, gchar *suburi);
82
gboolean toggle_subtitles (GstEngine * engine);
83
gboolean update_media_duration (GstEngine * engine);
84 85 86

G_END_DECLS
#endif /* __GST_ENGINE_H__ */