mediacontrol_structures.h 3.83 KB
Newer Older
1
/*****************************************************************************
2
 * mediacontrol_structures.h: global header for mediacontrol
3
 *****************************************************************************
4
 * Copyright (C) 2005-2008 the VideoLAN team
5
 * $Id$
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 *
 * Authors: Olivier Aubert <olivier.aubert@liris.univ-lyon1.fr>
 *
 * 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 of the License, 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
dionoea's avatar
dionoea committed
21
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22
 *****************************************************************************/
23
24
25
26
27
28

/**
 * \file
 * This file defines libvlc mediacontrol_* data structures
 */

Olivier Aubert's avatar
Olivier Aubert committed
29
30
31
32
33
34
/**
 * \defgroup mediacontrol_structures MediaControl Structures
 * Data structures used in the MediaControl API.
 *
 * @{
 */
35

36
37
#ifndef VLC_CONTROL_STRUCTURES_H
#define VLC_CONTROL_STRUCTURES_H 1
38
39
40
41
42

# ifdef __cplusplus
extern "C" {
# endif

43
44
#include <stdint.h>

Olivier Aubert's avatar
Olivier Aubert committed
45
/**
46
 * A position may have different origins:
Olivier Aubert's avatar
Olivier Aubert committed
47
48
49
50
 *  - absolute counts from the movie start
 *  - relative counts from the current position
 *  - modulo counts from the current position and wraps at the end of the movie
 */
51
typedef enum  {
52
53
54
    mediacontrol_AbsolutePosition,
    mediacontrol_RelativePosition,
    mediacontrol_ModuloPosition
55
56
} mediacontrol_PositionOrigin;

Olivier Aubert's avatar
Olivier Aubert committed
57
58
59
60
61
62
/**
 * Units available in mediacontrol Positions
 *  - ByteCount number of bytes
 *  - SampleCount number of frames
 *  - MediaTime time in milliseconds
 */
63
typedef enum {
64
65
66
    mediacontrol_ByteCount,
    mediacontrol_SampleCount,
    mediacontrol_MediaTime
67
68
} mediacontrol_PositionKey;

Olivier Aubert's avatar
Olivier Aubert committed
69
70
/**
 * Possible player status
71
72
 * Note the order of these enums must match exactly the order of
 * libvlc_state_t and input_state_e enums.
Olivier Aubert's avatar
Olivier Aubert committed
73
74
 */
typedef enum {
75
76
    mediacontrol_UndefinedStatus=0, mediacontrol_InitStatus,
    mediacontrol_BufferingStatus, mediacontrol_PlayingStatus,
77
78
    mediacontrol_PauseStatus,     mediacontrol_StopStatus,
    mediacontrol_EndStatus,       mediacontrol_ErrorStatus,
Olivier Aubert's avatar
Olivier Aubert committed
79
80
} mediacontrol_PlayerStatus;

Olivier Aubert's avatar
Olivier Aubert committed
81
82
83
/**
 * MediaControl Position
 */
84
typedef struct {
85
86
    mediacontrol_PositionOrigin origin;
    mediacontrol_PositionKey key;
87
    int64_t value;
88
89
} mediacontrol_Position;

Olivier Aubert's avatar
Olivier Aubert committed
90
91
92
93
94
95
96
/**
 * RGBPicture structure
 * This generic structure holds a picture in an encoding specified by type.
 */
typedef struct {
    int  width;
    int  height;
97
    uint32_t type;
98
    int64_t date;
Olivier Aubert's avatar
Olivier Aubert committed
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
    int  size;
    char *data;
} mediacontrol_RGBPicture;

/**
 * Playlist sequence
 * A simple list of strings.
 */
typedef struct {
    int size;
    char **data;
} mediacontrol_PlaylistSeq;

typedef struct {
    int code;
    char *message;
} mediacontrol_Exception;

/**
 * Exception codes
 */
#define mediacontrol_PositionKeyNotSupported    1
#define mediacontrol_PositionOriginNotSupported 2
#define mediacontrol_InvalidPosition            3
#define mediacontrol_PlaylistException          4
#define mediacontrol_InternalException          5

/**
 * Stream information
 * This structure allows to quickly get various informations about the stream.
 */
typedef struct {
    mediacontrol_PlayerStatus streamstatus;
    char *url;         /* The URL of the current media stream */
133
134
    int64_t position;  /* actual location in the stream (in ms) */
    int64_t length;    /* total length of the stream (in ms) */
Olivier Aubert's avatar
Olivier Aubert committed
135
136
137
} mediacontrol_StreamInformation;


138
139
140
141
142
# ifdef __cplusplus
}
# endif

#endif
Olivier Aubert's avatar
Olivier Aubert committed
143
144

/** @} */