mediacontrol_structures.h 3.81 KB
Newer Older
1
/*****************************************************************************
2
 * control_structures.h: global header for mediacontrol
3 4
 *****************************************************************************
 * Copyright (C) 2005 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
Antoine Cellerier's avatar
Antoine Cellerier committed
21
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22
 *****************************************************************************/
Olivier Aubert's avatar
Olivier Aubert committed
23 24 25 26 27 28
/**
 * \defgroup mediacontrol_structures MediaControl Structures
 * Data structures used in the MediaControl API.
 *
 * @{
 */
29

30 31
#ifndef VLC_CONTROL_STRUCTURES_H
#define VLC_CONTROL_STRUCTURES_H 1
32 33 34 35 36

# ifdef __cplusplus
extern "C" {
# endif

37 38
#include <stdint.h>

Olivier Aubert's avatar
Olivier Aubert committed
39
/**
40
 * A position may have different origins:
Olivier Aubert's avatar
Olivier Aubert committed
41 42 43 44
 *  - 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
 */
45
typedef enum  {
46 47 48
    mediacontrol_AbsolutePosition,
    mediacontrol_RelativePosition,
    mediacontrol_ModuloPosition
49 50
} mediacontrol_PositionOrigin;

Olivier Aubert's avatar
Olivier Aubert committed
51 52 53 54 55 56
/**
 * Units available in mediacontrol Positions
 *  - ByteCount number of bytes
 *  - SampleCount number of frames
 *  - MediaTime time in milliseconds
 */
57
typedef enum {
58 59 60
    mediacontrol_ByteCount,
    mediacontrol_SampleCount,
    mediacontrol_MediaTime
61 62
} mediacontrol_PositionKey;

Olivier Aubert's avatar
Olivier Aubert committed
63 64
/**
 * Possible player status
65 66
 * 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
67 68
 */
typedef enum {
69 70
    mediacontrol_UndefinedStatus=0, mediacontrol_InitStatus,
    mediacontrol_BufferingStatus, mediacontrol_PlayingStatus,
71
    mediacontrol_PauseStatus,     mediacontrol_StopStatus,
72
    mediacontrol_ForwardStatus,   mediacontrol_BackwardStatus,
73
    mediacontrol_EndStatus,       mediacontrol_ErrorStatus,
Olivier Aubert's avatar
Olivier Aubert committed
74 75
} mediacontrol_PlayerStatus;

Olivier Aubert's avatar
Olivier Aubert committed
76 77 78
/**
 * MediaControl Position
 */
79
typedef struct {
80 81
    mediacontrol_PositionOrigin origin;
    mediacontrol_PositionKey key;
82
    int64_t value;
83 84
} mediacontrol_Position;

Olivier Aubert's avatar
Olivier Aubert committed
85 86 87 88 89 90 91
/**
 * RGBPicture structure
 * This generic structure holds a picture in an encoding specified by type.
 */
typedef struct {
    int  width;
    int  height;
92
    uint32_t type;
93
    int64_t date;
Olivier Aubert's avatar
Olivier Aubert committed
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
    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 */
128 129
    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
130 131 132
} mediacontrol_StreamInformation;


133 134 135 136 137
# ifdef __cplusplus
}
# endif

#endif
Olivier Aubert's avatar
Olivier Aubert committed
138 139

/** @} */