00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00029 #ifndef _XLV_GCORE_H
00030 #define _XLV_GCORE_H
00031
00032 #include "xlv_plugin_mgr.h"
00033 #include "xlv_session.h"
00034 #include "xlv_handler.h"
00035 #include "xlv_video.h"
00036 #include "xlv_audio.h"
00037 #include "xlv_timer.h"
00038 #include "xlv_codec.h"
00039 #include "xlv_demux.h"
00040 #include <pthread.h>
00041
00042 #define XLV_PLAY_INIT 0
00043 #define XLV_PLAY_STOPPED 1
00044 #define XLV_PLAY_PLAYING 2
00045 #define XLV_PLAY_PAUSED 3
00046 #define XLV_PLAY_SEEKING 4
00047 #define XLV_PLAY_FINISHED 5
00048
00055 typedef struct _XLV_PlayState XLV_PlayState;
00056
00057 #ifdef XLV_INTERNAL
00058 struct _XLV_PlayState {
00059 guint m_state;
00060 gboolean m_paused;
00061 XLV_Stream *m_input_stream;
00062 XLV_Stream *m_system;
00063
00064 XLV_Stream *m_video_stream;
00065 XLV_Stream *m_audio_stream;
00066
00067 XLV_OutputHandler *m_video_handler;
00068 XLV_OutputHandler *m_audio_handler;
00069
00070 XLV_Stream *m_video_output;
00071 XLV_Stream *m_audio_output;
00072
00073 XLV_Stream *m_video_codec;
00074 XLV_Stream *m_audio_codec;
00075 XLV_Stream *m_original_video_codec;
00076
00077 XLV_Session *m_session;
00078
00079 gboolean m_auto_release;
00080
00081 XLV_Timer *m_ref_timer;
00082
00083 pthread_t m_play_thread;
00084
00085 gboolean m_alive;
00086 gboolean m_to_stop;
00087 gboolean m_no_vid_queue;
00088
00089 gfloat m_video_rate;
00090 gfloat m_audio_rate;
00091
00092 guint32 m_audio_wrn;
00093 guint32 m_vid_frames;
00094 guint32 m_base_time;
00095 XLV_Timer *m_clock;
00096
00097 guint8 m_video_mark;
00098 guint8 m_audio_mark;
00099
00100 guint16 m_aq_len, m_vq_len;
00101 guint8 m_audio_fill_jauge;
00102 gboolean m_wait_for_aq;
00103 gboolean m_wait_for_vq;
00104 };
00105 #endif
00106
00107 #ifdef __cplusplus
00108 extern "C" {
00109 #endif
00110
00116 XLV_PlayState *xlv_open_url_play (XLV_Session * session,
00117 const gchar * name);
00118
00124 XLV_PlayState *xlv_open_play (XLV_Session * session, const gchar * name);
00125
00131 XLV_PlayState *xlv_open_play_stream (XLV_Session * session,
00132 XLV_Stream * stream);
00136 void xlv_close_play (XLV_PlayState * state);
00137
00142 void xlv_set_video_stream (XLV_PlayState * state, guint stream_no);
00143
00148 void xlv_set_audio_stream (XLV_PlayState * state, guint stream_no);
00149
00154 void xlv_setup_video_codec (XLV_PlayState * state);
00159 void xlv_setup_audio_codec (XLV_PlayState * state);
00160
00173 void xlv_setup_video_output (XLV_PlayState * state,
00174 XLV_Stream * video_output);
00175
00188 void xlv_setup_audio_output (XLV_PlayState * state,
00189 XLV_Stream * audio_output);
00190
00195 XLV_Stream *xlv_play_get_video_renderer (XLV_PlayState * state);
00196
00201 XLV_Stream *xlv_play_get_audio_renderer (XLV_PlayState * state);
00202
00215 XLV_Stream *xlv_play_get_audio_codec (XLV_PlayState * state);
00216
00229 XLV_Stream *xlv_play_get_video_codec (XLV_PlayState * state);
00230
00235 gboolean xlv_play_find_system (XLV_PlayState * state);
00236
00240 void xlv_prepare_to_play (XLV_PlayState * state);
00241
00246 gboolean xlv_play_start (XLV_PlayState * state);
00247
00252 gboolean xlv_play_stop (XLV_PlayState * state);
00253
00258 gboolean xlv_play_pause (XLV_PlayState * state);
00259
00264 gboolean xlv_play_alive (XLV_PlayState * state);
00265
00270 gboolean xlv_play_paused (XLV_PlayState * state);
00271
00280 gfloat xlv_play_get_time_length (XLV_PlayState * state);
00281
00286 gfloat xlv_play_get_current_time (XLV_PlayState * state);
00287
00291 gboolean xlv_play_set_current_time (XLV_PlayState * state, gfloat time);
00292
00296 guint32 xlv_play_get_audio_bitrate (XLV_PlayState * state);
00297
00301 guint32 xlv_play_get_video_bitrate (XLV_PlayState * state);
00302
00306 guint8 xlv_play_get_aq_use (XLV_PlayState * state);
00307
00311 guint8 xlv_play_get_vq_use (XLV_PlayState * state);
00312
00313 #ifdef __cplusplus
00314 }
00315 #endif
00316
00317 #endif