libplayer  2.0.1
player.h
Go to the documentation of this file.
1 /*
2  * GeeXboX libplayer: a multimedia A/V abstraction layer API.
3  * Copyright (C) 2006-2008 Benjamin Zores <ben@geexbox.org>
4  * Copyright (C) 2007-2008 Mathieu Schroeter <mathieu.schroeter@gamesover.ch>
5  *
6  * This file is part of libplayer.
7  *
8  * libplayer is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * libplayer is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with libplayer; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #ifndef PLAYER_H
24 #define PLAYER_H
25 
55 #ifdef __cplusplus
56 extern "C" {
57 #if 0 /* avoid EMACS indent */
58 }
59 #endif /* 0 */
60 #endif /* __cplusplus */
61 
62 #ifndef pl_unused
63 #if defined(__GNUC__)
64 # define pl_unused __attribute__((unused))
65 #else
66 # define pl_unused
67 #endif
68 #endif
69 
70 #define PL_STRINGIFY(s) #s
71 #define PL_TOSTRING(s) PL_STRINGIFY(s)
72 
73 #define PL_VERSION_INT(a, b, c) (a << 16 | b << 8 | c)
74 #define PL_VERSION_DOT(a, b, c) a ##.## b ##.## c
75 #define PL_VERSION(a, b, c) PL_VERSION_DOT(a, b, c)
76 
77 #define LIBPLAYER_VERSION_MAJOR 2
78 #define LIBPLAYER_VERSION_MINOR 0
79 #define LIBPLAYER_VERSION_MICRO 1
80 
81 #define LIBPLAYER_VERSION_INT PL_VERSION_INT(LIBPLAYER_VERSION_MAJOR, \
82  LIBPLAYER_VERSION_MINOR, \
83  LIBPLAYER_VERSION_MICRO)
84 #define LIBPLAYER_VERSION PL_VERSION(LIBPLAYER_VERSION_MAJOR, \
85  LIBPLAYER_VERSION_MINOR, \
86  LIBPLAYER_VERSION_MICRO)
87 #define LIBPLAYER_VERSION_STR PL_TOSTRING(LIBPLAYER_VERSION)
88 #define LIBPLAYER_BUILD LIBPLAYER_VERSION_INT
89 
90 #include <inttypes.h>
91 #include <sys/types.h>
92 
96 unsigned int libplayer_version (void);
97 
98 
99 /***************************************************************************/
100 /* */
101 /* Player (Un)Initialization */
102 /* Mandatory for all operations below */
103 /* */
104 /***************************************************************************/
105 
111 typedef struct player_s player_t;
112 
114 typedef enum player_type {
115  PLAYER_TYPE_XINE,
116  PLAYER_TYPE_MPLAYER,
117  PLAYER_TYPE_VLC,
118  PLAYER_TYPE_GSTREAMER,
119  PLAYER_TYPE_DUMMY
120 } player_type_t;
121 
123 typedef enum player_vo {
124  PLAYER_VO_AUTO = 0,
125  PLAYER_VO_NULL,
126  PLAYER_VO_X11,
127  PLAYER_VO_X11_SDL,
128  PLAYER_VO_XV,
129  PLAYER_VO_GL,
130  PLAYER_VO_FB,
131  PLAYER_VO_DIRECTFB,
132  PLAYER_VO_VDPAU,
133  PLAYER_VO_VAAPI,
134 } player_vo_t;
135 
137 typedef enum player_ao {
138  PLAYER_AO_AUTO = 0,
139  PLAYER_AO_NULL,
140  PLAYER_AO_ALSA,
141  PLAYER_AO_OSS,
142  PLAYER_AO_PULSE,
143 } player_ao_t;
144 
146 typedef enum player_event {
147  PLAYER_EVENT_UNKNOWN,
148  PLAYER_EVENT_PLAYBACK_START,
149  PLAYER_EVENT_PLAYBACK_STOP,
150  PLAYER_EVENT_PLAYBACK_FINISHED,
151  PLAYER_EVENT_PLAYLIST_FINISHED,
152  PLAYER_EVENT_PLAYBACK_PAUSE,
153  PLAYER_EVENT_PLAYBACK_UNPAUSE,
155 
157 typedef enum {
158  PLAYER_MSG_NONE, /* no error messages */
159  PLAYER_MSG_VERBOSE, /* super-verbose mode: mostly for debugging */
160  PLAYER_MSG_INFO, /* working operations */
161  PLAYER_MSG_WARNING, /* harmless failures */
162  PLAYER_MSG_ERROR, /* may result in hazardous behavior */
163  PLAYER_MSG_CRITICAL, /* prevents lib from working */
165 
166 typedef enum {
167  PLAYER_QUALITY_NORMAL, /* normal picture quality */
168  PLAYER_QUALITY_LOW, /* slightly degraded picture for fastest playback */
169  PLAYER_QUALITY_LOWEST, /* degraded picture, suitable for low-end CPU */
170 } player_quality_level_t;
171 
173 typedef struct player_init_param_s {
179  uint32_t winid;
180 
182  int (*event_cb) (player_event_t e, void *data);
184  void *data;
185 
193  const char *display;
194 
196  player_quality_level_t quality;
197 
199 
226  player_init_param_t *param);
227 
239 void player_uninit (player_t *player);
240 
252 
257 /***************************************************************************/
258 /* */
259 /* Media Resource Locater (MRL) Helpers */
260 /* MRLs can have multiple types and are used to define a stream */
261 /* */
262 /***************************************************************************/
263 
269 typedef struct mrl_s mrl_t;
270 
272 typedef enum mrl_type {
273  MRL_TYPE_UNKNOWN,
274  MRL_TYPE_AUDIO,
275  MRL_TYPE_VIDEO,
276  MRL_TYPE_IMAGE,
277 } mrl_type_t;
278 
279 /*
280  * Support by wrappers
281  *
282  * GStreamer MPlayer VLC xine
283  * ------------ ------------ ------------ ------------
284  */
286 typedef enum mrl_resource {
287  MRL_RESOURCE_UNKNOWN,
288 
289  /* Local Streams */
290  MRL_RESOURCE_FIFO, /* NO NO NO NO */
291  MRL_RESOURCE_FILE, /* YES YES YES YES */
292  MRL_RESOURCE_STDIN, /* NO NO NO NO */
293 
294  /* Audio CD */
295  MRL_RESOURCE_CDDA, /* NO YES NO NO */
296  MRL_RESOURCE_CDDB, /* NO YES NO NO */
297 
298  /* Video discs */
299  MRL_RESOURCE_DVD, /* NO YES YES YES */
300  MRL_RESOURCE_DVDNAV, /* NO YES YES YES */
301  MRL_RESOURCE_VCD, /* NO YES NO NO */
302 
303  /* Radio/Television */
304  MRL_RESOURCE_DVB, /* NO YES NO NO */
305  MRL_RESOURCE_PVR, /* NO NO NO NO */
306  MRL_RESOURCE_RADIO, /* NO YES NO NO */
307  MRL_RESOURCE_TV, /* NO YES NO NO */
308  MRL_RESOURCE_VDR, /* NO NO NO YES */
309 
310  /* Network Streams */
311  MRL_RESOURCE_FTP, /* NO YES YES NO */
312  MRL_RESOURCE_HTTP, /* NO YES YES YES */
313  MRL_RESOURCE_MMS, /* NO YES YES YES */
314  MRL_RESOURCE_NETVDR, /* NO NO NO YES */
315  MRL_RESOURCE_RTP, /* NO YES YES YES */
316  MRL_RESOURCE_RTSP, /* NO YES YES NO */
317  MRL_RESOURCE_SMB, /* NO YES YES NO */
318  MRL_RESOURCE_TCP, /* NO NO NO YES */
319  MRL_RESOURCE_UDP, /* NO YES YES YES */
320  MRL_RESOURCE_UNSV, /* NO YES YES NO */
322 
324 typedef struct mrl_resource_local_args_s {
325  char *location; /* YES YES YES YES */
326  int playlist; /* NO NO NO NO */
328 
330 typedef struct mrl_resource_cd_args_s {
331  char *device; /* NO YES NO NO */
332  uint8_t speed; /* NO YES NO NO */
333  uint8_t track_start; /* NO YES NO NO */
334  uint8_t track_end; /* NO YES NO NO */
336 
338 typedef struct mrl_resource_videodisc_args_s {
339  char *device; /* NO YES YES YES */
340  uint8_t speed; /* NO NO NO NO */
341  uint8_t angle; /* NO YES YES NO */
342  uint8_t title_start; /* NO YES YES YES */
343  uint8_t title_end; /* NO YES NO NO */
344  uint8_t chapter_start; /* NO NO YES NO */
345  uint8_t chapter_end; /* NO NO NO NO */
346  uint8_t track_start; /* NO YES NO NO */
347  uint8_t track_end; /* NO NO NO NO */
348  char *audio_lang; /* NO NO NO NO */
349  char *sub_lang; /* NO NO NO NO */
350  uint8_t sub_cc; /* NO NO NO NO */
352 
354 typedef struct mrl_resource_tv_args_s {
355  char *device; /* NO NO NO YES */
356  char *driver; /* NO NO NO YES */
357  char *channel; /* NO YES NO NO */
358  uint8_t input; /* NO YES NO NO */
359  int width; /* NO NO NO NO */
360  int height; /* NO NO NO NO */
361  int fps; /* NO NO NO NO */
362  char *output_format; /* NO NO NO NO */
363  char *norm; /* NO YES NO NO */
365 
367 typedef struct mrl_resource_network_args_s {
368  char *url; /* NO YES NO YES */
369  char *username; /* NO YES NO NO */
370  char *password; /* NO YES NO NO */
371  char *user_agent; /* NO NO NO NO */
373 
375 typedef enum mrl_snapshot {
376  MRL_SNAPSHOT_JPG, /* NO YES NO NO */
377  MRL_SNAPSHOT_PNG, /* NO YES NO NO */
378  MRL_SNAPSHOT_PPM, /* NO YES NO NO */
379  MRL_SNAPSHOT_TGA, /* NO NO NO NO */
381 
383 typedef enum mrl_metadata_type {
384  MRL_METADATA_TITLE,
385  MRL_METADATA_ARTIST,
386  MRL_METADATA_GENRE,
387  MRL_METADATA_ALBUM,
388  MRL_METADATA_YEAR,
389  MRL_METADATA_TRACK,
390  MRL_METADATA_COMMENT,
392 
394 typedef enum mrl_metadata_cd_type {
395  MRL_METADATA_CD_DISCID,
396  MRL_METADATA_CD_TRACKS,
398 
400 typedef enum mrl_metadata_dvd_type {
401  MRL_METADATA_DVD_TITLE_CHAPTERS,
402  MRL_METADATA_DVD_TITLE_ANGLES,
403  MRL_METADATA_DVD_TITLE_LENGTH,
405 
407 typedef enum mrl_properties_type {
408  MRL_PROPERTY_SEEKABLE,
409  MRL_PROPERTY_LENGTH,
410  MRL_PROPERTY_AUDIO_BITRATE,
411  MRL_PROPERTY_AUDIO_BITS,
412  MRL_PROPERTY_AUDIO_CHANNELS,
413  MRL_PROPERTY_AUDIO_SAMPLERATE,
414  MRL_PROPERTY_VIDEO_BITRATE,
415  MRL_PROPERTY_VIDEO_WIDTH,
416  MRL_PROPERTY_VIDEO_HEIGHT,
417  MRL_PROPERTY_VIDEO_ASPECT,
418  MRL_PROPERTY_VIDEO_CHANNELS,
419  MRL_PROPERTY_VIDEO_STREAMS,
420  MRL_PROPERTY_VIDEO_FRAMEDURATION,
422 
423 #define PLAYER_VIDEO_ASPECT_RATIO_MULT 10000.0 /* *10000 */
424 #define PLAYER_VIDEO_FRAMEDURATION_RATIO_DIV 90000.0 /* 1/90000 sec */
425 
446 mrl_t *mrl_new (player_t *player, mrl_resource_t res, void *args);
447 
456 void mrl_add_subtitle (player_t *player, mrl_t *mrl, char *subtitle);
457 
469 void mrl_free (player_t *player, mrl_t *mrl);
470 
479 mrl_type_t mrl_get_type (player_t *player, mrl_t *mrl);
480 
490 
506 char *mrl_get_metadata (player_t *player, mrl_t *mrl, mrl_metadata_type_t m);
507 
524 char *mrl_get_metadata_cd_track (player_t *player,
525  mrl_t *mrl, int trackid, uint32_t *length);
526 
541 uint32_t mrl_get_metadata_cd (player_t *player,
542  mrl_t *mrl, mrl_metadata_cd_type_t m);
543 
559 uint32_t mrl_get_metadata_dvd_title (player_t *player, mrl_t *mrl,
560  int titleid, mrl_metadata_dvd_type_t m);
561 
577 char *mrl_get_metadata_dvd (player_t *player, mrl_t *mrl, uint8_t *titles);
578 
601 int mrl_get_metadata_subtitle (player_t *player, mrl_t *mrl, int pos,
602  uint32_t *id, char **name, char **lang);
603 
617 uint32_t mrl_get_metadata_subtitle_nb (player_t *player, mrl_t *mrl);
618 
641 int mrl_get_metadata_audio (player_t *player, mrl_t *mrl, int pos,
642  uint32_t *id, char **name, char **lang);
643 
657 uint32_t mrl_get_metadata_audio_nb (player_t *player, mrl_t *mrl);
658 
671 uint32_t mrl_get_property (player_t *player,
672  mrl_t *mrl, mrl_properties_type_t p);
673 
686 char *mrl_get_audio_codec (player_t *player, mrl_t *mrl);
687 
700 char *mrl_get_video_codec (player_t *player, mrl_t *mrl);
701 
713 off_t mrl_get_size (player_t *player, mrl_t *mrl);
714 
731 void mrl_video_snapshot (player_t *player, mrl_t *mrl,
732  int pos, mrl_snapshot_t t, const char *dst);
733 
738 /***************************************************************************/
739 /* */
740 /* Player to MRL connection */
741 /* */
742 /***************************************************************************/
743 
745 typedef enum player_mrl_add {
746  PLAYER_MRL_ADD_NOW,
747  PLAYER_MRL_ADD_QUEUE
749 
763 
774 void player_mrl_set (player_t *player, mrl_t *mrl);
775 
784 void player_mrl_append (player_t *player, mrl_t *mrl, player_mrl_add_t when);
785 
794 void player_mrl_remove (player_t *player);
795 
804 void player_mrl_remove_all (player_t *player);
805 
814 void player_mrl_previous (player_t *player);
815 
824 void player_mrl_next (player_t *player);
825 
835 void player_mrl_continue (player_t *player);
836 
841 /***************************************************************************/
842 /* */
843 /* Player tuning & properties */
844 /* */
845 /***************************************************************************/
846 
848 typedef enum player_pb {
849  PLAYER_PB_SINGLE = 0,
850  PLAYER_PB_AUTO,
851 } player_pb_t;
852 
854 typedef enum player_loop {
855  PLAYER_LOOP_DISABLE = 0,
856  PLAYER_LOOP_ELEMENT,
857  PLAYER_LOOP_PLAYLIST,
858 } player_loop_t;
859 
861 typedef enum player_framedrop {
862  PLAYER_FRAMEDROP_DISABLE,
863  PLAYER_FRAMEDROP_SOFT,
864  PLAYER_FRAMEDROP_HARD,
866 
868 typedef enum player_x_window_flags {
869  PLAYER_X_WINDOW_AUTO = 0,
870  PLAYER_X_WINDOW_X = (1 << 0),
871  PLAYER_X_WINDOW_Y = (1 << 1),
872  PLAYER_X_WINDOW_W = (1 << 2),
873  PLAYER_X_WINDOW_H = (1 << 3),
875 
891 int player_get_time_pos (player_t *player);
892 
903 int player_get_percent_pos (player_t *player);
904 
916 void player_set_playback (player_t *player, player_pb_t pb);
917 
928 void player_set_loop (player_t *player, player_loop_t loop, int value);
929 
939 void player_set_shuffle (player_t *player, int value);
940 
952 
968 void player_set_mouse_position (player_t *player, int x, int y);
969 
988  int x, int y, int w, int h, int flags);
989 
1006 void player_osd_show_text (player_t *player,
1007  const char *text, int x, int y, int duration);
1008 
1022 void player_osd_state (player_t *player, int value);
1023 
1028 /***************************************************************************/
1029 /* */
1030 /* Playback related controls */
1031 /* */
1032 /***************************************************************************/
1033 
1035 typedef enum player_pb_state {
1036  PLAYER_PB_STATE_IDLE,
1037  PLAYER_PB_STATE_PAUSE,
1038  PLAYER_PB_STATE_PLAY,
1040 
1042 typedef enum player_pb_seek {
1043  PLAYER_PB_SEEK_RELATIVE,
1044  PLAYER_PB_SEEK_ABSOLUTE,
1045  PLAYER_PB_SEEK_PERCENT,
1047 
1061 
1073 void player_playback_start (player_t *player);
1074 
1084 void player_playback_stop (player_t *player);
1085 
1095 void player_playback_pause (player_t *player);
1096 
1108 void player_playback_seek (player_t *player, int value, player_pb_seek_t seek);
1109 
1121 void player_playback_seek_chapter (player_t *player, int value, int absolute);
1122 
1135 void player_playback_speed (player_t *player, float value);
1136 
1141 /***************************************************************************/
1142 /* */
1143 /* Audio related controls */
1144 /* */
1145 /***************************************************************************/
1146 
1148 typedef enum player_mute {
1149  PLAYER_MUTE_UNKNOWN,
1150  PLAYER_MUTE_ON,
1151  PLAYER_MUTE_OFF
1152 } player_mute_t;
1153 
1169 int player_audio_volume_get (player_t *player);
1170 
1181 void player_audio_volume_set (player_t *player, int value);
1182 
1194 
1205 void player_audio_mute_set (player_t *player, player_mute_t value);
1206 
1220 void player_audio_set_delay (player_t *player, int value, int absolute);
1221 
1232 void player_audio_select (player_t *player, int audio_id);
1233 
1245 void player_audio_prev (player_t *player);
1246 
1258 void player_audio_next (player_t *player);
1259 
1264 /***************************************************************************/
1265 /* */
1266 /* Video related controls */
1267 /* */
1268 /***************************************************************************/
1269 
1271 typedef enum player_video_aspect {
1272  PLAYER_VIDEO_ASPECT_BRIGHTNESS,
1273  PLAYER_VIDEO_ASPECT_CONTRAST,
1274  PLAYER_VIDEO_ASPECT_GAMMA,
1275  PLAYER_VIDEO_ASPECT_HUE,
1276  PLAYER_VIDEO_ASPECT_SATURATION,
1278 
1297  int8_t value, int absolute);
1298 
1310 void player_video_set_panscan (player_t *player, int8_t value, int absolute);
1311 
1322 void player_video_set_aspect_ratio (player_t *player, float value);
1323 
1328 /***************************************************************************/
1329 /* */
1330 /* Subtitles related controls */
1331 /* */
1332 /***************************************************************************/
1333 
1335 typedef enum player_sub_alignment {
1336  PLAYER_SUB_ALIGNMENT_TOP,
1337  PLAYER_SUB_ALIGNMENT_CENTER,
1338  PLAYER_SUB_ALIGNMENT_BOTTOM,
1340 
1359 void player_subtitle_set_delay (player_t *player, int value);
1360 
1373 
1384 void player_subtitle_set_position (player_t *player, int value);
1385 
1396 void player_subtitle_set_visibility (player_t *player, int value);
1397 
1409 void player_subtitle_scale (player_t *player, int value, int absolute);
1410 
1421 void player_subtitle_select (player_t *player, int sub_id);
1422 
1434 void player_subtitle_prev (player_t *player);
1435 
1447 void player_subtitle_next (player_t *player);
1448 
1453 /***************************************************************************/
1454 /* */
1455 /* DVD specific controls */
1456 /* */
1457 /***************************************************************************/
1458 
1460 typedef enum player_dvdnav {
1461  PLAYER_DVDNAV_UP,
1462  PLAYER_DVDNAV_DOWN,
1463  PLAYER_DVDNAV_RIGHT,
1464  PLAYER_DVDNAV_LEFT,
1465  PLAYER_DVDNAV_MENU,
1466  PLAYER_DVDNAV_SELECT,
1467  PLAYER_DVDNAV_PREVMENU,
1468  PLAYER_DVDNAV_MOUSECLICK,
1469 } player_dvdnav_t;
1470 
1486 void player_dvd_nav (player_t *player, player_dvdnav_t value);
1487 
1498 void player_dvd_angle_select (player_t *player, int angle);
1499 
1511 void player_dvd_angle_prev (player_t *player);
1512 
1524 void player_dvd_angle_next (player_t *player);
1525 
1536 void player_dvd_title_select (player_t *player, int title);
1537 
1549 void player_dvd_title_prev (player_t *player);
1550 
1562 void player_dvd_title_next (player_t *player);
1563 
1568 /***************************************************************************/
1569 /* */
1570 /* TV/DVB specific controls */
1571 /* */
1572 /***************************************************************************/
1573 
1589 void player_tv_channel_select (player_t *player, const char *channel);
1590 
1602 void player_tv_channel_prev (player_t *player);
1603 
1615 void player_tv_channel_next (player_t *player);
1616 
1621 /***************************************************************************/
1622 /* */
1623 /* Radio specific controls */
1624 /* */
1625 /***************************************************************************/
1626 
1642 void player_radio_channel_select (player_t *player, const char *channel);
1643 
1655 void player_radio_channel_prev (player_t *player);
1656 
1668 void player_radio_channel_next (player_t *player);
1669 
1674 /***************************************************************************/
1675 /* */
1676 /* VDR specific controls */
1677 /* */
1678 /***************************************************************************/
1679 
1681 typedef enum player_vdr {
1682  PLAYER_VDR_UP = 0,
1683  PLAYER_VDR_DOWN,
1684  PLAYER_VDR_LEFT,
1685  PLAYER_VDR_RIGHT,
1686  PLAYER_VDR_OK,
1687  PLAYER_VDR_BACK,
1688  PLAYER_VDR_CHANNELPLUS,
1689  PLAYER_VDR_CHANNELMINUS,
1690  PLAYER_VDR_RED,
1691  PLAYER_VDR_GREEN,
1692  PLAYER_VDR_YELLOW,
1693  PLAYER_VDR_BLUE,
1694  PLAYER_VDR_PLAY,
1695  PLAYER_VDR_PAUSE,
1696  PLAYER_VDR_STOP,
1697  PLAYER_VDR_RECORD,
1698  PLAYER_VDR_FASTFWD,
1699  PLAYER_VDR_FASTREW,
1700  PLAYER_VDR_POWER,
1701  PLAYER_VDR_SCHEDULE,
1702  PLAYER_VDR_CHANNELS,
1703  PLAYER_VDR_TIMERS,
1704  PLAYER_VDR_RECORDINGS,
1705  PLAYER_VDR_MENU,
1706  PLAYER_VDR_SETUP,
1707  PLAYER_VDR_COMMANDS,
1708  PLAYER_VDR_0,
1709  PLAYER_VDR_1,
1710  PLAYER_VDR_2,
1711  PLAYER_VDR_3,
1712  PLAYER_VDR_4,
1713  PLAYER_VDR_5,
1714  PLAYER_VDR_6,
1715  PLAYER_VDR_7,
1716  PLAYER_VDR_8,
1717  PLAYER_VDR_9,
1718  PLAYER_VDR_USER_1,
1719  PLAYER_VDR_USER_2,
1720  PLAYER_VDR_USER_3,
1721  PLAYER_VDR_USER_4,
1722  PLAYER_VDR_USER_5,
1723  PLAYER_VDR_USER_6,
1724  PLAYER_VDR_USER_7,
1725  PLAYER_VDR_USER_8,
1726  PLAYER_VDR_USER_9,
1727  PLAYER_VDR_VOLPLUS,
1728  PLAYER_VDR_VOLMINUS,
1729  PLAYER_VDR_MUTE,
1730  PLAYER_VDR_AUDIO,
1731  PLAYER_VDR_INFO,
1732  PLAYER_VDR_CHANNELPREVIOUS,
1733  PLAYER_VDR_NEXT,
1734  PLAYER_VDR_PREVIOUS,
1735  PLAYER_VDR_SUBTITLES,
1736 } player_vdr_t;
1737 
1753 void player_vdr (player_t *player, player_vdr_t value);
1754 
1759 /***************************************************************************/
1760 /* */
1761 /* Global libplayer functions */
1762 /* */
1763 /***************************************************************************/
1764 
1778 
1788 
1793 #ifdef __cplusplus
1794 #if 0 /* avoid EMACS indent */
1795 {
1796 #endif /* 0 */
1797 }
1798 #endif /* __cplusplus */
1799 
1800 #endif /* PLAYER_H */
void player_dvd_title_next(player_t *player)
Select the next DVD title.
void mrl_video_snapshot(player_t *player, mrl_t *mrl, int pos, mrl_snapshot_t t, const char *dst)
Take a video snapshot.
void player_set_framedrop(player_t *player, player_framedrop_t fd)
Set frame dropping with video playback.
void player_x_window_set_properties(player_t *player, int x, int y, int w, int h, int flags)
Set properties of X11 window handled by libplayer.
void player_video_set_panscan(player_t *player, int8_t value, int absolute)
Set video panscan.
void player_audio_volume_set(player_t *player, int value)
Set volume.
void player_subtitle_set_delay(player_t *player, int value)
Set subtitle delay.
int mrl_get_metadata_audio(player_t *player, mrl_t *mrl, int pos, uint32_t *id, char **name, char **lang)
Get audio metadata of the MRL object.
player_vo_t vo
Definition: player.h:177
int mrl_get_metadata_subtitle(player_t *player, mrl_t *mrl, int pos, uint32_t *id, char **name, char **lang)
Get subtitle metadata of the MRL object.
char * mrl_get_metadata(player_t *player, mrl_t *mrl, mrl_metadata_type_t m)
Get metadata of the stream.
void mrl_free(player_t *player, mrl_t *mrl)
Free a MRL object.
struct mrl_s mrl_t
MRL object.
Definition: player.h:269
player_loop_t
Player loop mode.
Definition: player.h:854
void player_tv_channel_next(player_t *player)
Select the next TV channel.
void player_subtitle_next(player_t *player)
Select the next subtitle ID.
void player_subtitle_scale(player_t *player, int value, int absolute)
Set subtitle scale.
void player_mrl_continue(player_t *player)
Go to the next MRL object accordingly to the loop and shuffle.
void player_playback_stop(player_t *player)
Stop playback.
void player_audio_next(player_t *player)
Select the next audio ID.
int libplayer_wrapper_enabled(player_type_t type)
Test if a wrapper is enabled.
void player_mrl_next(player_t *player)
Go the the next MRL object in the internal playlist.
player_mrl_add_t
Player MRL add mode.
Definition: player.h:745
mrl_metadata_type_t
MRL metadata.
Definition: player.h:383
struct player_s player_t
Player controller.
Definition: player.h:111
void player_subtitle_set_visibility(player_t *player, int value)
Set subtitle visibility.
mrl_t * mrl_new(player_t *player, mrl_resource_t res, void *args)
Create a new MRL object.
void mrl_add_subtitle(player_t *player, mrl_t *mrl, char *subtitle)
Add a subtitle file to a MRL object.
player_dvdnav_t
Player DVDnav commands.
Definition: player.h:1460
Arguments for audio CD.
Definition: player.h:330
int player_get_time_pos(player_t *player)
Get current time position in the current stream.
void player_set_playback(player_t *player, player_pb_t pb)
Set playback mode.
void player_osd_state(player_t *player, int value)
Enable/disable On-screen Display.
char * mrl_get_audio_codec(player_t *player, mrl_t *mrl)
Get audio codec name of the stream.
void player_video_set_aspect_ratio(player_t *player, float value)
Set video aspect ratio.
void player_playback_speed(player_t *player, float value)
Change playback speed.
void player_audio_prev(player_t *player)
Select the previous audio ID.
void player_radio_channel_select(player_t *player, const char *channel)
Select radio channel.
void player_osd_show_text(player_t *player, const char *text, int x, int y, int duration)
Show a text on the On-screen Display.
char * mrl_get_video_codec(player_t *player, mrl_t *mrl)
Get video codec name of the stream.
int libplayer_wrapper_supported_res(player_type_t type, mrl_resource_t res)
Test if a resource is supported by a wrapper.
player_pb_t
Player playback mode.
Definition: player.h:848
void player_audio_select(player_t *player, int audio_id)
Select audio ID.
player_mute_t player_audio_mute_get(player_t *player)
Get mute state.
mrl_properties_type_t
MRL properties.
Definition: player.h:407
player_quality_level_t quality
Definition: player.h:196
char * mrl_get_metadata_dvd(player_t *player, mrl_t *mrl, uint8_t *titles)
Get metadata of a DVD/DVDNAV MRL object.
void player_subtitle_set_position(player_t *player, int value)
Set subtitle position.
void player_audio_mute_set(player_t *player, player_mute_t value)
Set mute state.
void player_dvd_angle_prev(player_t *player)
Select the previous DVD angle.
mrl_resource_t
MRL resources.
Definition: player.h:286
uint32_t mrl_get_metadata_cd(player_t *player, mrl_t *mrl, mrl_metadata_cd_type_t m)
Get metadata of a CDDA/CDDB MRL object.
Parameters for player_init() .
Definition: player.h:173
off_t mrl_get_size(player_t *player, mrl_t *mrl)
Get size of the resource.
int player_audio_volume_get(player_t *player)
Get current volume.
player_pb_state_t player_playback_get_state(player_t *player)
Get current playback state.
player_mute_t
Player mute state.
Definition: player.h:1148
player_pb_state_t
Player playback state.
Definition: player.h:1035
void player_set_mouse_position(player_t *player, int x, int y)
Set the mouse position to the player.
Arguments for local streams.
Definition: player.h:324
uint32_t mrl_get_property(player_t *player, mrl_t *mrl, mrl_properties_type_t p)
Get property of the stream.
player_video_aspect_t
Player video aspect.
Definition: player.h:1271
player_sub_alignment_t
Player subtitle alignment.
Definition: player.h:1335
uint32_t winid
Definition: player.h:179
void player_mrl_remove(player_t *player)
Remove current MRL object in the internal playlist.
void player_set_verbosity(player_t *player, player_verbosity_level_t level)
Set verbosity level.
mrl_type_t
MRL types.
Definition: player.h:272
void player_mrl_append(player_t *player, mrl_t *mrl, player_mrl_add_t when)
Append MRL object in the internal playlist.
Arguments for video discs.
Definition: player.h:338
void player_dvd_angle_select(player_t *player, int angle)
Select DVD angle.
uint32_t mrl_get_metadata_subtitle_nb(player_t *player, mrl_t *mrl)
Get the number of available subtitles.
player_vo_t
Player video outputs.
Definition: player.h:123
void player_uninit(player_t *player)
Uninitialization of a player controller.
player_framedrop_t
Player frame dropping mode.
Definition: player.h:861
void player_tv_channel_select(player_t *player, const char *channel)
Select TV channel.
player_event_t
Player events.
Definition: player.h:146
void player_playback_seek(player_t *player, int value, player_pb_seek_t seek)
Seek in the stream.
mrl_resource_t mrl_get_resource(player_t *player, mrl_t *mrl)
Get resource of the stream.
void player_mrl_remove_all(player_t *player)
Remove all MRL objects in the internal playlist.
player_ao_t
Player audio outputs.
Definition: player.h:137
char * mrl_get_metadata_cd_track(player_t *player, mrl_t *mrl, int trackid, uint32_t *length)
Get metadata of a track with CDDA/CDDB MRL object.
uint32_t mrl_get_metadata_dvd_title(player_t *player, mrl_t *mrl, int titleid, mrl_metadata_dvd_type_t m)
Get metadata of a title with DVD/DVDNAV MRL object.
void player_tv_channel_prev(player_t *player)
Select the previous TV channel.
player_verbosity_level_t
Player verbosity.
Definition: player.h:157
unsigned int libplayer_version(void)
Return LIBPLAYER_VERSION_INT constant.
mrl_metadata_dvd_type_t
MRL DVD/DVDNAV metadata.
Definition: player.h:400
player_ao_t ao
Definition: player.h:175
Arguments for radio/tv streams.
Definition: player.h:354
const char * display
Definition: player.h:193
player_vdr_t
Player VDR commands.
Definition: player.h:1681
void player_mrl_set(player_t *player, mrl_t *mrl)
Set MRL object in the internal playlist.
uint32_t mrl_get_metadata_audio_nb(player_t *player, mrl_t *mrl)
Get the number of available audio streams.
player_x_window_flags_t
Player X11 window flags.
Definition: player.h:868
void player_video_set_aspect(player_t *player, player_video_aspect_t aspect, int8_t value, int absolute)
Set video aspect.
player_type_t
Player types.
Definition: player.h:114
Arguments for network streams.
Definition: player.h:367
int player_get_percent_pos(player_t *player)
Get percent position in the current stream.
mrl_t * player_mrl_get_current(player_t *player)
Get current MRL set in the internal playlist.
mrl_snapshot_t
Snapshot image file type.
Definition: player.h:375
void player_set_shuffle(player_t *player, int value)
Shuffle playback in the internal playlist.
void player_dvd_title_select(player_t *player, int title)
Select DVD title.
void player_playback_seek_chapter(player_t *player, int value, int absolute)
Seek chapter in the stream.
void player_radio_channel_prev(player_t *player)
Select the previous radio channel.
mrl_metadata_cd_type_t
MRL CDDA/CDDB metadata.
Definition: player.h:394
void player_playback_start(player_t *player)
Start a new playback.
void player_vdr(player_t *player, player_vdr_t value)
VDR commands.
void player_audio_set_delay(player_t *player, int value, int absolute)
Set audio delay.
void player_dvd_title_prev(player_t *player)
Select the previous DVD title.
void player_subtitle_prev(player_t *player)
Select the previous subtitle ID.
void player_radio_channel_next(player_t *player)
Select the next radio channel.
mrl_type_t mrl_get_type(player_t *player, mrl_t *mrl)
Get type of the stream.
void player_dvd_angle_next(player_t *player)
Select the next DVD angle.
void player_dvd_nav(player_t *player, player_dvdnav_t value)
DVD Navigation commands.
void player_subtitle_set_alignment(player_t *player, player_sub_alignment_t a)
Set subtitle alignment.
void player_mrl_previous(player_t *player)
Go the the previous MRL object in the internal playlist.
void player_subtitle_select(player_t *player, int sub_id)
Select subtitle ID.
void player_set_loop(player_t *player, player_loop_t loop, int value)
Set loop mode and value.
player_t * player_init(player_type_t type, player_verbosity_level_t verbosity, player_init_param_t *param)
Initialization of a new player controller.
void player_playback_pause(player_t *player)
Pause and unpause playback.
player_pb_seek_t
Player playback seek mode.
Definition: player.h:1042