1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
/*
* Copyright (C) 2000, 2001 the xine project
*
* This file is part of xine, a unix 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* $Id: demux.h,v 1.12 2001/10/25 00:46:58 miguelfreitas Exp $
*/
#ifndef HAVE_DEMUX_H
#define HAVE_DEMUX_H
#ifdef __cplusplus
extern "C" {
#endif
#include "buffer.h"
#include "xine_internal.h"
#if defined(XINE_COMPILE)
#include "input/input_plugin.h"
#else
#include "input_plugin.h"
#endif
#define DEMUXER_PLUGIN_IFACE_VERSION 6
#define DEMUX_OK 0
#define DEMUX_FINISHED 1
#define DEMUX_CANNOT_HANDLE 0
#define DEMUX_CAN_HANDLE 1
#define DEMUX_DEFAULT_STRATEGY 0
#define DEMUX_REVERT_STRATEGY 1
#define DEMUX_CONTENT_STRATEGY 2
#define DEMUX_EXTENSION_STRATEGY 3
#define STAGE_BY_CONTENT 1
#define STAGE_BY_EXTENSION 2
/*
* a demux plugin must implement these functions
*/
typedef struct demux_plugin_s demux_plugin_t;
struct demux_plugin_s
{
/*
* plugin interface version, lower versions _may_ be supported
*/
int interface_version;
/*
* ask demuxer to open the given stream (input-plugin)
* using the content-detection method specified in <stage>
*
* return values:
* DEMUX_CAN_HANDLE on success
* DEMUX_CANNOT_HANDLE on failure
*/
int (*open) (demux_plugin_t *this, input_plugin_t *ip,
int stage);
/*
* start demux thread
*
* for seekable streams, a start position can be specified
*
* start_pos : position in input source
* start_time : position measured in seconds from stream start
*
* if both parameters are !=0 start_pos will be used
* for non-seekable streams both values will be ignored
*/
void (*start) (demux_plugin_t *this, fifo_buffer_t *video_fifo,
fifo_buffer_t *audio_fifo,
off_t start_pos, int start_time);
/*
* stop & kill demux thread, free resources associated with current
* input stream
*/
void (*stop) (demux_plugin_t *this) ;
/*
* close demuxer, free all resources
*/
void (*close) (demux_plugin_t *this) ;
/*
* returns DEMUX_OK or DEMUX_FINISHED
*/
int (*get_status) (demux_plugin_t *this) ;
/*
* return human readable identifier for this plugin
*/
char* (*get_identifier) (void);
/*
* return MIME types supported for this plugin
*/
char* (*get_mimetypes) (void);
/*
* estimate stream length in seconds
* may return 0 for non-seekable streams
*/
int (*get_stream_length) (demux_plugin_t *this);
} ;
/*
* demuxer plugins should provide this (and only this!) function call:
*
* demux_plugin_t *init_demux_plugin (int iface_version, xine_t *xine);
*/
#ifdef __cplusplus
}
#endif
#endif
|