summaryrefslogtreecommitdiff
path: root/clutter-gst/clutter-gst-types.h
blob: 8a381066c64587b33d613ebe9f88cf880d279b28 (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
/*
 * 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 ())

typedef struct _ClutterGstBox             ClutterGstBox;
typedef struct _ClutterGstFrame           ClutterGstFrame;
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;

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

  gint par_n;
  gint par_d;
};

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


/**
 * 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.
 */
struct _ClutterGstBox
{
  gfloat x1;
  gfloat y1;

  gfloat x2;
  gfloat y2;
};


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

#endif /* __CLUTTER_GST_TYPES_H__ */