Commit 34f23746 authored by Sam Hocevar's avatar Sam Hocevar

* modules/control/corba/: Olivier Aubert's CORBA plugin. Almost verbatim,

    compiles cleanly (to build the medicacontrol.so library you need to cd to
    that directory and "make medicacontrol.so") but untested.
  * src/playlist/playlist.c: Mostly harmless fix to playlist.c suggested by
    Olivier.
parent 76bbfbac
dnl Autoconf settings for vlc dnl Autoconf settings for vlc
dnl $Id: configure.ac,v 1.26 2003/07/07 14:56:22 massiot Exp $ dnl $Id: configure.ac,v 1.27 2003/07/07 16:59:00 sam Exp $
AC_INIT(vlc,0.6.0) AC_INIT(vlc,0.6.0)
...@@ -2930,6 +2930,37 @@ then ...@@ -2930,6 +2930,37 @@ then
fi fi
fi fi
dnl
dnl corba (ORBit) plugin
dnl
AC_ARG_ENABLE(corba,
[ --enable-corba corba interface support (default disabled)])
if test "${enable_corba}" = "yes"; then
ORBIT_PATH="${PATH}"
AC_ARG_WITH(orbit-config-path,
[ --with-orbit-config-path=PATH orbit-config path (default search in \$PATH)])
if test "${with_orbit_config_path}" != "no"; then
ORBIT_PATH="${with_orbit_config_path}:${PATH}"
fi
# look for orbit2-config
AC_PATH_PROG(ORBIT_CONFIG, orbit2-config, no, ${ORBIT_PATH})
if test "${ORBIT_CONFIG}" != "no"; then
AX_ADD_CFLAGS(corba,[`${ORBIT_CONFIG} --cflags server`])
AX_ADD_LDFLAGS(corba,[`${ORBIT_CONFIG} --libs server | sed 's,-rdynamic,,'`])
# now look for the orbit.h header
CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_corba}"
ac_cv_corba_headers=yes
AC_CHECK_HEADERS(orbit/orbit.h, , [
ac_cv_corba_headers=no
AC_MSG_ERROR([Could not find corba development headers])
])
if test "${ac_cv_corba_headers}" = "yes"; then
AX_ADD_PLUGINS(corba)
fi
CPPFLAGS="${CPPFLAGS_save}"
fi
fi
AC_ARG_WITH(,[Misc options:]) AC_ARG_WITH(,[Misc options:])
dnl dnl
...@@ -3237,6 +3268,7 @@ AC_OUTPUT([ ...@@ -3237,6 +3268,7 @@ AC_OUTPUT([
modules/codec/mpeg_video/motion/Makefile modules/codec/mpeg_video/motion/Makefile
modules/codec/spudec/Makefile modules/codec/spudec/Makefile
modules/control/Makefile modules/control/Makefile
modules/control/corba/Makefile
modules/control/lirc/Makefile modules/control/lirc/Makefile
modules/control/rc/Makefile modules/control/rc/Makefile
modules/demux/Makefile modules/demux/Makefile
......
.deps
.dirstamp
*.lo
*.la
*.dll
*.dylib
*.sl
*.so
Makefile.am
Makefile.in
Makefile
## corba module declaration
SOURCES_corba = corba.c
nodist_SOURCES_corba = \
mediacontrol-common.c \
mediacontrol-skels.c \
mediacontrol.h \
$(NULL)
ORBITIDL = orbit-idl-2
mediacontrol-common.c mediacontrol-skels.c mediacontrol-stubs.c mediacontrol.h:
$(ORBITIDL) --skeleton-impl mediacontrol.idl
mediacontrol-imodule.c:
$(ORBITIDL) --imodule mediacontrol.idl
mediacontrol.so: mediacontrol-imodule.c
gcc -fPIC -o mediacontrol-imodule.o -c mediacontrol-imodule.c `pkg-config --cflags ORBit-2.0`
gcc -shared -o $@ mediacontrol-imodule.o `pkg-config --libs ORBit-2.0`
clean:
rm -f mediacontrol-stubs.c mediacontrol-imodule.c mediacontrol-skelimpl.c
$Id: README,v 1.1 2003/07/07 16:59:00 sam Exp $
* Module (server) side
** Dependencies
To compile the CORBA plugin, you need the orbit2 developpement files
(for Debian, install the package liborbi2-dev)
** How to run it ?
You run the CORBA module with the following command line :
vlc --intf corba
The CORBA module is initialized and saves its IOR into the file
/tmp/vlc-ior.ref
* Client side
A sample client application is provided, using python-orbit
** Dependencies
The python client uses the pyorbit library developped by James
Henstridge <james at daa dot com dot au> (source:
http://ftp.gnome.org/pub/GNOME/sources/pyorbit/1.99/pyorbit-1.99.3.tar.gz).
To interoperate with gtk, the original pyorbit-1.99.3 needs a patch to
implement the bindings to OR_work_pending and ORB_perform_work (see
pyorbit-1.99.3.patch)
The gtk simpleplayer example uses the python-glade module by James
Henstridge.
** Typelib information
To simply access the server, you do not need any reference to the IDL
(CORBA2.0 provides introspection facilities). However, if you want to
use the structures defined in the IDL (Position, Origin, ...), you
need to use the IDL information, and compile a dynamic lib
(MediaControl.so) from the IDL.
To build the library, you can use the Makefile :
make corba-generate-typelib
which will generate MediaControl.so
* Interesting pointers
- GLib reference manual
http://developer.gnome.org/doc/API/glib/
- IDL quickref :
http://www.cs.rpi.edu/~musser/dsc/idl/idl-overview.html
- Python-Bonobo
http://www.pycage.de/howto_bonobo.html
* How to add the module to the original sources (vlc-0.5.x) :
- copy the directory modules/control/corba
- add configuration lines relative to corba in configure.ac.in
- add a reference to control/corba/Modules.am in
modules/Makefile.am
#! /usr/bin/python
# Simple CLI client for the corba module of vlc. Depends on pyorbit.
# Best used with IPython (completion, ...)
import sys
import ORBit, CORBA
def quit ():
try:
mc.exit()
except:
pass
print "Chargement de l'IDL"
ORBit.load_typelib ("./MediaControl.so")
import VLC
if len(sys.argv) < 1:
print "Usage: %s" % sys.argv[0]
sys.exit(1)
print "Initialisation de l'ORB"
orb = CORBA.ORB_init()
ior = open("/tmp/vlc-ior.ref").readline()
mc = orb.string_to_object(ior)
print "Objet mc %s" % mc
pos = mc.get_media_position (0,0)
print "pos = mc.get_media_position (0,0)"
print pos
This diff is collapsed.
#! /bin/sh
# Helper prog
VLCPATH=/usr/local/src/vlc
cd $VLCPATH
${VLCPATH}/vlc --intf corba &
exit 0
/* Cf
http://www.cs.rpi.edu/~musser/dsc/idl/idl-overview.html
pour une intro à la syntaxe */
module VLC {
enum PositionOrigin {
AbsolutePosition, RelativePosition, ModuloPosition
};
enum PositionKey {
ByteCount, SampleCount, MediaTime
};
struct Position {
PositionOrigin origin;
PositionKey key;
long value;
};
exception PositionKeyNotSupported { PositionKey key;};
exception InvalidPosition { PositionKey key;};
typedef sequence<string> PlaylistSeq;
// MediaControl interface is similar to
// ControlledStream interface in MSS.
// It can be inherited by flow endpoints or
// FlowConnection interfaces.
interface MediaControl
{
exception PositionKeyNotSupported { PositionKey key;};
Position get_media_position(
in PositionOrigin an_origin,
in PositionKey a_key)
raises (PositionKeyNotSupported);
void set_media_position(in Position a_position)
raises (PositionKeyNotSupported, InvalidPosition);
void start(in Position a_position)
raises(InvalidPosition);
void pause(in Position a_position)
raises(InvalidPosition);
void resume(in Position a_position)
raises(InvalidPosition);
void stop(in Position a_position)
raises(InvalidPosition);
void exit (); // Exits the player (not in the original spec)
void add_to_playlist (in string a_file);
// Returns the list of files in playlist
PlaylistSeq get_playlist ();
};
};
--- pyorbit-1.99.3/src/pycorba-orb.c 2002-11-16 07:51:41.000000000 +0100
+++ pyorbit-1.99.3-modif/src/pycorba-orb.c 2003-01-22 14:43:30.000000000 +0100
@@ -154,6 +154,36 @@
return Py_None;
}
+static PyObject *
+pycorba_orb_work_pending(PyCORBA_ORB *self)
+{
+ CORBA_boolean ret;
+ CORBA_Environment ev;
+ PyObject *py_ret;
+
+ CORBA_exception_init(&ev);
+ ret = CORBA_ORB_work_pending (self->orb, &ev);
+
+ if (pyorbit_check_ex(&ev))
+ return NULL;
+ py_ret = ret ? Py_True : Py_False;
+ Py_INCREF(py_ret);
+ return py_ret;
+}
+
+static PyObject *
+pycorba_orb_perform_work (PyCORBA_ORB *self)
+{
+ CORBA_Environment ev;
+
+ CORBA_exception_init(&ev);
+ CORBA_ORB_perform_work (self->orb, &ev);
+ if (pyorbit_check_ex(&ev))
+ return NULL;
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
static PyMethodDef pycorba_orb_methods[] = {
{ "object_to_string", (PyCFunction)pycorba_orb_object_to_string, METH_VARARGS },
{ "string_to_object", (PyCFunction)pycorba_orb_string_to_object, METH_VARARGS },
@@ -161,6 +191,8 @@
{ "resolve_initial_references", (PyCFunction)pycorba_orb_resolve_initial_references, METH_VARARGS },
{ "run", (PyCFunction)pycorba_orb_run, METH_NOARGS },
{ "shutdown", (PyCFunction)pycorba_orb_shutdown, METH_VARARGS },
+ { "work_pending", (PyCFunction)pycorba_orb_work_pending, METH_VARARGS },
+ { "perform_work", (PyCFunction)pycorba_orb_perform_work, METH_VARARGS },
{ NULL, NULL, 0 }
};
This diff is collapsed.
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions * playlist.c : Playlist management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: playlist.c,v 1.40 2003/06/27 13:38:54 sam Exp $ * $Id: playlist.c,v 1.41 2003/07/07 16:59:00 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -412,6 +412,7 @@ void playlist_Command( playlist_t * p_playlist, int i_command, int i_arg ) ...@@ -412,6 +412,7 @@ void playlist_Command( playlist_t * p_playlist, int i_command, int i_arg )
p_playlist->i_status = PLAYLIST_RUNNING; p_playlist->i_status = PLAYLIST_RUNNING;
if( p_playlist->p_input ) if( p_playlist->p_input )
{ {
PlayItem( p_playlist );
input_SetStatus( p_playlist->p_input, INPUT_STATUS_PLAY ); input_SetStatus( p_playlist->p_input, INPUT_STATUS_PLAY );
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment