summaryrefslogtreecommitdiffstats
path: root/win32/vlc/mediacontrol_structures.h
blob: 6a3748276664ddd6c649cda61bc1dd308b65bb97 (plain) (blame)
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
/*****************************************************************************
 * mediacontrol_structures.h: global header for mediacontrol
 *****************************************************************************
 * Copyright (C) 2005-2008 the VideoLAN team
 * $Id$
 *
 * 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
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

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

/**
 * \defgroup mediacontrol_structures MediaControl Structures
 * Data structures used in the MediaControl API.
 *
 * @{
 */

#ifndef VLC_CONTROL_STRUCTURES_H
#define VLC_CONTROL_STRUCTURES_H 1

# ifdef __cplusplus
extern "C" {
# endif

#include <stdint.h>

/**
 * A position may have different origins:
 *  - 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
 */
typedef enum  {
    mediacontrol_AbsolutePosition,
    mediacontrol_RelativePosition,
    mediacontrol_ModuloPosition
} mediacontrol_PositionOrigin;

/**
 * Units available in mediacontrol Positions
 *  - ByteCount number of bytes
 *  - SampleCount number of frames
 *  - MediaTime time in milliseconds
 */
typedef enum {
    mediacontrol_ByteCount,
    mediacontrol_SampleCount,
    mediacontrol_MediaTime
} mediacontrol_PositionKey;

/**
 * Possible player status
 * Note the order of these enums must match exactly the order of
 * libvlc_state_t and input_state_e enums.
 */
typedef enum {
    mediacontrol_UndefinedStatus=0, mediacontrol_InitStatus,
    mediacontrol_BufferingStatus, mediacontrol_PlayingStatus,
    mediacontrol_PauseStatus,     mediacontrol_StopStatus,
    mediacontrol_EndStatus,       mediacontrol_ErrorStatus,
} mediacontrol_PlayerStatus;

/**
 * MediaControl Position
 */
typedef struct {
    mediacontrol_PositionOrigin origin;
    mediacontrol_PositionKey key;
    int64_t value;
} mediacontrol_Position;

/**
 * RGBPicture structure
 * This generic structure holds a picture in an encoding specified by type.
 */
typedef struct {
    int  width;
    int  height;
    uint32_t type;
    int64_t date;
    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 */
    int64_t position;  /* actual location in the stream (in ms) */
    int64_t length;    /* total length of the stream (in ms) */
} mediacontrol_StreamInformation;


# ifdef __cplusplus
}
# endif

#endif

/** @} */