gst_engine.h 2.77 KB
Newer Older
1
/*
2
 * snappy - 1.0
3
 *
4
 * Copyright (C) 2011-2014 Collabora Ltd.
5
 * 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
#include <gst/gst.h>
27
#include <clutter-gst/clutter-gst.h>
28

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

32 33 34
G_BEGIN_DECLS

typedef struct _GstEngine GstEngine;
35 36 37

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

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

51
  gchar *uri;
52

53
  GstElement *player;
54
  ClutterGstVideoSink *sink;
55

56
  GstBus *bus;
57 58

  GstNavigation *navigation;
59 60 61
};

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

G_END_DECLS
#endif /* __GST_ENGINE_H__ */