]> git.sesse.net Git - vlc/blob - bindings/mediacontrol/mediacontrol_structures.h
s/informations/information/
[vlc] / bindings / mediacontrol / mediacontrol_structures.h
1 /*****************************************************************************
2  * mediacontrol_structures.h: global header for mediacontrol
3  *****************************************************************************
4  * Copyright (C) 2005-2008 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Olivier Aubert <olivier.aubert@liris.univ-lyon1.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 /**
25  * \file
26  * This file defines libvlc mediacontrol_* data structures
27  */
28
29 /**
30  * \defgroup mediacontrol_structures MediaControl Structures
31  * Data structures used in the MediaControl API.
32  *
33  * @{
34  */
35
36 #ifndef VLC_CONTROL_STRUCTURES_H
37 #define VLC_CONTROL_STRUCTURES_H 1
38
39 # ifdef __cplusplus
40 extern "C" {
41 # endif
42
43 #include <stdint.h>
44
45 /**
46  * A position may have different origins:
47  *  - absolute counts from the movie start
48  *  - relative counts from the current position
49  *  - modulo counts from the current position and wraps at the end of the movie
50  */
51 typedef enum  {
52     mediacontrol_AbsolutePosition,
53     mediacontrol_RelativePosition,
54     mediacontrol_ModuloPosition
55 } mediacontrol_PositionOrigin;
56
57 /**
58  * Units available in mediacontrol Positions
59  *  - ByteCount number of bytes
60  *  - SampleCount number of frames
61  *  - MediaTime time in milliseconds
62  */
63 typedef enum {
64     mediacontrol_ByteCount,
65     mediacontrol_SampleCount,
66     mediacontrol_MediaTime
67 } mediacontrol_PositionKey;
68
69 /**
70  * Possible player status
71  * Note the order of these enums must match exactly the order of
72  * libvlc_state_t and input_state_e enums.
73  */
74 typedef enum {
75     mediacontrol_UndefinedStatus=0, mediacontrol_InitStatus,
76     mediacontrol_BufferingStatus, mediacontrol_PlayingStatus,
77     mediacontrol_PauseStatus,     mediacontrol_StopStatus,
78     mediacontrol_EndStatus,       mediacontrol_ErrorStatus,
79 } mediacontrol_PlayerStatus;
80
81 /**
82  * MediaControl Position
83  */
84 typedef struct {
85     mediacontrol_PositionOrigin origin;
86     mediacontrol_PositionKey key;
87     int64_t value;
88 } mediacontrol_Position;
89
90 /**
91  * RGBPicture structure
92  * This generic structure holds a picture in an encoding specified by type.
93  */
94 typedef struct {
95     int  width;
96     int  height;
97     uint32_t type;
98     int64_t date;
99     int  size;
100     char *data;
101 } mediacontrol_RGBPicture;
102
103 /**
104  * Playlist sequence
105  * A simple list of strings.
106  */
107 typedef struct {
108     int size;
109     char **data;
110 } mediacontrol_PlaylistSeq;
111
112 typedef struct {
113     int code;
114     char *message;
115 } mediacontrol_Exception;
116
117 /**
118  * Exception codes
119  */
120 #define mediacontrol_PositionKeyNotSupported    1
121 #define mediacontrol_PositionOriginNotSupported 2
122 #define mediacontrol_InvalidPosition            3
123 #define mediacontrol_PlaylistException          4
124 #define mediacontrol_InternalException          5
125
126 /**
127  * Stream information
128  * This structure allows to quickly get various information about the stream.
129  */
130 typedef struct {
131     mediacontrol_PlayerStatus streamstatus;
132     char *url;         /* The URL of the current media stream */
133     int64_t position;  /* actual location in the stream (in ms) */
134     int64_t length;    /* total length of the stream (in ms) */
135 } mediacontrol_StreamInformation;
136
137
138 # ifdef __cplusplus
139 }
140 # endif
141
142 #endif
143
144 /** @} */