Main Page   Modules   Compound List   File List   Compound Members   File Members  

xlv_demux.h

00001 /*
00002  * xlv_demux.h
00003  *
00004  * Copyright (C) 2001 Guilhem Lavaux
00005  *
00006  * This file is part of XLV, a free middleware audio-video stream coder/decoder.
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Library General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2 of the License, or (at your option) any later version.
00012  *
00013  * XLV is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 /* System stream specific */
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 /* Demuxer object */
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

Generated on Mon Jul 1 19:39:05 2002 for XLV by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002