XINE, A Free Video Player Project - API reference

Main Page Modules Data Structures File List Data Fields Globals

# xine.h

Go to the documentation of this file.

    00001 /* !! DO NO EDIT THIS FILE, it is automatically generated */
    00031 /*
    00032  * $Id: xine_8h-source.html,v 1.4 2001/10/14 23:19:59 f1rmb Exp $
    00033  *
    00034  */
    00035
    00036 #ifndef HAVE_XINE_H
    00037 #define HAVE_XINE_H
    00038
    00039 #ifdef __cplusplus
    00040 extern "C" {
    00041 #endif
    00042
    00043 #include <inttypes.h>
    00044 #include <unistd.h>
    00045 #include <sys/types.h>
    00046
    00047 #ifndef XINE_COMPILE
    00048 #include <xine/video_out.h>
    00049 #endif
    00050
    00051 #ifndef DOC_HIDDEN
    00052 #include <xine/events.h>
    00053 #endif
    00054
    00059 #define XINE_SKINDIR    "/usr/local/share/xine/skins"
    00060
    00070 #define XINE_BUILD_CC      "gcc version 2.95.3 20010315 (release)"
    00071
    00074 #define XINE_BUILD_OS      "Linux 2.4.9 i686"
    00075
    00078 #define XINE_BUILD_DATE    "Mon 15 Oct 2001 00:22:19"
    00079
    00097 #define XINE_STOP      0
    00098
    00103 #define XINE_PLAY      1
    00104
    00109 #define XINE_QUIT      2
    00110
    00122 #define XINE_MAJOR_VERSION 0
    00123
    00127 #define XINE_MINOR_VERSION 9
    00128
    00132 #define XINE_SUB_VERSION   2
    00133
    00148 char *xine_get_str_version(void);
    00149
    00157 int xine_get_major_version(void);
    00158
    00166 int xine_get_minor_version(void);
    00167
    00175 int xine_get_sub_version(void);
    00176
    00187 int xine_check_version(int major, int minor, int sub);
    00188
    00205 #define VO_CAP_HUE          0x00000010
    00206
    00210 #define VO_CAP_SATURATION   0x00000020
    00211
    00215 #define VO_CAP_BRIGHTNESS   0x00000040
    00216
    00220 #define VO_CAP_CONTRAST     0x00000080
    00221
    00225 #define VO_CAP_COLORKEY     0x00000100
    00226
    00239 #define VO_PROP_INTERLACED        0
    00240
    00245 #define VO_PROP_ASPECT_RATIO      1
    00246
    00251 #define VO_PROP_HUE               2
    00252
    00257 #define VO_PROP_SATURATION        3
    00258
    00263 #define VO_PROP_CONTRAST          4
    00264
    00269 #define VO_PROP_BRIGHTNESS        5
    00270
    00275 #define VO_PROP_COLORKEY          6
    00276
    00281 #define VO_PROP_SOFT_DEINTERLACE  7
    00282
    00287 #define VO_NUM_PROPERTIES         8
    00288
    00302 #define ASPECT_AUTO        0
    00303
    00308 #define ASPECT_ANAMORPHIC  1
    00309
    00314 #define ASPECT_FULL        2
    00315
    00320 #define ASPECT_DVB         3
    00321
    00326 #define ASPECT_SQUARE      4
    00327
    00332 #define NUM_ASPECT_RATIOS  5
    00333
    00336 #ifdef DOC_HIDDEN
    00337
    00342 typedef void vo_frame_t;
    00348 typedef void vo_overlay_t;
    00349
    00355 typedef struct vo_driver_s vo_driver_t;
    00356
    00361 struct vo_driver_s {
    00366   uint32_t (*get_capabilities) (vo_driver_t *self);
    00371   vo_frame_t* (*alloc_frame) (vo_driver_t *self);
    00376   void (*update_frame_format) (vo_driver_t *self, vo_frame_t *img,
    00377                                uint32_t width, uint32_t height,
    00378                                int ratio_code, int format);
    00382   void (*display_frame) (vo_driver_t *self, vo_frame_t *vo_img);
    00386   void (*overlay_blend) (vo_driver_t *self, vo_frame_t *vo_img, vo_overlay_t *overlay);
    00394   int (*get_property) (vo_driver_t *self, int property);
    00399   int (*set_property) (vo_driver_t *self,
    00400                        int property, int value);
    00405   void (*get_property_min_max) (vo_driver_t *self,
    00406                                 int property, int *min, int *max);
    00413   int (*gui_data_exchange) (vo_driver_t *self, int data_type,
    00414                             void *data);
    00418   void (*exit) (vo_driver_t *self);
    00419
    00420 };
    00421 #endif
    00422
    00439 typedef void xine_t;
    00444 typedef void ao_driver_t;
    00450 #ifdef DOC_HIDDEN
    00451 typedef void cfg_data_t;
    00457 typedef struct config_values_s config_values_t;
    00463 struct config_values_s {
    00467   char* (*lookup_str) (config_values_t *self,
    00468                        char *key, char *str_default);
    00472   int (*lookup_int) (config_values_t *self,
    00473                      char *key, int n_default);
    00477   void (*set_str) (config_values_t *self,
    00478                    char *key, char *value) ;
    00482   void (*set_int) (config_values_t *self,
    00483                    char *key, int value) ;
    00487   void (*save) (config_values_t *self);
    00493   void (*read) (config_values_t *self, char *filename);
    00497   cfg_data_t *data;
    00498 };
    00499 #endif
    00500
    00513 config_values_t *config_file_init (char *filename);
    00514
    00525 typedef void (*gui_stream_end_cb_t) (int nStatus);
    00530 typedef char* (*gui_get_next_mrl_cb_t) (void);
    00535 typedef void (*gui_branched_cb_t) (void);
    00536
    00551 #define DEMUX_DEFAULT_STRATEGY    0
    00552
    00557 #define DEMUX_REVERT_STRATEGY     1
    00558
    00563 #define DEMUX_CONTENT_STRATEGY    2
    00564
    00569 #define DEMUX_EXTENSION_STRATEGY  3
    00570
    00591 xine_t *xine_init (vo_driver_t *vo,
    00592                    ao_driver_t *ao,
    00593                    config_values_t *config,
    00594                    gui_stream_end_cb_t stream_end_cb,
    00595                    gui_get_next_mrl_cb_t get_next_mrl_cb,
    00596                    gui_branched_cb_t branched_cb);
    00597
    00607 void xine_exit (xine_t *self);
    00608
    00629 void xine_play (xine_t *self, char *MRL, int start_pos, int start_time);
    00630
    00641 void xine_set_speed (xine_t *self, int speed);
    00642
    00651 int xine_get_speed (xine_t *self);
    00652
    00658 #define SPEED_PAUSE   0
    00659
    00664 #define SPEED_SLOW_4  1
    00665
    00670 #define SPEED_SLOW_2  2
    00671
    00676 #define SPEED_NORMAL  4
    00677
    00682 #define SPEED_FAST_2  8
    00683
    00688 #define SPEED_FAST_4 16
    00689
    00699 void xine_set_av_offset (xine_t *self, int offset_pts);
    00700
    00709 int xine_get_av_offset (xine_t *self);
    00710
    00719 void xine_stop (xine_t *self);
    00720
    00729 int xine_eject(xine_t *self);
    00730
    00739 int xine_get_status (xine_t *self);
    00740
    00749 int xine_get_current_position (xine_t *self);
    00750
    00759 int xine_get_current_time (xine_t *self);
    00760
    00769 int xine_get_stream_length (xine_t *self);
    00770
    00779 int xine_get_audio_channel (xine_t *self);
    00780
    00789 void xine_select_audio_channel (xine_t *self, int channel);
    00790
    00799 int xine_get_spu_channel (xine_t *self);
    00800
    00809 void xine_select_spu_channel (xine_t *self, int channel);
    00810
    00828 #define AO_CAP_NOCAP            0x00000000
    00829
    00834 #define AO_CAP_MODE_A52         0x00000001
    00835
    00840 #define AO_CAP_MODE_AC5         0x00000002
    00841
    00847 #define AO_CAP_MODE_MONO        0x00000004
    00848
    00854 #define AO_CAP_MODE_STEREO      0x00000008
    00855
    00861 #define AO_CAP_MODE_4CHANNEL    0x00000010
    00862
    00868 #define AO_CAP_MODE_5CHANNEL    0x00000020
    00869
    00875 #define AO_CAP_MODE_5_1CHANNEL  0x00000040
    00876
    00881 #define AO_CAP_MIXER_VOL        0x00000080
    00882
    00887 #define AO_CAP_PCM_VOL          0x00000100
    00888
    00893 #define AO_CAP_MUTE_VOL         0x00000200
    00894
    00904 int xine_get_audio_capabilities(xine_t *self);
    00905
    00918 #define AO_PROP_MIXER_VOL       0
    00919
    00924 #define AO_PROP_PCM_VOL         1
    00925
    00930 #define AO_PROP_MUTE_VOL        2
    00931
    00941 int xine_get_audio_property(xine_t *self, int property);
    00953 int xine_set_audio_property(xine_t *self, int property, int value);
    00954
    00973 char **xine_get_browsable_input_plugin_ids (xine_t *self) ;
    00974
    00987 #define mrl_unknown        (0 << 0)
    00988
    00993 #define mrl_dvd            (1 << 0)
    00994
    00999 #define mrl_vcd            (1 << 1)
    01000
    01005 #define mrl_net            (1 << 2)
    01006
    01011 #define mrl_rtp            (1 << 3)
    01012
    01017 #define mrl_stdin          (1 << 4)
    01018
    01023 #define mrl_file           (1 << 5)
    01024
    01029 #define mrl_file_fifo      (1 << 6)
    01030
    01035 #define mrl_file_chardev   (1 << 7)
    01036
    01041 #define mrl_file_directory (1 << 8)
    01042
    01047 #define mrl_file_blockdev  (1 << 9)
    01048
    01053 #define mrl_file_normal    (1 << 10)
    01054
    01059 #define mrl_file_symlink   (1 << 11)
    01060
    01065 #define mrl_file_sock      (1 << 12)
    01066
    01071 #define mrl_file_exec      (1 << 13)
    01072
    01077 #define mrl_file_backup    (1 << 14)
    01078
    01083 #define mrl_file_hidden    (1 << 15)
    01084
    01092 #define MRL_ZERO(m) {                                                         \
    01093   if((m)) {                                                                   \
    01094     if((m)->origin)                                                           \
    01095       free((m)->origin);                                                      \
    01096     if((m)->mrl)                                                              \
    01097       free((m)->mrl);                                                         \
    01098     if((m)->link)                                                             \
    01099       free((m)->link);                                                        \
    01100     (m)->origin = NULL;                                                       \
    01101     (m)->mrl    = NULL;                                                       \
    01102     (m)->link   = NULL;                                                       \
    01103     (m)->type   = 0;                                                          \
    01104     (m)->size   = (off_t) 0;                                                  \
    01105   }                                                                           \
    01106 }
    01107
    01113 #define MRL_DUPLICATE(s, d) {                                                 \
    01114   assert((s) != NULL);                                                        \
    01115   assert((d) != NULL);                                                        \
    01116                                                                               \
    01117   if((s)->origin) {                                                           \
    01118     if((d)->origin) {                                                         \
    01119       (d)->origin = (char *) realloc((d)->origin, strlen((s)->origin) + 1);   \
    01120       sprintf((d)->origin, "%s", (s)->origin);                                \
    01121     }                                                                         \
    01122     else                                                                      \
    01123       (d)->origin = strdup((s)->origin);                                      \
    01124   }                                                                           \
    01125   else                                                                        \
    01126     (d)->origin = NULL;                                                       \
    01127                                                                               \
    01128   if((s)->mrl) {                                                              \
    01129     if((d)->mrl) {                                                            \
    01130       (d)->mrl = (char *) realloc((d)->mrl, strlen((s)->mrl) + 1);            \
    01131       sprintf((d)->mrl, "%s", (s)->mrl);                                      \
    01132     }                                                                         \
    01133     else                                                                      \
    01134       (d)->mrl = strdup((s)->mrl);                                            \
    01135   }                                                                           \
    01136   else                                                                        \
    01137     (d)->mrl = NULL;                                                          \
    01138                                                                               \
    01139   if((s)->link) {                                                             \
    01140     if((d)->link) {                                                           \
    01141       (d)->link = (char *) realloc((d)->link, strlen((s)->link) + 1);         \
    01142       sprintf((d)->link, "%s", (s)->link);                                    \
    01143     }                                                                         \
    01144     else                                                                      \
    01145       (d)->link = strdup((s)->link);                                          \
    01146   }                                                                           \
    01147   else                                                                        \
    01148     (d)->link = NULL;                                                         \
    01149                                                                               \
    01150   (d)->type = (s)->type;                                                      \
    01151   (d)->size = (s)->size;                                                      \
    01152 }
    01153
    01159 #define MRLS_DUPLICATE(s, d) {                                                \
    01160   int i = 0;                                                                  \
    01161                                                                               \
    01162   assert((s) != NULL);                                                        \
    01163   assert((d) != NULL);                                                        \
    01164                                                                               \
    01165   while((s) != NULL) {                                                        \
    01166     d[i] = (mrl_t *) malloc(sizeof(mrl_t));                                   \
    01167     MRL_DUPLICATE(s[i], d[i]);                                                \
    01168     i++;                                                                      \
    01169   }                                                                           \
    01170 }
    01171
    01177 typedef struct {
    01179   char         *origin;
    01181   char         *mrl;
    01183   char         *link;
    01185   uint32_t      type;
    01187   off_t         size;
    01188 } mrl_t;
    01189
    01206 mrl_t **xine_get_browse_mrls (xine_t *self, char *plugin_id, char *start_mrl, int *num_mrls);
    01207
    01223 char **xine_get_autoplay_input_plugin_ids (xine_t *self) ;
    01224
    01235 char **xine_get_autoplay_mrls (xine_t *self, char *plugin_id, int *num_mrls);
    01236
    01250 #define XINE_PLUGINDIR  "/usr/local/lib/xine/plugins"
    01251
    01262 #define VISUAL_TYPE_X11   1
    01263
    01268 #define VISUAL_TYPE_AA    2
    01269
    01274 #define VISUAL_TYPE_FB    3
    01275
    01280 #define VISUAL_TYPE_GTK   4
    01281
    01291 char **xine_list_video_output_plugins (int visual_type);
    01292
    01302 vo_driver_t *xine_load_video_output_plugin(config_values_t *config,
    01303                                            char *id, int visual_type, void *visual);
    01304
    01310 char **xine_list_audio_output_plugins (void);
    01311
    01319 ao_driver_t *xine_load_audio_output_plugin(config_values_t *config, char *id);
    01320
    01329 #ifdef DOC_HIDDEN
    01330
    01334 typedef void event_t;
    01335 #endif
    01336
    01341 typedef void (*event_listener_t) (xine_t *xine, event_t *event, void *data);
    01342
    01351 int xine_register_event_listener(xine_t *self, event_listener_t listener);
    01352
    01361 int xine_remove_event_listener(xine_t *self, event_listener_t listener);
    01362
    01371 void xine_send_event(xine_t *self, event_t *event, void *data);
    01372
    01391 int xine_get_current_frame (xine_t *self, int *width, int *height,
    01392                             int *ratio_code, int *format,
    01393                             uint8_t **y, uint8_t **u,
    01394                             uint8_t **v);
    01395
    01396
    01397
    01403 #define XINE_IMGFMT_YV12 0x32315659
    01404
    01409 #define XINE_IMGFMT_YUY2 (('2'<<24)|('Y'<<16)|('U'<<8)|'Y')
    01410
    01416 #define XINE_ASPECT_RATIO_SQUARE      1
    01417
    01422 #define XINE_ASPECT_RATIO_4_3         2
    01423
    01428 #define XINE_ASPECT_RATIO_ANAMORPHIC  3
    01429
    01434 #define XINE_ASPECT_RATIO_211_1       4
    01435
    01440 #define XINE_ASPECT_RATIO_DONT_TOUCH 42
    01441
    01444 #ifdef __cplusplus
    01445 }
    01446 #endif
    01447
    01448 #endif