summaryrefslogtreecommitdiff
path: root/clutter-gst/clutter-gst-types.h
blob: 337ba093a9b5d88d0d88d7fa2324d52820e24241 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/*
 * Clutter-GStreamer.
 *
 * GStreamer integration library for Clutter.
 *
 * clutter-gst-types.h - Clutter-Gst common types
 *
 * Authored By Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com>
 *
 * Copyright (C) 2011 Intel Corporation
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#if !defined(__CLUTTER_GST_H_INSIDE__) && !defined(CLUTTER_GST_COMPILATION)
#error "Only <clutter-gst/clutter-gst.h> can be included directly."
#endif

#include <cogl/cogl.h>

#ifndef __CLUTTER_GST_TYPES_H__
#define __CLUTTER_GST_TYPES_H__

#define CLUTTER_GST_TYPE_FRAME            (clutter_gst_frame_get_type ())
#define CLUTTER_GST_TYPE_BOX              (clutter_gst_box_get_type ())
#define CLUTTER_GST_TYPE_OVERLAY          (clutter_gst_overlay_get_type ())
#define CLUTTER_GST_TYPE_OVERLAYS         (clutter_gst_overlays_get_type ())

typedef struct _ClutterGstBox             ClutterGstBox;
typedef struct _ClutterGstFrame           ClutterGstFrame;
typedef struct _ClutterGstOverlay         ClutterGstOverlay;
typedef struct _ClutterGstOverlays        ClutterGstOverlays;
typedef struct _ClutterGstVideoResolution ClutterGstVideoResolution;

/**
 * ClutterGstSeekFlags:
 * @CLUTTER_GST_SEEK_FLAG_NONE: Fast seeks (key frame boundaries, default)
 * @CLUTTER_GST_SEEK_FLAG_ACCURATE: Accurate seeks (potentially slower)
 *
 * Flags that can be given to clutter_gst_player_set_seek_flags().
 *
 * Since: 1.4
 */
typedef enum _ClutterGstSeekFlags
{
  CLUTTER_GST_SEEK_FLAG_NONE     = 0,
  CLUTTER_GST_SEEK_FLAG_ACCURATE = 1 << 0
} ClutterGstSeekFlags;

/**
 * ClutterGstBufferingMode:
 * @CLUTTER_GST_BUFFERING_MODE_STREAM: In-memory buffering
 * @CLUTTER_GST_BUFFERING_MODE_DOWNLOAD: On-disk buffering
 *
 * Different buffering policies clutter-gst supports
 *
 * Since: 1.4
 */
typedef enum _ClutterGstBufferingMode
{
  CLUTTER_GST_BUFFERING_MODE_STREAM,
  CLUTTER_GST_BUFFERING_MODE_DOWNLOAD
} ClutterGstBufferingMode;

/**
 * ClutterGstBox:
 * @x1: X coordinate of the top left corner
 * @y1: Y coordinate of the top left corner
 * @x2: X coordinate of the bottom right corner
 * @y2: Y coordinate of the bottom right corner
 *
 * Bounding box of an area in a video texture or actor's allocation.
 * Coordinates are usually expressed in the [0, 1] interval.
 *
 * Since: 3.0
 */
struct _ClutterGstBox
{
  gfloat x1;
  gfloat y1;

  gfloat x2;
  gfloat y2;
};

/**
 * ClutterGstVideoResolution:
 * @width: the width, in pixels
 * @height: the height, in pixels
 *
 * A video resolution.
 *
 * Since: 3.0
 */
struct _ClutterGstVideoResolution
{
  gint width;
  gint height;

  gint par_n;
  gint par_d;
};

/**
 * ClutterGstFrame:
 * @resolution: a #ClutterGstVideoResolution
 * @pipeline: a #CoglPipeline to paint a frame
 *
 * Represents a frame outputted by the #ClutterGstVideoSink.
 *
 * Since: 3.0
 */
struct _ClutterGstFrame
{
  ClutterGstVideoResolution  resolution;
  CoglPipeline              *pipeline;
};

/**
 * ClutterGstOverlay:
 * @position: a #ClutterGstBox representing the position of the
 *            overlay within a #ClutterGstFrame.
 * @pipeline: a #CoglPipeline to paint an overlay
 *
 * Represents a video overlay outputted by the #ClutterGstVideoSink.
 *
 * Since: 3.0
 */
struct _ClutterGstOverlay
{
  ClutterGstBox  position;
  CoglPipeline  *pipeline;
};

/**
 * ClutterGstOverlays:
 * @overlays: an array of #ClutterGstOverlay
 *
 * Since: 3.0
 */
struct _ClutterGstOverlays
{
  GPtrArray *overlays;
};

GType clutter_gst_frame_get_type     (void) G_GNUC_CONST;
GType clutter_gst_box_get_type       (void) G_GNUC_CONST;
GType clutter_gst_overlay_get_type   (void) G_GNUC_CONST;
GType clutter_gst_overlays_get_type  (void) G_GNUC_CONST;

gfloat clutter_gst_box_get_width     (const ClutterGstBox *box);
gfloat clutter_gst_box_get_height    (const ClutterGstBox *box);

#endif /* __CLUTTER_GST_TYPES_H__ */