diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-12-23 00:37:48 +0100 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-12-23 00:37:48 +0100 |
commit | 1dda55c79b90c27303628a42c7ad8d948d613146 (patch) | |
tree | fad68e0e7513130582e28cf05d4ceff413f5343c /include/xine/demux.h | |
parent | d23cc6dbac6f2b212d99453fddc0f20ccd178ab4 (diff) | |
parent | dca820a7cb6f1087f6d29482a1ee6d4916fc9f71 (diff) | |
download | xine-lib-1dda55c79b90c27303628a42c7ad8d948d613146.tar.gz xine-lib-1dda55c79b90c27303628a42c7ad8d948d613146.tar.bz2 |
Merge from 1.2 main branch.
--HG--
rename : src/xine-utils/xineutils.h => include/xine/xineutils.h
rename : src/libxineadec/Makefile.am => src/audio_dec/Makefile.am
rename : src/libxineadec/xine_a52_decoder.c => src/audio_dec/xine_a52_decoder.c
rename : src/libffmpeg/Makefile.am => src/combined/ffmpeg/Makefile.am
rename : src/libffmpeg/ff_audio_decoder.c => src/combined/ffmpeg/ff_audio_decoder.c
rename : src/libffmpeg/ff_dvaudio_decoder.c => src/combined/ffmpeg/ff_dvaudio_decoder.c
rename : src/libffmpeg/ff_dvdata.h => src/combined/ffmpeg/ff_dvdata.h
rename : src/libffmpeg/ff_video_decoder.c => src/combined/ffmpeg/ff_video_decoder.c
rename : src/libffmpeg/ffmpeg_encoder.c => src/combined/ffmpeg/ffmpeg_encoder.c
rename : src/libmpeg2/Makefile.am => src/video_dec/libmpeg2/Makefile.am
rename : src/libmpeg2/decode.c => src/video_dec/libmpeg2/decode.c
Diffstat (limited to 'include/xine/demux.h')
-rw-r--r-- | include/xine/demux.h | 214 |
1 files changed, 214 insertions, 0 deletions
diff --git a/include/xine/demux.h b/include/xine/demux.h new file mode 100644 index 000000000..476c80b8e --- /dev/null +++ b/include/xine/demux.h @@ -0,0 +1,214 @@ +/* + * Copyright (C) 2000-2003 the xine project + * + * This file is part of xine, a free video player. + * + * xine is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * xine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + */ + +#ifndef HAVE_DEMUX_H +#define HAVE_DEMUX_H + +#include <xine/input_plugin.h> +#include <xine/buffer.h> +#include <xine/xine_internal.h> + +#define DEMUXER_PLUGIN_IFACE_VERSION 27 + +#define DEMUX_OK 0 +#define DEMUX_FINISHED 1 + +#define DEMUX_CANNOT_HANDLE 0 +#define DEMUX_CAN_HANDLE 1 + +#define METHOD_BY_CONTENT 1 +#define METHOD_BY_MRL 2 +#define METHOD_EXPLICIT 3 + +typedef struct demux_class_s demux_class_t ; +typedef struct demux_plugin_s demux_plugin_t; + +struct demux_class_s { + + /* + * open a new instance of this plugin class + */ + demux_plugin_t* (*open_plugin) (demux_class_t *this, xine_stream_t *stream, input_plugin_t *input); + + /** + * @brief short human readable identifier for this plugin class + */ + const char *identifier; + + /** + * @brief human readable (verbose = 1 line) description for this plugin class + * + * The description is passed to gettext() to internationalise. + */ + const char *description; + + /** + * @brief Optional non-standard catalog to use with dgettext() for description. + */ + const char *textdomain; + + /** + * @brief MIME types supported for this plugin + */ + + const char* mimetypes; + + /** + * @brief space separated list of file extensions this demuxer is + * likely to handle + * + * (will be used to filter media files in file selection dialogs) + */ + const char* extensions; + + /* + * close down, free all resources + */ + void (*dispose) (demux_class_t *this); +}; + +#define default_demux_class_dispose (void (*) (demux_class_t *this))free + +/* + * any demux plugin must implement these functions + */ + +struct demux_plugin_s { + + /* + * send headers, followed by BUF_CONTROL_HEADERS_DONE down the + * fifos, then return. do not start demux thread (yet) + */ + + void (*send_headers) (demux_plugin_t *this); + + /* + * ask demux to seek + * + * for seekable streams, a start position can be specified + * + * start_pos : position in input source (0..65535) + * this is defined as most convenient to demuxer, can be + * either time or offset based. + * start_time : position measured in miliseconds from stream start + * playing : true if this is a new seek within an already playing stream + * false if playback of this stream has not started yet + * + * if both parameters are !=0 start_pos will be used + * for non-seekable streams both values will be ignored + * + * returns the demux status (like get_status, but immediately after + * starting the demuxer) + */ + + int (*seek) (demux_plugin_t *this, + off_t start_pos, int start_time, int playing ); + + /* + * send a chunk of data down to decoder fifos + * + * the meaning of "chunk" is specific to every demux, usually + * it involves parsing one unit of data from stream. + * + * this function will be called from demux loop and should return + * the demux current status + */ + + int (*send_chunk) (demux_plugin_t *this); + + /* + * free resources + */ + + void (*dispose) (demux_plugin_t *this) ; + + /* + * returns DEMUX_OK or DEMUX_FINISHED + */ + + int (*get_status) (demux_plugin_t *this) ; + + /* + * gets stream length in miliseconds (might be estimated) + * may return 0 for non-seekable streams + */ + + int (*get_stream_length) (demux_plugin_t *this); + + /* + * return capabilities of demuxed stream + */ + + uint32_t (*get_capabilities) (demux_plugin_t *this); + + /* + * request optional data from input plugin. + */ + int (*get_optional_data) (demux_plugin_t *this, void *data, int data_type); + + /* + * "backwards" link to plugin class + */ + + demux_class_t *demux_class; + + void *node; /* used by plugin loader */ + +} ; + +#define default_demux_plugin_dispose (void (*) (demux_plugin_t *this))free + +/* + * possible capabilites a demux plugin can have: + */ +#define DEMUX_CAP_NOCAP 0x00000000 + +/* + * DEMUX_CAP_AUDIOLANG: + * DEMUX_CAP_SPULANG: + * demux plugin knows something about audio/spu languages, + * e.g. knows that audio stream #0 is english, + * audio stream #1 is german, ... Same bits as INPUT + * capabilities . + */ + +#define DEMUX_CAP_AUDIOLANG 0x00000008 +#define DEMUX_CAP_SPULANG 0x00000010 + +/* + * DEMUX_CAP_CHAPTERS: + * The media streams provided by this plugin have an internal + * structure dividing it into segments usable for navigation. + * For those plugins, the behaviour of the skip button in UIs + * should be changed from "next MRL" to "next chapter" by + * sending XINE_EVENT_INPUT_NEXT. + * Same bits as INPUT capabilities. + */ + +#define DEMUX_CAP_CHAPTERS 0x00000080 + + +#define DEMUX_OPTIONAL_UNSUPPORTED 0 +#define DEMUX_OPTIONAL_SUCCESS 1 + +#define DEMUX_OPTIONAL_DATA_AUDIOLANG 2 +#define DEMUX_OPTIONAL_DATA_SPULANG 3 + +#endif |