]> git.sesse.net Git - vlc/blob - include/vlc/mediacontrol_structures.h
Cosmetic
[vlc] / include / vlc / 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_ForwardStatus,   mediacontrol_BackwardStatus,
79     mediacontrol_EndStatus,       mediacontrol_ErrorStatus,
80 } mediacontrol_PlayerStatus;
81
82 /**
83  * MediaControl Position
84  */
85 typedef struct {
86     mediacontrol_PositionOrigin origin;
87     mediacontrol_PositionKey key;
88     int64_t value;
89 } mediacontrol_Position;
90
91 /**
92  * RGBPicture structure
93  * This generic structure holds a picture in an encoding specified by type.
94  */
95 typedef struct {
96     int  width;
97     int  height;
98     uint32_t type;
99     int64_t date;
100     int  size;
101     char *data;
102 } mediacontrol_RGBPicture;
103
104 /**
105  * Playlist sequence
106  * A simple list of strings.
107  */
108 typedef struct {
109     int size;
110     char **data;
111 } mediacontrol_PlaylistSeq;
112
113 typedef struct {
114     int code;
115     char *message;
116 } mediacontrol_Exception;
117
118 /**
119  * Exception codes
120  */
121 #define mediacontrol_PositionKeyNotSupported    1
122 #define mediacontrol_PositionOriginNotSupported 2
123 #define mediacontrol_InvalidPosition            3
124 #define mediacontrol_PlaylistException          4
125 #define mediacontrol_InternalException          5
126
127 /**
128  * Stream information
129  * This structure allows to quickly get various informations about the stream.
130  */
131 typedef struct {
132     mediacontrol_PlayerStatus streamstatus;
133     char *url;         /* The URL of the current media stream */
134     int64_t position;  /* actual location in the stream (in ms) */
135     int64_t length;    /* total length of the stream (in ms) */
136 } mediacontrol_StreamInformation;
137
138
139 # ifdef __cplusplus
140 }
141 # endif
142
143 #endif
144
145 /** @} */