00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _XLV_DEMUX_H
00023 #define _XLV_DEMUX_H
00024
00036 #include <glib.h>
00037 #include "xlv_plugin_mgr.h"
00038 #include "xlv_session.h"
00039
00040 #define XLV_SYSTEM_BASE_CMD 200
00041
00042
00043 #define XLV_SYSTEM_GET_STREAM_SPEC (XLV_SYSTEM_BASE_CMD+0)
00044 # define XLV_SYSTEM_AUDIO_STREAM 0
00045 # define XLV_SYSTEM_VIDEO_STREAM 1
00046 # define XLV_SYSTEM_EXT_STREAM 2
00047 # define XLV_SYSTEM_SPU_STREAM 3
00048 # define XLV_SYSTEM_NONE_STREAM 255
00049
00050 #define XLV_SYSTEM_GET_STREAM_NO (XLV_SYSTEM_BASE_CMD+1)
00051 #define XLV_SYSTEM_GET_VSTREAM (XLV_SYSTEM_BASE_CMD+2)
00052 #define XLV_SYSTEM_GET_STREAM (XLV_SYSTEM_BASE_CMD+3)
00053 #define XLV_SYSTEM_UPLOAD_AUDIO_DATA (XLV_SYSTEM_BASE_CMD+4)
00054 #define XLV_SYSTEM_UPLOAD_VIDEO_DATA (XLV_SYSTEM_BASE_CMD+5)
00055 #define XLV_SYSTEM_SET_ASTREAM (XLV_SYSTEM_BASE_CMD+6)
00056 #define XLV_SYSTEM_SET_VSTREAM (XLV_SYSTEM_BASE_CMD+7)
00057 #define XLV_SYSTEM_BUILD_ASTREAM (XLV_SYSTEM_BASE_CMD+8)
00058 #define XLV_SYSTEM_BUILD_VSTREAM (XLV_SYSTEM_BASE_CMD+9)
00059 #define XLV_SYSTEM_BUILD_STREAM (XLV_SYSTEM_BASE_CMD+10)
00060 #define XLV_SYSTEM_GET_BSIZE (XLV_SYSTEM_BASE_CMD+11)
00061 #define XLV_SYSTEM_NEXT_FRAME (XLV_SYSTEM_BASE_CMD+12)
00062 #define XLV_SYSTEM_GET_TIME (XLV_SYSTEM_BASE_CMD+13)
00063 #define XLV_SYSTEM_SET_MODE (XLV_SYSTEM_BASE_CMD+14)
00064 # define XLV_SYSTEM_SEEKING 0
00065 # define XLV_SYSTEM_STREAMING 1
00066
00067 typedef struct _XLV_SystemStreamSpec {
00068 guint8 m_type;
00069 guint8 m_id;
00070 const gchar *m_encoding;
00071 guint32 m_bitrate;
00072 guint32 m_codec_data_len;
00073 gpointer m_codec_data;
00074 } XLV_SystemStreamSpec;
00075
00076 typedef struct _XLV_SystemData {
00077 XLV_Data m_data;
00078 guint32 m_timestamp;
00079 } XLV_SystemData;
00080
00081
00082
00083 typedef struct _XLV_Demuxer {
00084 XLV_Session *m_session;
00085 XLV_Stream *m_input_stream;
00086 XLV_Stream *m_system;
00087
00088 guint8 m_n_substreams;
00089 } XLV_Demuxer;
00090
00091 typedef struct _XLV_StreamDecoder {
00092 XLV_Demuxer *m_decoder;
00093 XLV_Stream *m_stream;
00094 guint8 m_stream_no;
00095 gboolean m_release_s;
00096 guint8 m_type;
00097 } XLV_StreamDecoder;
00098
00099 #ifdef __cplusplus
00100 extern "C" {
00101 #endif
00102
00103 XLV_Demuxer *xlv_demux_new (XLV_Session * session, XLV_Stream * m_input);
00104 XLV_Demuxer *xlv_demux_new_with (XLV_Session * session, XLV_Stream * input,
00105 const gchar *type);
00106 void xlv_demux_release (XLV_Demuxer * decoder);
00107
00108 gboolean xlv_demux_set_audio_stream (XLV_Demuxer * decoder,
00109 guint8 channel_id);
00110 gboolean xlv_demux_set_video_stream (XLV_Demuxer * decoder,
00111 guint8 channel_id);
00112 guint8 xlv_demux_get_number_of_substreams (XLV_Demuxer * decoder);
00113 XLV_StreamDecoder *xlv_demux_get_stream (XLV_Demuxer * decoder,
00114 guint8 stream_id);
00115 XLV_StreamDecoder *xlv_demux_get_audio_stream (XLV_Demuxer * decoder);
00116 XLV_StreamDecoder *xlv_demux_get_video_stream (XLV_Demuxer * decoder);
00117 void xlv_demux_release_stream (XLV_StreamDecoder * dec);
00118
00119 glong xlv_demux_get_buffer_size (XLV_Demuxer * decoder);
00120 guint32 xlv_demux_get_time (XLV_Demuxer * decoder);
00121
00122 gboolean xlv_demux_substream_get_spec (XLV_StreamDecoder * decoder,
00123 XLV_SystemStreamSpec * spec);
00124 gboolean xlv_demux_substream_next_frame (XLV_StreamDecoder * decoder,
00125 XLV_SystemData * data);
00126
00127 #ifdef __cplusplus
00128 }
00129 #endif
00130
00133 #endif