]> git.sesse.net Git - vlc/commitdiff
* all: some helpers functions for pf_demux_control.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 2 Aug 2003 16:43:59 +0000 (16:43 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 2 Aug 2003 16:43:59 +0000 (16:43 +0000)
Makefile.am
include/ninput.h
src/input/demux.c [new file with mode: 0644]

index 62c17d7beb33532173bf4e2eebd522424d5f886d..898f51649292d2a568e8db3482afd14a5519d562 100644 (file)
@@ -292,6 +292,7 @@ SOURCES_libvlc_common = \
        src/playlist/playlist.c \
        src/input/input.c \
        src/input/stream.c \
+       src/input/demux.c \
        src/input/input_ext-plugins.c \
        src/input/input_ext-dec.c \
        src/input/input_ext-intf.c \
index 42edaac973ce686f7dd3003062be5ffe165d95a8..baef50924a2e0288573fc861731dcf41db3b656c 100644 (file)
@@ -2,7 +2,7 @@
  * ninput.h
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: ninput.h,v 1.1 2003/08/01 00:00:12 fenrir Exp $
+ * $Id: ninput.h,v 1.2 2003/08/02 16:43:59 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -25,7 +25,8 @@
 #define _NINPUT_H 1
 
 /*
- * stream
+ * Stream
+ *
  */
 enum streamQuery_e
 {
@@ -40,6 +41,22 @@ enum streamQuery_e
     STREAM_GET_SIZE,            /* arg1= int64_t *      res=cannot fail (0 if no sense)*/
 };
 
+/*
+ * Demux
+ *
+ */
+#define DEMUX_POSITION_MAX  10000
+enum demuxQuery_e
+{
+    DEMUX_GET_POSITION,         /* arg1= int64_t *      res=    */
+    DEMUX_SET_POSITION,         /* arg1= int64_t        res=can fail    */
+
+    DEMUX_GET_TIME,             /* arg1= int64_t *      res=    */
+    DEMUX_SET_TIME,             /* arg1= int64_t        res=can fail    */
+
+    DEMUX_GET_LENGTH            /* arg1= int64_t *      res=can fail    */
+};
+
 
 VLC_EXPORT( stream_t *,     stream_OpenInput,       ( input_thread_t * ) );
 VLC_EXPORT( void,           stream_Release,         ( stream_t * ) );
@@ -50,5 +67,8 @@ VLC_EXPORT( int,            stream_Peek,            ( stream_t *, uint8_t **, in
 
 VLC_EXPORT( pes_packet_t *, stream_PesPacket,       ( stream_t *, int ) );
 
+VLC_EXPORT( int,            demux_vaControl,        ( input_thread_t *, int, va_list  ) );
+VLC_EXPORT( int,            demux_Control,          ( input_thread_t *, int, ...  ) );
+
 #endif
 
diff --git a/src/input/demux.c b/src/input/demux.c
new file mode 100644 (file)
index 0000000..567eaed
--- /dev/null
@@ -0,0 +1,50 @@
+/*****************************************************************************
+ * demux.c
+ *****************************************************************************
+ * Copyright (C) 1999-2003 VideoLAN
+ * $Id: demux.c,v 1.1 2003/08/02 16:43:59 fenrir Exp $
+ *
+ * Authors: Laurent Aimar <fenrir@via.ecp.fr>
+ *
+ * This program 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.
+ *
+ * This program 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, USA.
+ *****************************************************************************/
+
+#include <stdlib.h>
+#include <vlc/vlc.h>
+#include <vlc/input.h>
+
+#include "ninput.h"
+
+int  demux_vaControl( input_thread_t *p_input, int i_query, va_list args )
+{
+    if( p_input->pf_demux_control )
+    {
+        return p_input->pf_demux_control( p_input, i_query, args );
+    }
+    return VLC_EGENERIC;
+}
+
+int  demux_Control  ( input_thread_t *p_input, int i_query, ...  )
+{
+    va_list args;
+    int     i_result;
+
+    va_start( args, i_query );
+    i_result = demux_vaControl( p_input, i_query, args );
+    va_end( args );
+
+    return i_result;
+}
+