summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-01-31 14:06:03 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-01-31 14:06:03 +0000
commit8695f5d8c99952a89f59b314c58a5e0bbd8a6e6e (patch)
tree47af2fb780645208a11b0e3bcea97e709c050330 /src/input
parent112c134d4636786c1b0e22839bd782d9554b961e (diff)
downloadxine-lib-8695f5d8c99952a89f59b314c58a5e0bbd8a6e6e.tar.gz
xine-lib-8695f5d8c99952a89f59b314c58a5e0bbd8a6e6e.tar.bz2
- MAX_PREVIEW_SIZE = 4096
- new fb driver with zero copy CVS patchset: 4058 CVS date: 2003/01/31 14:06:03
Diffstat (limited to 'src/input')
-rw-r--r--src/input/input_gnome_vfs.c6
-rw-r--r--src/input/input_http.c5
-rw-r--r--src/input/input_mms.c6
-rw-r--r--src/input/input_net.c7
-rw-r--r--src/input/input_plugin.h5
-rw-r--r--src/input/input_pnm.c2
-rw-r--r--src/input/input_rtsp.c2
-rw-r--r--src/input/input_stdin_fifo.c8
-rw-r--r--src/input/librtsp/rtsp_session.c12
-rw-r--r--src/input/librtsp/rtsp_session.h4
-rw-r--r--src/input/mms.c12
-rw-r--r--src/input/mms.h4
-rw-r--r--src/input/mmsh.c12
-rw-r--r--src/input/mmsh.h4
-rw-r--r--src/input/pnm.c12
-rw-r--r--src/input/pnm.h4
16 files changed, 59 insertions, 46 deletions
diff --git a/src/input/input_gnome_vfs.c b/src/input/input_gnome_vfs.c
index ff45b2d4e..c46b86222 100644
--- a/src/input/input_gnome_vfs.c
+++ b/src/input/input_gnome_vfs.c
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_gnome_vfs.c,v 1.2 2003/01/13 20:10:23 hadess Exp $
+ * $Id: input_gnome_vfs.c,v 1.3 2003/01/31 14:06:12 miguelfreitas Exp $
*/
@@ -37,8 +37,6 @@
#define D(x...) g_message (x)
#define LOG
-#define PREVIEW_SIZE 16384
-
typedef struct {
input_class_t input_class;
xine_t *xine;
@@ -56,7 +54,7 @@ typedef struct {
GnomeVFSHandle *sub;
/* Preview */
- char preview[PREVIEW_SIZE];
+ char preview[MAX_PREVIEW_SIZE];
off_t preview_size;
off_t preview_pos;
} gnomevfs_input_t;
diff --git a/src/input/input_http.c b/src/input/input_http.c
index 102dd5e96..9b21dde3d 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -45,7 +45,6 @@
#define LOG
*/
-#define PREVIEW_SIZE 2200
#define BUFSIZE 1024
#define DEFAULT_HTTP_PORT 80
@@ -82,7 +81,7 @@ typedef struct {
char *proxyhost;
int proxyport;
- char preview[PREVIEW_SIZE];
+ char preview[MAX_PREVIEW_SIZE];
off_t preview_size;
off_t preview_pos;
@@ -888,7 +887,7 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *strea
*/
this->preview_size = http_plugin_read (&this->input_plugin, this->preview,
- PREVIEW_SIZE);
+ MAX_PREVIEW_SIZE);
this->preview_pos = 0;
this->curpos = 0;
diff --git a/src/input/input_mms.c b/src/input/input_mms.c
index d40a564ec..07aa09b2f 100644
--- a/src/input/input_mms.c
+++ b/src/input/input_mms.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_mms.c,v 1.34 2003/01/18 17:19:45 tmattern Exp $
+ * $Id: input_mms.c,v 1.35 2003/01/31 14:06:13 miguelfreitas Exp $
*
* mms input plugin based on work from major mms
*/
@@ -290,10 +290,10 @@ static int mms_plugin_get_optional_data (input_plugin_t *this_gen,
case INPUT_OPTIONAL_DATA_PREVIEW:
switch (this->protocol) {
case PROTOCOL_MMST:
- return mms_peek_header (this->mms, data);
+ return mms_peek_header (this->mms, data, MAX_PREVIEW_SIZE);
break;
case PROTOCOL_MMSH:
- return mmsh_peek_header (this->mmsh, data);
+ return mmsh_peek_header (this->mmsh, data, MAX_PREVIEW_SIZE);
break;
}
break;
diff --git a/src/input/input_net.c b/src/input/input_net.c
index 7e37b625a..a6c72f0dc 100644
--- a/src/input/input_net.c
+++ b/src/input/input_net.c
@@ -20,7 +20,7 @@
* Read from a tcp network stream over a lan (put a tweaked mp1e encoder the
* other end and you can watch tv anywhere in the house ..)
*
- * $Id: input_net.c,v 1.41 2002/12/27 16:47:11 miguelfreitas Exp $
+ * $Id: input_net.c,v 1.42 2003/01/31 14:06:13 miguelfreitas Exp $
*
* how to set up mp1e for use with this plugin:
*
@@ -75,7 +75,6 @@
*/
#define NET_BS_LEN 2324
-#define PREVIEW_SIZE 2200
#define BUFSIZE 1024
typedef struct {
@@ -86,7 +85,7 @@ typedef struct {
int fh;
char *mrl;
- char preview[PREVIEW_SIZE];
+ char preview[MAX_PREVIEW_SIZE];
off_t preview_size;
off_t preview_pos;
@@ -361,7 +360,7 @@ static input_plugin_t *net_plugin_open (input_class_t *cls_gen, xine_stream_t *s
this->preview_pos = 0;
this->preview_size = 0;
- this->preview_size = read (this->fh, this->preview, PREVIEW_SIZE);
+ this->preview_size = read (this->fh, this->preview, MAX_PREVIEW_SIZE);
this->preview_pos = 0;
this->curpos = 0;
diff --git a/src/input/input_plugin.h b/src/input/input_plugin.h
index 2bd26461b..d66b97939 100644
--- a/src/input/input_plugin.h
+++ b/src/input/input_plugin.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_plugin.h,v 1.43 2002/12/29 16:48:35 mroi Exp $
+ * $Id: input_plugin.h,v 1.44 2003/01/31 14:06:15 miguelfreitas Exp $
*/
#ifndef HAVE_INPUT_PLUGIN_H
@@ -232,6 +232,8 @@ struct input_plugin_s {
* they can handle the stream or not. the preview data must
* be buffered and delivered again through subsequent
* read() calls.
+ * caller must provide a buffer allocated with at least
+ * MAX_PREVIEW_SIZE bytes.
*/
#define INPUT_CAP_PREVIEW 0x00000040
@@ -256,6 +258,7 @@ struct input_plugin_s {
#define INPUT_OPTIONAL_DATA_PREVIEW 7
#define MAX_MRL_ENTRIES 255
+#define MAX_PREVIEW_SIZE 4096
/* Types of mrls returned by get_dir() */
#define mrl_unknown (0 << 0)
diff --git a/src/input/input_pnm.c b/src/input/input_pnm.c
index 3d75c0ac9..ce62a81d8 100644
--- a/src/input/input_pnm.c
+++ b/src/input/input_pnm.c
@@ -200,7 +200,7 @@ static int pnm_plugin_get_optional_data (input_plugin_t *this_gen,
switch (data_type) {
case INPUT_OPTIONAL_DATA_PREVIEW:
- return pnm_peek_header(this->pnm, data);
+ return pnm_peek_header(this->pnm, data, MAX_PREVIEW_SIZE);
break;
}
diff --git a/src/input/input_rtsp.c b/src/input/input_rtsp.c
index cf5ecab57..dff1aa851 100644
--- a/src/input/input_rtsp.c
+++ b/src/input/input_rtsp.c
@@ -205,7 +205,7 @@ static int rtsp_plugin_get_optional_data (input_plugin_t *this_gen,
switch (data_type) {
case INPUT_OPTIONAL_DATA_PREVIEW:
- return rtsp_session_peek_header(this->rtsp, data);
+ return rtsp_session_peek_header(this->rtsp, data, MAX_PREVIEW_SIZE);
break;
}
diff --git a/src/input/input_stdin_fifo.c b/src/input/input_stdin_fifo.c
index d25aba0fe..21dca4bcc 100644
--- a/src/input/input_stdin_fifo.c
+++ b/src/input/input_stdin_fifo.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_stdin_fifo.c,v 1.41 2003/01/17 17:50:20 mroi Exp $
+ * $Id: input_stdin_fifo.c,v 1.42 2003/01/31 14:06:16 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -41,8 +41,6 @@
#define LOG
*/
-#define PREVIEW_SIZE 2200
-
#define DEFAULT_LOW_WATER_MARK 1
#define DEFAULT_HIGH_WATER_MARK 5
@@ -55,7 +53,7 @@ typedef struct {
char *mrl;
off_t curpos;
- char preview[PREVIEW_SIZE];
+ char preview[MAX_PREVIEW_SIZE];
off_t preview_size;
off_t preview_pos;
@@ -337,7 +335,7 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *strea
*/
this->preview_size = stdin_plugin_read (&this->input_plugin, this->preview,
- PREVIEW_SIZE);
+ MAX_PREVIEW_SIZE);
this->preview_pos = 0;
return &this->input_plugin;
diff --git a/src/input/librtsp/rtsp_session.c b/src/input/librtsp/rtsp_session.c
index 145cfe00d..a6d5ab1d6 100644
--- a/src/input/librtsp/rtsp_session.c
+++ b/src/input/librtsp/rtsp_session.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: rtsp_session.c,v 1.7 2002/12/24 01:10:53 holstsn Exp $
+ * $Id: rtsp_session.c,v 1.8 2003/01/31 14:06:17 miguelfreitas Exp $
*
* high level interface to rtsp servers.
*/
@@ -168,10 +168,14 @@ int rtsp_session_read (rtsp_session_t *this, char *data, int len) {
return len;
}
-int rtsp_session_peek_header(rtsp_session_t *this, char *buf) {
+int rtsp_session_peek_header(rtsp_session_t *this, char *buf, int maxsize) {
- memcpy(buf, this->header, this->header_len);
- return this->header_len;
+ int len;
+
+ len = (this->header_len < maxsize) ? this->header_len : maxsize;
+
+ memcpy(buf, this->header, len);
+ return len;
}
void rtsp_session_end(rtsp_session_t *session) {
diff --git a/src/input/librtsp/rtsp_session.h b/src/input/librtsp/rtsp_session.h
index d3daa4286..c287118e3 100644
--- a/src/input/librtsp/rtsp_session.h
+++ b/src/input/librtsp/rtsp_session.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: rtsp_session.h,v 1.3 2002/12/24 01:10:53 holstsn Exp $
+ * $Id: rtsp_session.h,v 1.4 2003/01/31 14:06:18 miguelfreitas Exp $
*
* high level interface to rtsp servers.
*/
@@ -31,7 +31,7 @@ rtsp_session_t *rtsp_session_start(char *mrl);
int rtsp_session_read(rtsp_session_t *session, char *data, int len);
-int rtsp_session_peek_header(rtsp_session_t *this, char *buf);
+int rtsp_session_peek_header(rtsp_session_t *this, char *buf, int maxsize);
void rtsp_session_end(rtsp_session_t *session);
diff --git a/src/input/mms.c b/src/input/mms.c
index 8afb68ac0..6b5545577 100644
--- a/src/input/mms.c
+++ b/src/input/mms.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: mms.c,v 1.19 2003/01/25 15:00:07 tmattern Exp $
+ * $Id: mms.c,v 1.20 2003/01/31 14:06:17 miguelfreitas Exp $
*
* based on work from major mms
* utility functions to handle communication with an mms server
@@ -1133,10 +1133,14 @@ static int get_media_packet (mms_t *this) {
return 1;
}
-int mms_peek_header (mms_t *this, char *data) {
+int mms_peek_header (mms_t *this, char *data, int maxsize) {
- memcpy (data, this->asf_header, this->asf_header_len);
- return this->asf_header_len;
+ int len;
+
+ len = (this->asf_header_len < maxsize) ? this->asf_header_len : maxsize;
+
+ memcpy(data, this->asf_header, len);
+ return len;
}
int mms_read (mms_t *this, char *data, int len) {
diff --git a/src/input/mms.h b/src/input/mms.h
index 3bb3b2358..565b89b65 100644
--- a/src/input/mms.h
+++ b/src/input/mms.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: mms.h,v 1.8 2002/12/13 08:56:53 f1rmb Exp $
+ * $Id: mms.h,v 1.9 2003/01/31 14:06:17 miguelfreitas Exp $
*
* libmms public header
*/
@@ -37,7 +37,7 @@ int mms_read (mms_t *this, char *data, int len);
uint32_t mms_get_length (mms_t *this);
void mms_close (mms_t *this);
-int mms_peek_header (mms_t *this, char *data);
+int mms_peek_header (mms_t *this, char *data, int maxsize);
#endif
diff --git a/src/input/mmsh.c b/src/input/mmsh.c
index 1f909fd5c..db3a256c2 100644
--- a/src/input/mmsh.c
+++ b/src/input/mmsh.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: mmsh.c,v 1.9 2003/01/25 15:00:10 tmattern Exp $
+ * $Id: mmsh.c,v 1.10 2003/01/31 14:06:17 miguelfreitas Exp $
*
* based on mms.c and specs from avifile
* (http://avifile.sourceforge.net/asf-1.0.htm)
@@ -1022,10 +1022,14 @@ static int get_media_packet (mmsh_t *this) {
}
}
-int mmsh_peek_header (mmsh_t *this, char *data) {
+int mmsh_peek_header (mmsh_t *this, char *data, int maxsize) {
- memcpy (data, this->asf_header, this->asf_header_len);
- return this->asf_header_len;
+ int len;
+
+ len = (this->asf_header_len < maxsize) ? this->asf_header_len : maxsize;
+
+ memcpy(data, this->asf_header, len);
+ return len;
}
int mmsh_read (mmsh_t *this, char *data, int len) {
diff --git a/src/input/mmsh.h b/src/input/mmsh.h
index 6005851a5..29ad2bf55 100644
--- a/src/input/mmsh.h
+++ b/src/input/mmsh.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: mmsh.h,v 1.1 2003/01/13 01:11:57 tmattern Exp $
+ * $Id: mmsh.h,v 1.2 2003/01/31 14:06:17 miguelfreitas Exp $
*
* libmmsh public header
*/
@@ -37,6 +37,6 @@ int mmsh_read (mmsh_t *this, char *data, int len);
uint32_t mmsh_get_length (mmsh_t *this);
void mmsh_close (mmsh_t *this);
-int mmsh_peek_header (mmsh_t *this, char *data);
+int mmsh_peek_header (mmsh_t *this, char *data, int maxsize);
#endif
diff --git a/src/input/pnm.c b/src/input/pnm.c
index eb1a1c47a..d0a9b0c9e 100644
--- a/src/input/pnm.c
+++ b/src/input/pnm.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: pnm.c,v 1.10 2003/01/22 16:33:24 holstsn Exp $
+ * $Id: pnm.c,v 1.11 2003/01/31 14:06:17 miguelfreitas Exp $
*
* pnm protocol implementation
* based upon code from joschka
@@ -930,10 +930,14 @@ int pnm_read (pnm_t *this, char *data, int len) {
return len;
}
-int pnm_peek_header (pnm_t *this, char *data) {
+int pnm_peek_header (pnm_t *this, char *data, int maxsize) {
- memcpy (data, this->header, this->header_len);
- return this->header_len;
+ int len;
+
+ len = (this->header_len < maxsize) ? this->header_len : maxsize;
+
+ memcpy(data, this->header, len);
+ return len;
}
void pnm_close(pnm_t *p) {
diff --git a/src/input/pnm.h b/src/input/pnm.h
index a2fb68539..1d4c54698 100644
--- a/src/input/pnm.h
+++ b/src/input/pnm.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: pnm.h,v 1.2 2002/12/12 22:08:15 holstsn Exp $
+ * $Id: pnm.h,v 1.3 2003/01/31 14:06:17 miguelfreitas Exp $
*
* pnm util functions header by joschka
*/
@@ -37,7 +37,7 @@ pnm_t* pnm_connect (const char *url);
int pnm_read (pnm_t *this, char *data, int len);
void pnm_close (pnm_t *this);
-int pnm_peek_header (pnm_t *this, char *data);
+int pnm_peek_header (pnm_t *this, char *data, int maxsize);
#endif