about 2000 lines of code.
I could not test everything on every architecture, so please report
any module breakage (especially on BeOS, OSX and QNX).
-List of known vlc bugs $Id: BUGS,v 1.14 2002/06/01 12:31:57 sam Exp $
+List of known vlc bugs $Id: BUGS,v 1.15 2002/07/31 20:56:50 sam Exp $
Please try to keep this file up to date. Also, grep for FIXME in the
source files for more and more bugs to fix.
* DVD raw device support doesn't seem to work.
+ * Going to title 0 with the dvdold or dvdread plugins segfaults (tested
+ with Nausicaa).
+
Decoders:
* On-the-fly resizing when using a chroma transformation doesn't work for
all plugins. Currently it is only implemented for x11 and SDL.
+ * --filter clone gives a slanted picture on axe.mpeg
+ * --filter transform barfs on rambo.avi
+
+
Chroma transformations:
* Most chroma transformation modules completely ignore margins.
builtins-install:
mkdir -p $(DESTDIR)$(libdir)/vlc
ifneq (,$(BUILTINS))
- $(INSTALL) $(BUILTINS:%=plugins/%.a) $(DESTDIR)$(libdir)/vlc
+ $(INSTALL) -m 644 $(BUILTINS:%=plugins/%.a) $(DESTDIR)$(libdir)/vlc
endif
builtins-uninstall:
@rm -f $@ && cp $@.in $@
ifneq (,$(BUILTINS))
@for i in $(BUILTINS) ; do \
- echo "int InitModule__MODULE_"$$i"( module_t* );" >>$@; \
- echo "int ActivateModule__MODULE_"$$i"( module_t* );" >>$@; \
- echo "int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@; \
+ echo "int vlc_entry__"$$i"( module_t* );" >>$@; \
done
@echo "" >> $@ ;
endif
mimeset -f $@
endif
-# here are the rules for a dynamic link of libvlc:
-#vlc: Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.so $(BUILTIN_OBJ)
-# $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(builtins_LDFLAGS) -L./lib -lvlc
-
#
# Main library target
#
ar rc $@ $(LIBVLC_OBJ)
$(RANLIB) $@
+#
+# DO NOT DISTRIBUTE SHARED VERSIONS OF LIBVLC UNTIL THE ABI IS STABLE
+# OR BURN IN HELL -- Sam
+#
#lib/libvlc.so: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
# $(CC) -shared $(LIBVLC_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) -o $@
int main() {
/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x = {0,0};
+typedef int charset[2]; const charset x;
/* SunOS 4.1.1 cc rejects this. */
char const *const *ccp;
char **p;
#include "confdefs.h"
int main() {
-} int $ac_kw foo() {
+} $ac_kw foo() {
; return 0; }
EOF
if { (eval echo configure:1609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
#include "confdefs.h"
#include <alloca.h>
int main() {
-void *p = alloca(2 * sizeof(int));
+char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
if { (eval echo configure:1715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
#include <sys/types.h>
#include <fcntl.h>
#include <sys/mman.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
/* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
/* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H
/*
* First, make a file with some known garbage in it.
*/
- data = (char*)malloc(pagesize);
+ data = malloc(pagesize);
if (!data)
exit(1);
for (i = 0; i < pagesize; ++i)
fd = open("conftestmmap", O_RDWR);
if (fd < 0)
exit(1);
- data2 = (char*)malloc(2 * pagesize);
+ data2 = malloc(2 * pagesize);
if (!data2)
exit(1);
data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
*/
for (i = 0; i < pagesize; ++i)
*(data2 + i) = *(data2 + i) + 1;
- data3 = (char*)malloc(pagesize);
+ data3 = malloc(pagesize);
if (!data3)
exit(1);
if (read(fd, data3, pagesize) != pagesize)
}
EOF
-if { (eval echo configure:2181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
echo $ac_n "checking whether we are using the GNU C Library 2.1 or newer""... $ac_c" 1>&6
-echo "configure:2205: checking whether we are using the GNU C Library 2.1 or newer" >&5
+echo "configure:2202: checking whether we are using the GNU C Library 2.1 or newer" >&5
if eval "test \"`echo '$''{'ac_cv_gnu_library_2_1'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2210 "configure"
+#line 2207 "configure"
#include "confdefs.h"
#include <features.h>
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2246: checking for $ac_hdr" >&5
+echo "configure:2243: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2251 "configure"
+#line 2248 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
strdup strtoul tsearch __argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2287: checking for $ac_func" >&5
+echo "configure:2284: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2292 "configure"
+#line 2289 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:2315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:2355: checking for iconv" >&5
+echo "configure:2352: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
-#line 2363 "configure"
+#line 2360 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:2373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_func_iconv=yes
else
am_save_LIBS="$LIBS"
LIBS="$LIBS -liconv"
cat > conftest.$ac_ext <<EOF
-#line 2385 "configure"
+#line 2382 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:2395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_lib_iconv=yes
am_cv_func_iconv=yes
EOF
echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:2416: checking for iconv declaration" >&5
+echo "configure:2413: checking for iconv declaration" >&5
if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2422 "configure"
+#line 2419 "configure"
#include "confdefs.h"
#include <stdlib.h>
; return 0; }
EOF
-if { (eval echo configure:2441: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2438: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_proto_iconv_arg1=""
else
echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6
-echo "configure:2470: checking for nl_langinfo and CODESET" >&5
+echo "configure:2467: checking for nl_langinfo and CODESET" >&5
if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2475 "configure"
+#line 2472 "configure"
#include "confdefs.h"
#include <langinfo.h>
int main() {
char* cs = nl_langinfo(CODESET);
; return 0; }
EOF
-if { (eval echo configure:2482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_langinfo_codeset=yes
else
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:2505: checking for LC_MESSAGES" >&5
+echo "configure:2502: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2510 "configure"
+#line 2507 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:2517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:2538: checking whether NLS is requested" >&5
+echo "configure:2535: checking whether NLS is requested" >&5
# Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
enableval="$enable_nls"
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:2560: checking whether included gettext is requested" >&5
+echo "configure:2557: checking whether included gettext is requested" >&5
# Check whether --with-included-gettext or --without-included-gettext was given.
if test "${with_included_gettext+set}" = set; then
withval="$with_included_gettext"
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:2580: checking for libintl.h" >&5
+echo "configure:2577: checking for libintl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2585 "configure"
+#line 2582 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2590: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for GNU gettext in libc""... $ac_c" 1>&6
-echo "configure:2607: checking for GNU gettext in libc" >&5
+echo "configure:2604: checking for GNU gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2612 "configure"
+#line 2609 "configure"
#include "confdefs.h"
#include <libintl.h>
extern int _nl_msg_cat_cntr;
return (int) gettext ("") + _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:2621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gnugettext1_libc=yes
else
if test "$gt_cv_func_gnugettext1_libc" != "yes"; then
echo $ac_n "checking for GNU gettext in libintl""... $ac_c" 1>&6
-echo "configure:2637: checking for GNU gettext in libintl" >&5
+echo "configure:2634: checking for GNU gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
gt_save_LIBS="$LIBS"
LIBS="$LIBS -lintl $LIBICONV"
cat > conftest.$ac_ext <<EOF
-#line 2644 "configure"
+#line 2641 "configure"
#include "confdefs.h"
#include <libintl.h>
extern int _nl_msg_cat_cntr;
return (int) gettext ("") + _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gnugettext1_libintl=yes
else
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2686: checking for $ac_func" >&5
+echo "configure:2683: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2691 "configure"
+#line 2688 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:2714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2743: checking for $ac_word" >&5
+echo "configure:2740: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2777: checking for $ac_word" >&5
+echo "configure:2774: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2814: checking for $ac_word" >&5
+echo "configure:2811: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2864: checking for $ac_word" >&5
+echo "configure:2861: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2898: checking for $ac_word" >&5
+echo "configure:2895: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2934: checking for $ac_word" >&5
+echo "configure:2931: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3005: checking for $ac_word" >&5
+echo "configure:3002: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_INTLBISON'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_verc_fail=yes
else
echo $ac_n "checking version of bison""... $ac_c" 1>&6
-echo "configure:3038: checking version of bison" >&5
+echo "configure:3035: checking version of bison" >&5
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:3085: checking for catalogs to be installed" >&5
+echo "configure:3082: checking for catalogs to be installed" >&5
NEW_LINGUAS=
for presentlang in $ALL_LINGUAS; do
useit=no
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:3137: checking for a BSD compatible install" >&5
+echo "configure:3134: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
# Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
set dummy ${ac_tool_prefix}windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3219: checking for $ac_word" >&5
+echo "configure:3216: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "windres", so it can be a program name with args.
set dummy windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3251: checking for $ac_word" >&5
+echo "configure:3248: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
x11_LDFLAGS="${x11_LDFLAGS} -lsocket"
xvideo_LDFLAGS="${xvideo_LDFLAGS} -lsocket"
;;
+ xsolaris*)
+ SYS=solaris
+ ;;
xbeos)
SYS=beos
save_CFLAGS="${save_CFLAGS} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CFLAGS="${save_CFLAGS}"
VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
cat >> confdefs.h <<EOF
-#define MODULE_SUFFIX "__MODULE_${VLC_SYMBOL}"
+#define MODULE_SUFFIX "__${VLC_SYMBOL}"
EOF
cat >> confdefs.h <<EOF
AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
-AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__MODULE_${VLC_SYMBOL}", [String suffix for module functions])
+AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
DATA_PATH="${ac_tool_prefix}/share/videolan"
-- Jack Valenti (president of the MPAA) on April 12, 1982
%
+<Meuuh> then we need to update download.html
+<Meuuh> what do we still have ?
+<sam> the mail, freshmeat, the videolan.org news
+<sam> cvs tag
+<sam> regression tests
+<sam> bwaahahahahahAHAHAHA
+<Meuuh> mouhahaha
+
+ -- #videolan
+%
* ac3_downmix.h : AC3 downmix types
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_downmix.h,v 1.5 2002/07/20 18:01:41 sam Exp $
+ * $Id: ac3_downmix.h,v 1.6 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Renaud Dartus <reno@videolan.org>
struct downmix_t
{
+ VLC_COMMON_MEMBERS
+
/* Module used and shortcuts */
module_t * p_module;
void (*pf_downmix_3f_2r_to_2ch)(float *, dm_par_t * dm_par);
* ac3_imdct.h : AC3 IMDCT types
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_imdct.h,v 1.9 2002/07/20 18:01:41 sam Exp $
+ * $Id: ac3_imdct.h,v 1.10 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Renaud Dartus <reno@videolan.org>
struct imdct_t
{
+ VLC_COMMON_MEMBERS
+
complex_t * buf;
void * buf_orig; /* pointer before memalign */
* audio_output.h : audio output thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: audio_output.h,v 1.49 2002/07/20 18:01:41 sam Exp $
+ * $Id: audio_output.h,v 1.50 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
/* Plugin used and shortcuts to access its capabilities */
module_t * p_module;
- int ( *pf_open ) ( aout_thread_t * );
int ( *pf_setformat ) ( aout_thread_t * );
int ( *pf_getbufinfo ) ( aout_thread_t * , int );
void ( *pf_play ) ( aout_thread_t * , byte_t *, int );
- void ( *pf_close ) ( aout_thread_t * );
void * buffer;
/* The s32 buffer is used to mix all the audio fifos together before
aout_thread_t * aout_CreateThread ( vlc_object_t *, int, int );
void aout_DestroyThread ( aout_thread_t * );
-#define aout_CreateFifo(a,b,c,d,e,f) __aout_CreateFifo(CAST_TO_VLC_OBJECT(a),b,c,d,e,f)
+#define aout_CreateFifo(a,b,c,d,e,f) __aout_CreateFifo(VLC_OBJECT(a),b,c,d,e,f)
VLC_EXPORT( aout_fifo_t *, __aout_CreateFifo, ( vlc_object_t *, int, int, int, int, void * ) );
VLC_EXPORT( void, aout_DestroyFifo, ( aout_fifo_t *p_fifo ) );
void aout_FreeFifo ( aout_fifo_t *p_fifo );
* It includes functions allowing to declare, get or set configuration options.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: configuration.h,v 1.16 2002/07/20 18:01:41 sam Exp $
+ * $Id: configuration.h,v 1.17 2002/07/31 20:56:50 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
struct module_config_t
{
int i_type; /* Configuration type */
+ char *psz_type; /* Configuration subtype */
char *psz_name; /* Option name */
char i_short; /* Optional short option name */
char *psz_text; /* Short comment on the configuration option */
VLC_EXPORT( void, config_SetCallbacks, ( module_config_t *, module_config_t * ) );
VLC_EXPORT( void, config_UnsetCallbacks, ( module_config_t * ) );
-#define config_GetInt(a,b) __config_GetInt(CAST_TO_VLC_OBJECT(a),b)
-#define config_PutInt(a,b,c) __config_PutInt(CAST_TO_VLC_OBJECT(a),b,c)
-#define config_GetFloat(a,b) __config_GetFloat(CAST_TO_VLC_OBJECT(a),b)
-#define config_PutFloat(a,b,c) __config_PutFloat(CAST_TO_VLC_OBJECT(a),b,c)
-#define config_GetPsz(a,b) __config_GetPsz(CAST_TO_VLC_OBJECT(a),b)
-#define config_PutPsz(a,b,c) __config_PutPsz(CAST_TO_VLC_OBJECT(a),b,c)
+#define config_GetInt(a,b) __config_GetInt(VLC_OBJECT(a),b)
+#define config_PutInt(a,b,c) __config_PutInt(VLC_OBJECT(a),b,c)
+#define config_GetFloat(a,b) __config_GetFloat(VLC_OBJECT(a),b)
+#define config_PutFloat(a,b,c) __config_PutFloat(VLC_OBJECT(a),b,c)
+#define config_GetPsz(a,b) __config_GetPsz(VLC_OBJECT(a),b)
+#define config_PutPsz(a,b,c) __config_PutPsz(VLC_OBJECT(a),b,c)
-#define config_LoadCmdLine(a,b,c,d) __config_LoadCmdLine(CAST_TO_VLC_OBJECT(a),b,c,d)
-#define config_LoadConfigFile(a,b) __config_LoadConfigFile(CAST_TO_VLC_OBJECT(a),b)
-#define config_SaveConfigFile(a,b) __config_SaveConfigFile(CAST_TO_VLC_OBJECT(a),b)
+#define config_LoadCmdLine(a,b,c,d) __config_LoadCmdLine(VLC_OBJECT(a),b,c,d)
+#define config_LoadConfigFile(a,b) __config_LoadConfigFile(VLC_OBJECT(a),b)
+#define config_SaveConfigFile(a,b) __config_SaveConfigFile(VLC_OBJECT(a),b)
/*****************************************************************************
* Macros used to build the configuration structure.
* allow for a more user friendly interface.
*****************************************************************************/
-#define MODULE_CONFIG_START \
- static module_config_t p_config[] = {
-#define MODULE_CONFIG_STOP \
- { CONFIG_HINT_END, NULL, '\0' } };
-
-#define ADD_CATEGORY_HINT( text, longtext ) \
- { CONFIG_HINT_CATEGORY, NULL, '\0', text, longtext },
-#define ADD_SUBCATEGORY_HINT( text, longtext ) \
- { CONFIG_HINT_SUBCATEGORY, NULL, '\0', text, longtext },
-#define END_SUBCATEGORY_HINT \
- { CONFIG_HINT_SUBCATEGORY_END, NULL, '\0' },
-#define ADD_USAGE_HINT( text ) \
- { CONFIG_HINT_USAGE, NULL, '\0', text },
-
-#define ADD_STRING( name, psz_value, p_callback, text, longtext ) \
- { CONFIG_ITEM_STRING, name, '\0', text, longtext, psz_value, 0, 0, \
- p_callback },
-#define ADD_STRING_FROM_LIST( name, psz_value, ppsz_list, p_callback, text, \
+#define add_category_hint( text, longtext ) \
+ p_config[ i_config ] = (module_config_t){ CONFIG_HINT_CATEGORY, NULL, NULL, '\0', text, longtext }; i_config++
+#define add_subcategory_hint( text, longtext ) \
+ p_config[ i_config ] = (module_config_t){ CONFIG_HINT_SUBCATEGORY, NULL, NULL, '\0', text, longtext }; i_config++
+#define end_subcategory_hint \
+ p_config[ i_config ] = (module_config_t){ CONFIG_HINT_SUBCATEGORY_END, NULL, NULL, '\0' }; i_config++
+#define add_usage_hint( text ) \
+ p_config[ i_config ] = (module_config_t){ CONFIG_HINT_USAGE, NULL, NULL, '\0', text }; i_config++
+
+#define add_string( name, psz_value, p_callback, text, longtext ) \
+ p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_STRING, NULL, name, '\0', text, longtext, psz_value, 0, 0, p_callback }; i_config++
+#define add_string_from_list( name, psz_value, ppsz_list, p_callback, text, \
longtext ) \
- { CONFIG_ITEM_STRING, name, '\0', text, longtext, psz_value, 0, 0, \
- p_callback, ppsz_list },
-#define ADD_FILE( name, psz_value, p_callback, text, longtext ) \
- { CONFIG_ITEM_FILE, name, '\0', text, longtext, psz_value, 0, 0, \
- p_callback },
-#define ADD_MODULE( name, i_caps, psz_value, p_callback, text, longtext ) \
- { CONFIG_ITEM_MODULE, name, '\0', text, longtext, psz_value, i_caps, 0, \
- p_callback },
-#define ADD_INTEGER( name, i_value, p_callback, text, longtext ) \
- { CONFIG_ITEM_INTEGER, name, '\0', text, longtext, NULL, i_value, 0, \
- p_callback },
-#define ADD_FLOAT( name, f_value, p_callback, text, longtext ) \
- { CONFIG_ITEM_FLOAT, name, '\0', text, longtext, NULL, 0, f_value, \
- p_callback },
-#define ADD_BOOL( name, b_value, p_callback, text, longtext ) \
- { CONFIG_ITEM_BOOL, name, '\0', text, longtext, NULL, b_value, 0, \
- p_callback },
+ p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_STRING, NULL, name, '\0', text, longtext, psz_value, 0, 0, p_callback, ppsz_list }; i_config++
+#define add_file( name, psz_value, p_callback, text, longtext ) \
+ p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_FILE, NULL, name, '\0', text, longtext, psz_value, 0, 0, p_callback }; i_config++
+#define add_module( name, psz_caps, psz_value, p_callback, text, longtext ) \
+ p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_MODULE, psz_caps, name, '\0', text, longtext, psz_value, 0, 0, p_callback }; i_config++
+#define add_integer( name, i_value, p_callback, text, longtext ) \
+ p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_INTEGER, NULL, name, '\0', text, longtext, NULL, i_value, 0, p_callback }; i_config++
+#define add_float( name, f_value, p_callback, text, longtext ) \
+ p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_FLOAT, NULL, name, '\0', text, longtext, NULL, 0, f_value, p_callback }; i_config++
+#define add_bool( name, b_value, p_callback, text, longtext ) \
+ p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_BOOL, NULL, name, '\0', text, longtext, NULL, b_value, 0, p_callback }; i_config++
/* These should be seldom used. They were added just to provide easy shortcuts
* for the command line interface */
-#define ADD_STRING_WITH_SHORT( name, ch, psz_value, p_callback, text, ltext ) \
- { CONFIG_ITEM_STRING, name, ch, text, ltext, psz_value, 0, 0, \
- p_callback },
-#define ADD_FILE_WITH_SHORT( name, ch, psz_value, p_callback, text, ltext ) \
- { CONFIG_ITEM_FILE, name, ch, text, ltext, psz_value, 0, 0, \
- p_callback },
-#define ADD_MODULE_WITH_SHORT( name, ch, i_capability, psz_value, p_callback, \
+#define add_string_with_short( name, ch, psz_value, p_callback, text, ltext ) \
+ p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_STRING, NULL, name, ch, text, ltext, psz_value, 0, 0, p_callback }; i_config++
+#define add_file_with_short( name, ch, psz_value, p_callback, text, ltext ) \
+ p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_FILE, NULL, name, ch, text, ltext, psz_value, 0, 0, p_callback }; i_config++
+#define add_module_with_short( name, ch, psz_caps, psz_value, p_callback, \
text, ltext) \
- { CONFIG_ITEM_MODULE, name, ch, text, ltext, psz_value, i_capability, 0, \
- p_callback },
-#define ADD_INTEGER_WITH_SHORT( name, ch, i_value, p_callback, text, ltext ) \
- { CONFIG_ITEM_INTEGER, name, ch, text, ltext, NULL, i_value, 0, \
- p_callback },
-#define ADD_FLOAT_WITH_SHORT( name, ch, f_value, p_callback, text, ltext ) \
- { CONFIG_ITEM_FLOAT, name, ch, text, ltext, NULL, 0, f_value, \
- p_callback },
-#define ADD_BOOL_WITH_SHORT( name, ch, b_value, p_callback, text, ltext ) \
- { CONFIG_ITEM_BOOL, name, ch, text, ltext, NULL, b_value, 0, \
- p_callback },
+ p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_MODULE, psz_caps, name, ch, text, ltext, psz_value, 0, 0, p_callback }; i_config++
+#define add_integer_with_short( name, ch, i_value, p_callback, text, ltext ) \
+ p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_INTEGER, NULL, name, ch, text, ltext, NULL, i_value, 0, p_callback }; i_config++
+#define add_float_with_short( name, ch, f_value, p_callback, text, ltext ) \
+ p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_FLOAT, NULL, name, ch, text, ltext, NULL, 0, f_value, p_callback }; i_config++
+#define add_bool_with_short( name, ch, b_value, p_callback, text, ltext ) \
+ p_config[ i_config ] = (module_config_t){ CONFIG_ITEM_BOOL, NULL, name, ch, text, ltext, NULL, b_value, 0, p_callback }; i_config++
* input_ext-dec.h: structures exported to the VideoLAN decoders
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: input_ext-dec.h,v 1.64 2002/07/23 00:39:16 sam Exp $
+ * $Id: input_ext-dec.h,v 1.65 2002/07/31 20:56:50 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Kaempf <maxx@via.ecp.fr>
vlc_fourcc_t i_fourcc;
void * p_demux_data;
stream_ctrl_t * p_stream_ctrl;
+
+ /* Module properties */
+ module_t * p_module;
+ int ( * pf_run ) ( decoder_fifo_t * );
};
/*****************************************************************************
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-intf.h,v 1.72 2002/07/23 00:39:16 sam Exp $
+ * $Id: input_ext-intf.h,v 1.73 2002/07/31 20:56:50 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
/* Decoder information */
decoder_fifo_t * p_decoder_fifo;
- vlc_thread_t thread_id; /* ID of the decoder */
count_t c_packets; /* total packets read */
count_t c_invalid_packets; /* invalid packets read */
-
- /* Module properties */
- module_t * p_module;
};
/* Special PID values - note that the PID is only on 13 bits, and that values
vlc_bool_t b_eof;
/* Access module */
- module_t * p_access_module;
- int (* pf_open ) ( input_thread_t * );
- void (* pf_close )( input_thread_t * );
+ module_t * p_access;
ssize_t (* pf_read ) ( input_thread_t *, byte_t *, size_t );
int (* pf_set_program )( input_thread_t *, pgrm_descriptor_t * );
int (* pf_set_area )( input_thread_t *, input_area_t * );
size_t i_mtu;
/* Demux module */
- module_t * p_demux_module;
- int (* pf_init ) ( input_thread_t * );
- void (* pf_end ) ( input_thread_t * );
+ module_t * p_demux;
int (* pf_demux ) ( input_thread_t * );
int (* pf_rewind ) ( input_thread_t * );
/* NULL if we don't support going *
/*****************************************************************************
* Prototypes
*****************************************************************************/
-#define input_CreateThread(a,b,c) __input_CreateThread(CAST_TO_VLC_OBJECT(a),b,c)
+#define input_CreateThread(a,b,c) __input_CreateThread(VLC_OBJECT(a),b,c)
input_thread_t * __input_CreateThread ( vlc_object_t *,
playlist_item_t *, int * );
void input_StopThread ( input_thread_t * );
void input_DestroyThread ( input_thread_t * );
-#define input_SetStatus(a,b) __input_SetStatus(CAST_TO_VLC_OBJECT(a),b)
+#define input_SetStatus(a,b) __input_SetStatus(VLC_OBJECT(a),b)
VLC_EXPORT( void, __input_SetStatus, ( vlc_object_t *, int ) );
-#define input_Seek(a,b,c) __input_Seek(CAST_TO_VLC_OBJECT(a),b,c)
+#define input_Seek(a,b,c) __input_Seek(VLC_OBJECT(a),b,c)
VLC_EXPORT( void, __input_Seek, ( vlc_object_t *, off_t, int ) );
-#define input_Tell(a,b) __input_Tell(CAST_TO_VLC_OBJECT(a),b)
+#define input_Tell(a,b) __input_Tell(VLC_OBJECT(a),b)
VLC_EXPORT( void, __input_Tell, ( vlc_object_t *, stream_position_t * ) );
VLC_EXPORT( void, input_DumpStream, ( input_thread_t * ) );
int input_ToggleGrayscale( input_thread_t * );
int input_ToggleMute ( input_thread_t * );
-int input_SetSMP ( input_thread_t *, int );
#endif /* "input_ext-intf.h" */
* but exported to plug-ins
*****************************************************************************
* Copyright (C) 1999-2002 VideoLAN
- * $Id: input_ext-plugins.h,v 1.32 2002/07/21 19:26:13 sigmunau Exp $
+ * $Id: input_ext-plugins.h,v 1.33 2002/07/31 20:56:50 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
/*****************************************************************************
* Prototypes from input_ext-plugins.h (buffers management)
*****************************************************************************/
-#define input_BuffersInit(a) __input_BuffersInit(CAST_TO_VLC_OBJECT(a))
+#define input_BuffersInit(a) __input_BuffersInit(VLC_OBJECT(a))
void * __input_BuffersInit( vlc_object_t * );
VLC_EXPORT( void, input_BuffersEnd, ( input_thread_t *, input_buffers_t * ) );
/*****************************************************************************
* Prototypes
*****************************************************************************/
-VLC_EXPORT( void, input_FDClose, ( input_thread_t * ) );
-VLC_EXPORT( void, input_FDNetworkClose, ( input_thread_t * ) );
+VLC_EXPORT( void, __input_FDClose, ( vlc_object_t * ) );
+#define input_FDClose(a) __input_FDClose(VLC_OBJECT(a))
+VLC_EXPORT( void, __input_FDNetworkClose, ( vlc_object_t * ) );
+#define input_FDNetworkClose(a) __input_FDNetworkClose(VLC_OBJECT(a))
VLC_EXPORT( ssize_t, input_FDRead, ( input_thread_t *, byte_t *, size_t ) );
VLC_EXPORT( ssize_t, input_FDNetworkRead, ( input_thread_t *, byte_t *, size_t ) );
VLC_EXPORT( void, input_FDSeek, ( input_thread_t *, off_t ) );
* interface, such as message output.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: interface.h,v 1.32 2002/07/20 18:01:41 sam Exp $
+ * $Id: interface.h,v 1.33 2002/07/31 20:56:50 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
intf_console_t * p_console; /* console */
intf_sys_t * p_sys; /* system interface */
- /* Plugin used and shortcuts to access its capabilities */
+ /* Interface module */
module_t * p_module;
- int ( *pf_open ) ( intf_thread_t * );
- void ( *pf_close ) ( intf_thread_t * );
void ( *pf_run ) ( intf_thread_t * );
/* XXX: new message passing stuff will go here */
vlc_mutex_t change_lock;
vlc_bool_t b_menu_change;
vlc_bool_t b_menu;
-
};
/*****************************************************************************
* Prototypes
*****************************************************************************/
-#define intf_Create(a) __intf_Create(CAST_TO_VLC_OBJECT(a))
+#define intf_Create(a) __intf_Create(VLC_OBJECT(a))
VLC_EXPORT( intf_thread_t *, __intf_Create, ( vlc_object_t * ) );
VLC_EXPORT( vlc_error_t, intf_RunThread, ( intf_thread_t * ) );
VLC_EXPORT( void, intf_StopThread, ( intf_thread_t * ) );
* intf_eject.h: CD/DVD-ROM ejection handling functions
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: intf_eject.h,v 1.4 2002/06/01 18:04:48 sam Exp $
+ * $Id: intf_eject.h,v 1.5 2002/07/31 20:56:50 sam Exp $
*
* Author: Julien Blache <jb@technologeek.org>
*
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#define intf_Eject(a,b) __intf_Eject(CAST_TO_VLC_OBJECT(a),b)
+#define intf_Eject(a,b) __intf_Eject(VLC_OBJECT(a),b)
VLC_EXPORT( int, __intf_Eject, ( vlc_object_t *, const char * ) );
* Declaration and extern access to global program object.
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
- * $Id: main.h,v 1.41 2002/07/29 19:05:47 gbazin Exp $
+ * $Id: main.h,v 1.42 2002/07/31 20:56:50 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
char ** ppsz_argv; /* command line arguments */
char * psz_homedir; /* user's home directory */
- u32 i_cpu_capabilities; /* CPU extensions */
+ u32 i_cpu; /* CPU extensions */
/* Generic settings */
vlc_bool_t b_quiet; /* be quiet ? */
void* ( *pf_memset ) ( void *, int, size_t ); /* FIXME: unimplemented */
/* The module bank */
- module_bank_t module_bank;
+ module_bank_t * p_module_bank;
/* The message bank */
msg_bank_t msg_bank;
* modules.h : Module management functions.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.h,v 1.58 2002/07/23 00:39:16 sam Exp $
+ * $Id: modules.h,v 1.59 2002/07/31 20:56:50 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
typedef void * module_handle_t;
#endif
-/*****************************************************************************
- * Module capabilities.
- *****************************************************************************/
-#define MODULE_CAPABILITY_MAIN 0 /* Main */
-#define MODULE_CAPABILITY_INTF 1 /* Interface */
-#define MODULE_CAPABILITY_ACCESS 2 /* Input */
-#define MODULE_CAPABILITY_DEMUX 3 /* Input */
-#define MODULE_CAPABILITY_NETWORK 4 /* Network */
-#define MODULE_CAPABILITY_DECODER 5 /* Audio or video decoder */
-#define MODULE_CAPABILITY_MOTION 6 /* Motion compensation */
-#define MODULE_CAPABILITY_IDCT 7 /* IDCT transformation */
-#define MODULE_CAPABILITY_AOUT 8 /* Audio output */
-#define MODULE_CAPABILITY_AOUT_FILTER 9 /* Audio output filter */
-#define MODULE_CAPABILITY_VOUT 10 /* Video output */
-#define MODULE_CAPABILITY_VOUT_FILTER 11 /* Video output filter */
-#define MODULE_CAPABILITY_CHROMA 12 /* colorspace conversion */
-#define MODULE_CAPABILITY_IMDCT 13 /* IMDCT transformation */
-#define MODULE_CAPABILITY_DOWNMIX 14 /* AC3 downmix */
-#define MODULE_CAPABILITY_MEMCPY 15 /* memcpy */
-#define MODULE_CAPABILITY_MAX 16 /* Total number of capabilities */
-
-#define DECLARE_MODULE_CAPABILITY_TABLE \
- static const char *ppsz_capabilities[] = \
- { \
- "main", \
- "interface", \
- "access", \
- "demux", \
- "network", \
- "decoder", \
- "motion", \
- "iDCT", \
- "audio output", \
- "audio output filter", \
- "video output", \
- "video output filter", \
- "chroma transformation", \
- "iMDCT", \
- "downmix", \
- "memcpy", \
- "unknown" \
- }
-
-#define MODULE_CAPABILITY( i_capa ) \
- ppsz_capabilities[ ((i_capa) > MODULE_CAPABILITY_MAX) ? \
- MODULE_CAPABILITY_MAX : (i_capa) ]
-
/*****************************************************************************
* module_bank_t: the module bank
*****************************************************************************
*****************************************************************************/
struct module_bank_t
{
+ VLC_COMMON_MEMBERS
+
module_t * first; /* First module in the bank */
int i_count; /* Number of allocated modules */
vlc_mutex_t lock; /* Global lock -- you can't imagine how awful *
it is to design thread-safe linked lists */
+ module_symbols_t symbols;
};
/*****************************************************************************
* Variables set by the module to tell us what it can do
*/
char *psz_program; /* Program name which will activate the module */
+
char *pp_shortcuts[ MODULE_SHORTCUT_MAX ]; /* Shortcuts to the module */
- u32 i_capabilities; /* Capability list */
- int pi_score[ MODULE_CAPABILITY_MAX ]; /* Score for each capability */
+ char *psz_capability; /* Capability */
+ int i_score; /* Score for each capability */
+ u32 i_cpu; /* Required CPU capabilities */
- u32 i_cpu_capabilities; /* Required CPU capabilities */
+ vlc_bool_t b_submodule; /* Is this a submodule? */
- module_functions_t *p_functions; /* Capability functions */
+ /* Callbacks */
+ int ( * pf_activate ) ( vlc_object_t * );
+ void ( * pf_deactivate ) ( vlc_object_t * );
/*
* Variables set by the module to store its config options
/*
* Variables used internally by the module manager
*/
- vlc_bool_t b_builtin; /* Set to true if the module is built in */
-
- union
- {
- struct
- {
- module_handle_t handle; /* Unique handle */
- char * psz_filename; /* Module filename */
+ /* Plugin-specific stuff */
+ module_handle_t handle; /* Unique handle */
+ char * psz_filename; /* Module filename */
- } plugin;
-
- struct
- {
- int ( *pf_deactivate ) ( module_t * );
-
- } builtin;
-
- } is;
+ vlc_bool_t b_builtin; /* Set to true if the module is built in */
int i_usage; /* Reference counter */
int i_unused_delay; /* Delay until module is unloaded */
module_symbols_t *p_symbols;
};
-/*****************************************************************************
- * Module functions description structure
- *****************************************************************************/
-typedef struct function_list_t
-{
- union
- {
- /* Interface plugin */
- struct
- {
- int ( * pf_open ) ( intf_thread_t * );
- void ( * pf_close )( intf_thread_t * );
- void ( * pf_run ) ( intf_thread_t * );
- } intf;
-
- /* Access plugin */
- struct
- {
- int ( * pf_open ) ( input_thread_t * );
- void ( * pf_close ) ( input_thread_t * );
- ssize_t ( * pf_read ) ( input_thread_t *, byte_t *, size_t );
- void ( * pf_seek ) ( input_thread_t *, off_t );
- int ( * pf_set_program ) ( input_thread_t *, pgrm_descriptor_t * );
- int ( * pf_set_area ) ( input_thread_t *, input_area_t * );
- } access;
-
- /* Demux plugin */
- struct
- {
- int ( * pf_init ) ( input_thread_t * );
- void ( * pf_end ) ( input_thread_t * );
- int ( * pf_demux ) ( input_thread_t * );
- int ( * pf_rewind ) ( input_thread_t * );
- } demux;
-
- /* Network plugin */
- struct
- {
- int ( * pf_open ) ( vlc_object_t *, network_socket_t * );
- } network;
-
- /* Audio output plugin */
- struct
- {
- int ( * pf_open ) ( aout_thread_t * );
- int ( * pf_setformat ) ( aout_thread_t * );
- int ( * pf_getbufinfo ) ( aout_thread_t *, int );
- void ( * pf_play ) ( aout_thread_t *, byte_t *, int );
- void ( * pf_close ) ( aout_thread_t * );
- } aout;
-
- /* Video output plugin */
- struct
- {
- int ( * pf_create ) ( vout_thread_t * );
- int ( * pf_init ) ( vout_thread_t * );
- void ( * pf_end ) ( vout_thread_t * );
- void ( * pf_destroy ) ( vout_thread_t * );
- int ( * pf_manage ) ( vout_thread_t * );
- void ( * pf_render ) ( vout_thread_t *, picture_t * );
- void ( * pf_display ) ( vout_thread_t *, picture_t * );
- } vout;
-
- /* Motion compensation plugin */
- struct
- {
- void ( * ppppf_motion[2][2][4] ) ( yuv_data_t *, yuv_data_t *,
- int, int );
- } motion;
-
- /* IDCT plugin */
- struct
- {
- void ( * pf_idct_init ) ( void ** );
- void ( * pf_sparse_idct_add )( dctelem_t *, yuv_data_t *, int,
- void *, int );
- void ( * pf_idct_add ) ( dctelem_t *, yuv_data_t *, int,
- void *, int );
- void ( * pf_sparse_idct_copy )( dctelem_t *, yuv_data_t *, int,
- void *, int );
- void ( * pf_idct_copy ) ( dctelem_t *, yuv_data_t *, int,
- void *, int );
- void ( * pf_norm_scan ) ( u8 ppi_scan[2][64] );
- } idct;
-
- /* Chroma transformation plugin */
- struct
- {
- int ( * pf_init ) ( vout_thread_t * );
- void ( * pf_end ) ( vout_thread_t * );
- } chroma;
-
- /* IMDCT plugin */
- struct
- {
- void ( * pf_imdct_init ) ( imdct_t * );
- void ( * pf_imdct_256 ) ( imdct_t *, float [], float [] );
- void ( * pf_imdct_256_nol )( imdct_t *, float [], float [] );
- void ( * pf_imdct_512 ) ( imdct_t *, float [], float [] );
- void ( * pf_imdct_512_nol )( imdct_t *, float [], float [] );
-// void ( * pf_fft_64p ) ( complex_t * );
-
- } imdct;
-
- /* AC3 downmix plugin */
- struct
- {
- void ( * pf_downmix_3f_2r_to_2ch ) ( float *, dm_par_t * );
- void ( * pf_downmix_3f_1r_to_2ch ) ( float *, dm_par_t * );
- void ( * pf_downmix_2f_2r_to_2ch ) ( float *, dm_par_t * );
- void ( * pf_downmix_2f_1r_to_2ch ) ( float *, dm_par_t * );
- void ( * pf_downmix_3f_0r_to_2ch ) ( float *, dm_par_t * );
- void ( * pf_stream_sample_2ch_to_s16 ) ( s16 *, float *, float * );
- void ( * pf_stream_sample_1ch_to_s16 ) ( s16 *, float * );
-
- } downmix;
-
- /* Decoder plugins */
- struct
- {
- int ( * pf_probe)( vlc_fourcc_t * p_es );
- int ( * pf_run ) ( decoder_fifo_t * p_fifo );
- } dec;
-
- /* memcpy plugins */
- struct
- {
- void* ( * pf_memcpy ) ( void *, const void *, size_t );
- void* ( * pf_memset ) ( void *, int, size_t );
- } memcpy;
-
- } functions;
-
-} function_list_t;
-
-struct module_functions_t
-{
- /* XXX: The order here has to be the same as above for the #defines */
- function_list_t intf;
- function_list_t access;
- function_list_t demux;
- function_list_t network;
- function_list_t dec;
- function_list_t motion;
- function_list_t idct;
- function_list_t aout;
- function_list_t vout;
- function_list_t chroma;
- function_list_t imdct;
- function_list_t downmix;
- function_list_t memcpy;
-};
-
/*****************************************************************************
* Exported functions.
*****************************************************************************/
-#define module_InitBank(a) __module_InitBank(CAST_TO_VLC_OBJECT(a))
+#define module_InitBank(a) __module_InitBank(VLC_OBJECT(a))
void __module_InitBank ( vlc_object_t * );
-#define module_LoadMain(a) __module_LoadMain(CAST_TO_VLC_OBJECT(a))
+#define module_LoadMain(a) __module_LoadMain(VLC_OBJECT(a))
void __module_LoadMain ( vlc_object_t * );
-#define module_LoadBuiltins(a) __module_LoadBuiltins(CAST_TO_VLC_OBJECT(a))
+#define module_LoadBuiltins(a) __module_LoadBuiltins(VLC_OBJECT(a))
void __module_LoadBuiltins ( vlc_object_t * );
-#define module_LoadPlugins(a) __module_LoadPlugins(CAST_TO_VLC_OBJECT(a))
+#define module_LoadPlugins(a) __module_LoadPlugins(VLC_OBJECT(a))
void __module_LoadPlugins ( vlc_object_t * );
-#define module_EndBank(a) __module_EndBank(CAST_TO_VLC_OBJECT(a))
+#define module_EndBank(a) __module_EndBank(VLC_OBJECT(a))
void __module_EndBank ( vlc_object_t * );
-#define module_ResetBank(a) __module_ResetBank(CAST_TO_VLC_OBJECT(a))
+#define module_ResetBank(a) __module_ResetBank(VLC_OBJECT(a))
void __module_ResetBank ( vlc_object_t * );
-#define module_ManageBank(a) __module_ManageBank(CAST_TO_VLC_OBJECT(a))
+#define module_ManageBank(a) __module_ManageBank(VLC_OBJECT(a))
void __module_ManageBank ( vlc_object_t * );
-#define module_Need(a,b,c,d) __module_Need(CAST_TO_VLC_OBJECT(a),b,c,d)
-VLC_EXPORT( module_t *, __module_Need, ( vlc_object_t *, int, const char *, void * ) );
-VLC_EXPORT( void, module_Unneed, ( module_t * ) );
+#define module_Need(a,b,c) __module_Need(VLC_OBJECT(a),b,c)
+VLC_EXPORT( module_t *, __module_Need, ( vlc_object_t *, const char *, const char * ) );
+#define module_Unneed(a,b) __module_Unneed(VLC_OBJECT(a),b)
+VLC_EXPORT( void, __module_Unneed, ( vlc_object_t *, module_t * ) );
* modules_inner.h : Macros used from within a module.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules_inner.h,v 1.23 2002/06/01 12:31:57 sam Exp $
+ * $Id: modules_inner.h,v 1.24 2002/07/31 20:56:50 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#define UGLY_KLUDGE( z ) #z
/* And I need to do _this_ to change « foo bar » to « module_foo_bar » ! */
#define CONCATENATE( y, z ) CRUDE_HACK( y, z )
-#define CRUDE_HACK( y, z ) y##__MODULE_##z
+#define CRUDE_HACK( y, z ) y##__##z
/* If the module is built-in, then we need to define foo_InitModule instead
* of InitModule. Same for Activate- and DeactivateModule. */
#if defined( __BUILTIN__ )
-# define _M( function ) CONCATENATE( function, MODULE_NAME )
+# define E_( function ) CONCATENATE( function, MODULE_NAME )
# define __VLC_SYMBOL( symbol ) CONCATENATE( symbol, MODULE_NAME )
# define DECLARE_SYMBOLS ;
# define STORE_SYMBOLS ;
#elif defined( __PLUGIN__ )
-# define _M( function ) function
+# define E_( function ) function
# define __VLC_SYMBOL( symbol ) CONCATENATE( symbol, MODULE_SYMBOL )
# define DECLARE_SYMBOLS module_symbols_t* p_symbols;
# define STORE_SYMBOLS p_symbols = p_module->p_symbols;
#endif
+#if defined( __cplusplus )
+# define EXTERN_SYMBOL extern "C"
+#else
+# define EXTERN_SYMBOL
+#endif
+
#define MODULE_STRING STRINGIFY( MODULE_NAME )
/*
* instance the module name, its shortcuts, its capabilities... we also create
* a copy of its config because the module can be unloaded at any time.
*/
-#define MODULE_INIT_START \
+#define vlc_module_begin( ) \
DECLARE_SYMBOLS; \
- int __VLC_SYMBOL( InitModule ) ( module_t *p_module ) \
+ EXTERN_SYMBOL int __VLC_SYMBOL(vlc_entry) ( module_t *p_module ) \
{ \
- int i_shortcut = 1; \
+ int i_shortcut = 1, i_config = 0; \
+ module_config_t p_config[ 100 ]; \
STORE_SYMBOLS; \
+ p_module->b_submodule = VLC_FALSE; \
p_module->psz_object_name = MODULE_STRING; \
p_module->psz_longname = MODULE_STRING; \
- p_module->psz_program = NULL; \
p_module->pp_shortcuts[ 0 ] = MODULE_STRING; \
- p_module->i_capabilities = 0; \
- p_module->i_cpu_capabilities = 0; \
- do {
+ p_module->i_cpu = 0; \
+ p_module->psz_program = NULL; \
+ p_module->psz_capability = ""; \
+ p_module->i_score = 1; \
+ p_module->pf_activate = NULL; \
+ p_module->pf_deactivate = NULL; \
+ do \
+ { \
+ module_t *p_submodule = p_module /* the ; gets added */
-#define MODULE_INIT_STOP \
+#define vlc_module_end( ) \
+ p_submodule->pp_shortcuts[ i_shortcut ] = NULL; \
} while( 0 ); \
- p_module->pp_shortcuts[ i_shortcut ] = NULL; \
+ p_config[ i_config ] = \
+ (module_config_t){ CONFIG_HINT_END, NULL, NULL, '\0' }; \
config_Duplicate( p_module, p_config ); \
if( p_module->p_config == NULL ) \
{ \
-/*//X intf_Err( p_module, "InitModule can't duplicate p_config" );*/ \
return -1; \
} \
- return 0; \
- }
-
-#define ADD_CAPABILITY( cap, score ) \
- p_module->i_capabilities |= 1 << MODULE_CAPABILITY_##cap; \
- p_module->pi_score[ MODULE_CAPABILITY_##cap ] = score;
-
-#define ADD_REQUIREMENT( cap ) \
- p_module->i_cpu_capabilities |= CPU_CAPABILITY_##cap;
-
-#define ADD_PROGRAM( program ) \
- p_module->psz_program = program;
-
-#define ADD_SHORTCUT( shortcut ) \
- p_module->pp_shortcuts[ i_shortcut ] = shortcut; \
- i_shortcut++;
-
-#define SET_DESCRIPTION( desc ) \
- p_module->psz_longname = desc;
+ return 0 && i_shortcut; \
+ } \
+ int __VLC_SYMBOL(vlc_entry) ( module_t * ) /* the ; gets added */
+
+
+#define add_submodule( ) \
+ p_submodule->pp_shortcuts[ i_shortcut ] = NULL; \
+ p_submodule = vlc_object_create( p_module, VLC_OBJECT_MODULE ); \
+ vlc_object_attach( p_submodule, p_module ); \
+ p_submodule->b_submodule = VLC_TRUE; \
+ /* Nuahahaha! Heritage! Polymorphism! Ugliness!! */ \
+ for( i_shortcut = 0; p_module->pp_shortcuts[ i_shortcut ]; i_shortcut++ ) \
+ { \
+ p_submodule->pp_shortcuts[ i_shortcut ] = \
+ p_module->pp_shortcuts[ i_shortcut ]; \
+ } \
+ p_submodule->psz_object_name = p_module->psz_object_name; \
+ p_submodule->psz_program = p_module->psz_program; \
+ p_submodule->psz_capability = p_module->psz_capability; \
+ p_submodule->i_score = p_module->i_score; \
+ p_submodule->i_cpu = p_module->i_cpu; \
+ p_submodule->pf_activate = NULL; \
+ p_submodule->pf_deactivate = NULL
+
+#define add_requirement( cap ) \
+ p_module->i_cpu |= CPU_CAPABILITY_##cap
+
+#define add_shortcut( shortcut ) \
+ p_submodule->pp_shortcuts[ i_shortcut ] = shortcut; \
+ i_shortcut++
+
+#define set_description( desc ) \
+ p_module->psz_longname = desc
+
+#define set_capability( cap, score ) \
+ p_submodule->psz_capability = cap; \
+ p_submodule->i_score = score
+
+#define set_program( program ) \
+ p_submodule->psz_program = program
+
+#define set_callbacks( activate, deactivate ) \
+ p_submodule->pf_activate = activate; \
+ p_submodule->pf_deactivate = deactivate
/*
- * ActivateModule: this function is called before functions can be accessed,
+ * module_activate: this function is called before functions can be accessed,
* we do allocation tasks here, and maybe additional stuff such as large
* table allocation. Once ActivateModule is called we are almost sure the
* module will be used.
*/
-#define MODULE_ACTIVATE_START \
- int __VLC_SYMBOL( ActivateModule ) ( module_t *p_module ) \
+#define module_activate( prototype ) \
+ __module_activate( prototype ); \
+ int __VLC_SYMBOL( module_activate ) ( module_t *p_module ) \
{ \
STORE_SYMBOLS; \
- p_module->p_functions = \
- ( module_functions_t * )malloc( sizeof( module_functions_t ) ); \
- if( p_module->p_functions == NULL ) \
- { \
- return( -1 ); \
- } \
config_SetCallbacks( p_module->p_config, p_config ); \
- do {
-
-#define MODULE_ACTIVATE_STOP \
- } while( 0 ); \
- return 0; \
- }
+ return __module_activate( p_module ); \
+ } \
+ \
+ static int __module_activate( prototype )
/*
* DeactivateModule: this function is called after we are finished with the
* module. Everything that has been done in ActivateModule needs to be undone
* here.
*/
-#define MODULE_DEACTIVATE_START \
- int __VLC_SYMBOL( DeactivateModule )( module_t *p_module ) \
+#define module_deactivate( prototype ) \
+ __module_deactivate( prototype ); \
+ int __VLC_SYMBOL( module_deactivate )( module_t *p_module ) \
{ \
- free( p_module->p_functions ); \
- do {
-
-#define MODULE_DEACTIVATE_STOP \
- } while( 0 ); \
+ int i_ret = __module_deactivate( p_module ); \
config_UnsetCallbacks( p_module->p_config ); \
- return 0; \
- }
+ return i_ret; \
+ } \
+ \
+ static int __module_deactivate( prototype )
+
* modules.
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: netutils.h,v 1.21 2002/06/01 18:04:48 sam Exp $
+ * $Id: netutils.h,v 1.22 2002/07/31 20:56:50 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Henri Fallon <henri@videolan.org>
struct sockaddr_in;
int network_BuildAddr ( struct sockaddr_in *, char *, int );
-#define network_ChannelJoin(a,b) __network_ChannelJoin(CAST_TO_VLC_OBJECT(a),b)
-#define network_ChannelCreate(a) __network_ChannelCreate(CAST_TO_VLC_OBJECT(a))
+#define network_ChannelJoin(a,b) __network_ChannelJoin(VLC_OBJECT(a),b)
+#define network_ChannelCreate(a) __network_ChannelCreate(VLC_OBJECT(a))
VLC_EXPORT( int, __network_ChannelJoin, ( vlc_object_t *, int ) );
VLC_EXPORT( int, __network_ChannelCreate, ( vlc_object_t * ) );
* of the reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: stream_control.h,v 1.9 2002/07/20 18:01:41 sam Exp $
+ * $Id: stream_control.h,v 1.10 2002/07/31 20:56:50 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
vlc_bool_t b_mute;
vlc_bool_t b_grayscale; /* use color or grayscale */
- int i_smp; /* number of symmetrical threads to launch
- * to decode the video | 0 == disabled */
};
/* Possible status : */
* thread, and destroy a previously opened video output thread.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_output.h,v 1.81 2002/07/20 18:01:41 sam Exp $
+ * $Id: video_output.h,v 1.82 2002/07/31 20:56:50 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
/* Plugin used and shortcuts to access its capabilities */
module_t * p_module;
- int ( * pf_init ) ( vout_thread_t * );
- void ( * pf_end ) ( vout_thread_t * );
} vout_chroma_t;
/* Plugin used and shortcuts to access its capabilities */
module_t * p_module;
- int ( *pf_create ) ( vout_thread_t * );
int ( *pf_init ) ( vout_thread_t * );
void ( *pf_end ) ( vout_thread_t * );
- void ( *pf_destroy ) ( vout_thread_t * );
int ( *pf_manage ) ( vout_thread_t * );
void ( *pf_render ) ( vout_thread_t *, picture_t * );
void ( *pf_display ) ( vout_thread_t *, picture_t * );
/*****************************************************************************
* Prototypes
*****************************************************************************/
-#define vout_CreateThread(a,b,c,d,e) __vout_CreateThread(CAST_TO_VLC_OBJECT(a),b,c,d,e)
+#define vout_CreateThread(a,b,c,d,e) __vout_CreateThread(VLC_OBJECT(a),b,c,d,e)
VLC_EXPORT( vout_thread_t *, __vout_CreateThread, ( vlc_object_t *, int, int, u32, int ) );
VLC_EXPORT( void, vout_DestroyThread, ( vout_thread_t * ) );
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc_common.h,v 1.12 2002/07/23 00:39:16 sam Exp $
+ * $Id: vlc_common.h,v 1.13 2002/07/31 20:56:50 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
vlc_object_t ** pp_children; /* our children */ \
volatile int i_children; \
\
+ /* Private data */ \
+ void * p_private; \
+ \
/* Just a reminder so that people don't cast garbage */ \
int be_sure_to_add_VLC_COMMON_MEMBERS_to_struct; \
VLC_COMMON_MEMBERS
};
-/* CAST_TO_VLC_OBJECT: attempt at doing a clever cast */
-#define CAST_TO_VLC_OBJECT( x ) \
+/* VLC_OBJECT: attempt at doing a clever cast */
+#define VLC_OBJECT( x ) \
((vlc_object_t *)(x))+0*(x)->be_sure_to_add_VLC_COMMON_MEMBERS_to_struct
/*****************************************************************************
* cpu.h: CPU type detection
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: vlc_cpu.h,v 1.2 2002/06/01 18:04:48 sam Exp $
+ * $Id: vlc_cpu.h,v 1.3 2002/07/31 20:56:50 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#define CPUCapabilities(a) __CPUCapabilities(CAST_TO_VLC_OBJECT(a))
+#define CPUCapabilities(a) __CPUCapabilities(VLC_OBJECT(a))
u32 __CPUCapabilities( vlc_object_t * );
* interface, such as message output.
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
- * $Id: vlc_messages.h,v 1.4 2002/07/20 18:01:42 sam Exp $
+ * $Id: vlc_messages.h,v 1.5 2002/07/31 20:56:50 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
{
/* Message queue lock */
vlc_mutex_t lock;
+ vlc_bool_t b_configured;
+ vlc_bool_t b_overflow;
/* Message queue */
msg_item_t msg[VLC_MSG_QSIZE]; /* message queue */
#ifdef HAVE_VARIADIC_MACROS
# define msg_Info( p_this, psz_format, args... ) \
- __msg_Generic( CAST_TO_VLC_OBJECT(p_this), VLC_MSG_INFO, MODULE_STRING, \
+ __msg_Generic( VLC_OBJECT(p_this), VLC_MSG_INFO, MODULE_STRING, \
psz_format, ## args )
# define msg_Err( p_this, psz_format, args... ) \
- __msg_Generic( CAST_TO_VLC_OBJECT(p_this), VLC_MSG_ERR, MODULE_STRING, \
+ __msg_Generic( VLC_OBJECT(p_this), VLC_MSG_ERR, MODULE_STRING, \
psz_format, ## args )
# define msg_Warn( p_this, psz_format, args... ) \
- __msg_Generic( CAST_TO_VLC_OBJECT(p_this), VLC_MSG_WARN, MODULE_STRING, \
+ __msg_Generic( VLC_OBJECT(p_this), VLC_MSG_WARN, MODULE_STRING, \
psz_format, ## args )
# define msg_Dbg( p_this, psz_format, args... ) \
- __msg_Generic( CAST_TO_VLC_OBJECT(p_this), VLC_MSG_DBG, MODULE_STRING, \
+ __msg_Generic( VLC_OBJECT(p_this), VLC_MSG_DBG, MODULE_STRING, \
psz_format, ## args )
#else /* HAVE_VARIADIC_MACROS */
#endif /* HAVE_VARIADIC_MACROS */
-#define msg_Create(a) __msg_Create(CAST_TO_VLC_OBJECT(a))
-#define msg_Flush(a) __msg_Flush(CAST_TO_VLC_OBJECT(a))
-#define msg_Destroy(a) __msg_Destroy(CAST_TO_VLC_OBJECT(a))
+#define msg_Create(a) __msg_Create(VLC_OBJECT(a))
+#define msg_Flush(a) __msg_Flush(VLC_OBJECT(a))
+#define msg_Destroy(a) __msg_Destroy(VLC_OBJECT(a))
void __msg_Create ( vlc_object_t * );
void __msg_Flush ( vlc_object_t * );
void __msg_Destroy ( vlc_object_t * );
-#define msg_Subscribe(a) __msg_Subscribe(CAST_TO_VLC_OBJECT(a))
-#define msg_Unsubscribe(a,b) __msg_Unsubscribe(CAST_TO_VLC_OBJECT(a),b)
+#define msg_Subscribe(a) __msg_Subscribe(VLC_OBJECT(a))
+#define msg_Unsubscribe(a,b) __msg_Unsubscribe(VLC_OBJECT(a),b)
VLC_EXPORT( msg_subscription_t*, __msg_Subscribe, ( vlc_object_t * ) );
VLC_EXPORT( void, __msg_Unsubscribe, ( vlc_object_t *, msg_subscription_t * ) );
* vlc_objects.h: vlc_object_t definition.
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: vlc_objects.h,v 1.4 2002/06/07 14:59:40 sam Exp $
+ * $Id: vlc_objects.h,v 1.5 2002/07/31 20:56:50 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#define VLC_OBJECT_DECODER (-7)
#define VLC_OBJECT_VOUT (-8)
#define VLC_OBJECT_AOUT (-9)
-#define VLC_OBJECT_PRIVATE (-666)
+#define VLC_OBJECT_GENERIC (-666)
/* Object search mode */
#define FIND_PARENT 0x0001
#define FIND_STRICT 0x0010
+/* Object cast */
+
+
/*****************************************************************************
* Prototypes
*****************************************************************************/
VLC_EXPORT( void, __vlc_dumpstructure, ( vlc_object_t * ) );
#define vlc_object_create(a,b) \
- __vlc_object_create( CAST_TO_VLC_OBJECT(a), b )
+ __vlc_object_create( VLC_OBJECT(a), b )
#define vlc_object_destroy(a) do { \
- __vlc_object_destroy( CAST_TO_VLC_OBJECT(a) ); \
+ __vlc_object_destroy( VLC_OBJECT(a) ); \
(a) = NULL; } while(0)
#define vlc_object_find(a,b,c) \
- __vlc_object_find( CAST_TO_VLC_OBJECT(a),b,c)
+ __vlc_object_find( VLC_OBJECT(a),b,c)
#define vlc_object_yield(a) \
- __vlc_object_yield( CAST_TO_VLC_OBJECT(a) )
+ __vlc_object_yield( VLC_OBJECT(a) )
#define vlc_object_release(a) \
- __vlc_object_release( CAST_TO_VLC_OBJECT(a) )
+ __vlc_object_release( VLC_OBJECT(a) )
#define vlc_object_detach(a,b) \
- __vlc_object_detach( CAST_TO_VLC_OBJECT(a), CAST_TO_VLC_OBJECT(b) )
+ __vlc_object_detach( VLC_OBJECT(a), VLC_OBJECT(b) )
#define vlc_object_detach_all(a) \
- __vlc_object_detach_all( CAST_TO_VLC_OBJECT(a) )
+ __vlc_object_detach_all( VLC_OBJECT(a) )
#define vlc_object_attach(a,b) \
- __vlc_object_attach( CAST_TO_VLC_OBJECT(a), CAST_TO_VLC_OBJECT(b) )
+ __vlc_object_attach( VLC_OBJECT(a), VLC_OBJECT(b) )
#if 0
#define vlc_object_setchild(a,b) \
- __vlc_object_setchild( CAST_TO_VLC_OBJECT(a), CAST_TO_VLC_OBJECT(b) )
+ __vlc_object_setchild( VLC_OBJECT(a), VLC_OBJECT(b) )
#endif
#define vlc_dumpstructure(a) \
- __vlc_dumpstructure( CAST_TO_VLC_OBJECT(a) )
+ __vlc_dumpstructure( VLC_OBJECT(a) )
* vlc_playlist.h : Playlist functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
- * $Id: vlc_playlist.h,v 1.3 2002/07/20 18:01:42 sam Exp $
+ * $Id: vlc_playlist.h,v 1.4 2002/07/31 20:56:50 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Prototypes
*****************************************************************************/
-#define playlist_Create(a) __playlist_Create(CAST_TO_VLC_OBJECT(a))
+#define playlist_Create(a) __playlist_Create(VLC_OBJECT(a))
playlist_t * __playlist_Create ( vlc_object_t * );
void playlist_Destroy ( playlist_t * );
struct module_symbols_t
{
aout_fifo_t * (* __aout_CreateFifo_inner) ( vlc_object_t *, int, int, int, int, void * ) ;
- char * (* config_GetHomeDir_inner) ( void ) ;
char * (* __config_GetPsz_inner) (vlc_object_t *, const char *) ;
+ char * (* config_GetHomeDir_inner) ( void ) ;
char * (* input_OffsetToTime_inner) ( input_thread_t *, char *, off_t ) ;
char * (* mstrtime_inner) ( char *psz_buffer, mtime_t date ) ;
const char * (* DecodeLanguage_inner) ( u16 ) ;
int (* __config_LoadCmdLine_inner) ( vlc_object_t *, int *, char *[], vlc_bool_t ) ;
int (* __config_LoadConfigFile_inner) ( vlc_object_t *, const char * ) ;
int (* __config_SaveConfigFile_inner) ( vlc_object_t *, const char * ) ;
- intf_thread_t * (* __intf_Create_inner) ( vlc_object_t * ) ;
+ int (* __intf_Eject_inner) ( vlc_object_t *, const char * ) ;
+ int (* __network_ChannelCreate_inner) ( vlc_object_t * ) ;
+ int (* __network_ChannelJoin_inner) ( vlc_object_t *, int ) ;
+ int (* __vlc_cond_destroy_inner) ( char *, int, vlc_cond_t * ) ;
+ int (* __vlc_cond_init_inner) ( vlc_object_t *, vlc_cond_t * ) ;
+ int (* __vlc_mutex_destroy_inner) ( char *, int, vlc_mutex_t * ) ;
+ int (* __vlc_mutex_init_inner) ( vlc_object_t *, vlc_mutex_t * ) ;
+ int (* __vlc_thread_create_inner) ( vlc_object_t *, char *, int, char *, void * ( * ) ( void * ), vlc_bool_t ) ;
+ int (* __vlc_threads_end_inner) ( vlc_object_t * ) ;
+ int (* __vlc_threads_init_inner) ( vlc_object_t * ) ;
int (* input_AccessInit_inner) ( input_thread_t * ) ;
int (* input_AddInfo_inner) ( input_info_category_t *, char *, char *, ... ) ;
int (* input_ChangeArea_inner) ( input_thread_t *, input_area_t * ) ;
int (* input_SetProgram_inner) ( input_thread_t *, pgrm_descriptor_t * ) ;
int (* input_ToggleES_inner) ( input_thread_t *, es_descriptor_t *, vlc_bool_t ) ;
int (* input_UnselectES_inner) ( input_thread_t *, es_descriptor_t * ) ;
- int (* __intf_Eject_inner) ( vlc_object_t *, const char * ) ;
- int (* __network_ChannelCreate_inner) ( vlc_object_t * ) ;
- int (* __network_ChannelJoin_inner) ( vlc_object_t *, int ) ;
int (* playlist_Add_inner) ( playlist_t *, const char *, int, int ) ;
int (* playlist_Delete_inner) ( playlist_t *, int ) ;
- int (* __vlc_cond_destroy_inner) ( char *, int, vlc_cond_t * ) ;
- int (* __vlc_cond_init_inner) ( vlc_object_t *, vlc_cond_t * ) ;
- int (* __vlc_mutex_destroy_inner) ( char *, int, vlc_mutex_t * ) ;
- int (* __vlc_mutex_init_inner) ( vlc_object_t *, vlc_mutex_t * ) ;
- int (* __vlc_thread_create_inner) ( vlc_object_t *, char *, int, char *, void * ( * ) ( void * ), vlc_bool_t ) ;
- int (* __vlc_threads_end_inner) ( vlc_object_t * ) ;
- int (* __vlc_threads_init_inner) ( vlc_object_t * ) ;
int (* vout_ChromaCmp_inner) ( u32, u32 ) ;
+ intf_thread_t * (* __intf_Create_inner) ( vlc_object_t * ) ;
module_config_t * (* config_FindConfig_inner) ( vlc_object_t *, const char *psz_name ) ;
- module_t * (* __module_Need_inner) ( vlc_object_t *, int, const char *, void * ) ;
+ module_t * (* __module_Need_inner) ( vlc_object_t *, const char *, const char * ) ;
msg_subscription_t* (* __msg_Subscribe_inner) ( vlc_object_t * ) ;
mtime_t (* input_ClockGetTS_inner) ( input_thread_t *, pgrm_descriptor_t *, mtime_t ) ;
mtime_t (* mdate_inner) ( void ) ;
u32 (* UnalignedShowBits_inner) ( bit_stream_t *, unsigned int ) ;
vlc_bool_t (* NextDataPacket_inner) ( decoder_fifo_t *, data_packet_t ** ) ;
vlc_error_t (* intf_RunThread_inner) ( intf_thread_t * ) ;
- void (* aout_DestroyFifo_inner) ( aout_fifo_t *p_fifo ) ;
void (* BitstreamNextDataPacket_inner) ( bit_stream_t * ) ;
- void (* config_Duplicate_inner) ( module_t *, module_config_t * ) ;
+ void (* CurrentPTS_inner) ( bit_stream_t *, mtime_t *, mtime_t * ) ;
+ void (* DecoderError_inner) ( decoder_fifo_t * p_fifo ) ;
+ void (* InitBitstream_inner) ( bit_stream_t *, decoder_fifo_t *, void ( * )( bit_stream_t *, vlc_bool_t ), void * p_callback_arg ) ;
+ void (* UnalignedRemoveBits_inner) ( bit_stream_t * ) ;
void (* __config_PutFloat_inner) (vlc_object_t *, const char *, float) ;
void (* __config_PutInt_inner) (vlc_object_t *, const char *, int) ;
void (* __config_PutPsz_inner) (vlc_object_t *, const char *, const char *) ;
+ void (* __input_FDClose_inner) ( vlc_object_t * ) ;
+ void (* __input_FDNetworkClose_inner) ( vlc_object_t * ) ;
+ void (* __input_Seek_inner) ( vlc_object_t *, off_t, int ) ;
+ void (* __input_SetStatus_inner) ( vlc_object_t *, int ) ;
+ void (* __input_Tell_inner) ( vlc_object_t *, stream_position_t * ) ;
+ void (* __module_Unneed_inner) ( vlc_object_t *, module_t * ) ;
+ void (* __msg_Dbg_inner) ( void *, const char *, ... ) ;
+ void (* __msg_Err_inner) ( void *, const char *, ... ) ;
+ void (* __msg_Generic_inner) ( vlc_object_t *, int, const char *, const char *, ... ) ;
+ void (* __msg_Info_inner) ( void *, const char *, ... ) ;
+ void (* __msg_Unsubscribe_inner) ( vlc_object_t *, msg_subscription_t * ) ;
+ void (* __msg_Warn_inner) ( void *, const char *, ... ) ;
+ void (* __vlc_dumpstructure_inner) ( vlc_object_t * ) ;
+ void (* __vlc_object_attach_inner) ( vlc_object_t *, vlc_object_t * ) ;
+ void (* __vlc_object_destroy_inner) ( vlc_object_t * ) ;
+ void (* __vlc_object_detach_all_inner) ( vlc_object_t * ) ;
+ void (* __vlc_object_detach_inner) ( vlc_object_t *, vlc_object_t * ) ;
+ void (* __vlc_object_release_inner) ( vlc_object_t * ) ;
+ void (* __vlc_object_yield_inner) ( vlc_object_t * ) ;
+ void (* __vlc_thread_join_inner) ( vlc_object_t *, char *, int ) ;
+ void (* __vlc_thread_ready_inner) ( vlc_object_t * ) ;
+ void (* aout_DestroyFifo_inner) ( aout_fifo_t *p_fifo ) ;
+ void (* config_Duplicate_inner) ( module_t *, module_config_t * ) ;
void (* config_SetCallbacks_inner) ( module_config_t *, module_config_t * ) ;
void (* config_UnsetCallbacks_inner) ( module_config_t * ) ;
- void (* CurrentPTS_inner) ( bit_stream_t *, mtime_t *, mtime_t * ) ;
- void (* DecoderError_inner) ( decoder_fifo_t * p_fifo ) ;
- void (* InitBitstream_inner) ( bit_stream_t *, decoder_fifo_t *, void ( * )( bit_stream_t *, vlc_bool_t ), void * p_callback_arg ) ;
void (* input_AccessEnd_inner) ( input_thread_t * ) ;
void (* input_AccessReinit_inner) ( input_thread_t * ) ;
void (* input_BuffersEnd_inner) ( input_thread_t *, input_buffers_t * ) ;
void (* input_DecodePES_inner) ( decoder_fifo_t *, pes_packet_t * ) ;
void (* input_DelArea_inner) ( input_thread_t *, input_area_t * ) ;
void (* input_DelES_inner) ( input_thread_t *, es_descriptor_t * ) ;
- void (* input_DeletePacket_inner) ( input_buffers_t *, data_packet_t * ) ;
- void (* input_DeletePES_inner) ( input_buffers_t *, pes_packet_t * ) ;
void (* input_DelProgram_inner) ( input_thread_t *, pgrm_descriptor_t * ) ;
+ void (* input_DeletePES_inner) ( input_buffers_t *, pes_packet_t * ) ;
+ void (* input_DeletePacket_inner) ( input_buffers_t *, data_packet_t * ) ;
void (* input_DemuxPS_inner) ( input_thread_t *, data_packet_t * ) ;
void (* input_DemuxTS_inner) ( input_thread_t *, data_packet_t *, void(*) ( input_thread_t *, data_packet_t *, es_descriptor_t *, vlc_bool_t ) ) ;
void (* input_DumpStream_inner) ( input_thread_t * ) ;
void (* input_EndStream_inner) ( input_thread_t * ) ;
- void (* input_FDClose_inner) ( input_thread_t * ) ;
- void (* input_FDNetworkClose_inner) ( input_thread_t * ) ;
void (* input_FDSeek_inner) ( input_thread_t *, off_t ) ;
void (* input_GatherPES_inner) ( input_thread_t *, data_packet_t *, es_descriptor_t *, vlc_bool_t, vlc_bool_t ) ;
void (* input_ParsePES_inner) ( input_thread_t *, es_descriptor_t * ) ;
void (* input_ReleaseBuffer_inner) ( input_buffers_t *, data_buffer_t * ) ;
- void (* __input_Seek_inner) ( vlc_object_t *, off_t, int ) ;
- void (* __input_SetStatus_inner) ( vlc_object_t *, int ) ;
- void (* __input_Tell_inner) ( vlc_object_t *, stream_position_t * ) ;
void (* intf_Destroy_inner) ( intf_thread_t * ) ;
void (* intf_StopThread_inner) ( intf_thread_t * ) ;
- void (* module_Unneed_inner) ( module_t * ) ;
- void (* __msg_Dbg_inner) ( void *, const char *, ... ) ;
- void (* __msg_Err_inner) ( void *, const char *, ... ) ;
- void (* __msg_Generic_inner) ( vlc_object_t *, int, const char *, const char *, ... ) ;
- void (* __msg_Info_inner) ( void *, const char *, ... ) ;
- void (* __msg_Unsubscribe_inner) ( vlc_object_t *, msg_subscription_t * ) ;
- void (* __msg_Warn_inner) ( void *, const char *, ... ) ;
void (* msleep_inner) ( mtime_t delay ) ;
void (* mwait_inner) ( mtime_t date ) ;
void (* playlist_Command_inner) ( playlist_t *, int, int ) ;
- void (* UnalignedRemoveBits_inner) ( bit_stream_t * ) ;
- void (* __vlc_dumpstructure_inner) ( vlc_object_t * ) ;
- void (* __vlc_object_attach_inner) ( vlc_object_t *, vlc_object_t * ) ;
- void * (* __vlc_object_create_inner) ( vlc_object_t *, int ) ;
- void (* __vlc_object_destroy_inner) ( vlc_object_t * ) ;
- void (* __vlc_object_detach_all_inner) ( vlc_object_t * ) ;
- void (* __vlc_object_detach_inner) ( vlc_object_t *, vlc_object_t * ) ;
- void * (* __vlc_object_find_inner) ( vlc_object_t *, int, int ) ;
- void (* __vlc_object_release_inner) ( vlc_object_t * ) ;
- void (* __vlc_object_yield_inner) ( vlc_object_t * ) ;
- void (* __vlc_thread_join_inner) ( vlc_object_t *, char *, int ) ;
- void (* __vlc_thread_ready_inner) ( vlc_object_t * ) ;
void (* vout_AllocatePicture_inner) ( vout_thread_t *, picture_t *, int, int, u32 ) ;
void (* vout_DatePicture_inner) ( vout_thread_t *, picture_t *, mtime_t ) ;
void (* vout_DestroyPicture_inner) ( vout_thread_t *, picture_t * ) ;
void (* vout_LinkPicture_inner) ( vout_thread_t *, picture_t * ) ;
void (* vout_PlacePicture_inner) ( vout_thread_t *, int, int, int *, int *, int *, int * ) ;
void (* vout_UnlinkPicture_inner) ( vout_thread_t *, picture_t * ) ;
+ void * (* __vlc_object_create_inner) ( vlc_object_t *, int ) ;
+ void * (* __vlc_object_find_inner) ( vlc_object_t *, int, int ) ;
vout_thread_t * (* __vout_CreateThread_inner) ( vlc_object_t *, int, int, u32, int ) ;
};
#ifdef __PLUGIN__
-# define __aout_CreateFifo p_symbols->__aout_CreateFifo_inner
-# define aout_DestroyFifo p_symbols->aout_DestroyFifo_inner
# define BitstreamNextDataPacket p_symbols->BitstreamNextDataPacket_inner
-# define config_Duplicate p_symbols->config_Duplicate_inner
-# define config_FindConfig p_symbols->config_FindConfig_inner
+# define CurrentPTS p_symbols->CurrentPTS_inner
+# define DecodeLanguage p_symbols->DecodeLanguage_inner
+# define DecoderError p_symbols->DecoderError_inner
+# define GetLang_1 p_symbols->GetLang_1_inner
+# define GetLang_2B p_symbols->GetLang_2B_inner
+# define GetLang_2T p_symbols->GetLang_2T_inner
+# define InitBitstream p_symbols->InitBitstream_inner
+# define NextDataPacket p_symbols->NextDataPacket_inner
+# define UnalignedGetBits p_symbols->UnalignedGetBits_inner
+# define UnalignedRemoveBits p_symbols->UnalignedRemoveBits_inner
+# define UnalignedShowBits p_symbols->UnalignedShowBits_inner
+# define __aout_CreateFifo p_symbols->__aout_CreateFifo_inner
# define __config_GetFloat p_symbols->__config_GetFloat_inner
-# define config_GetHomeDir p_symbols->config_GetHomeDir_inner
# define __config_GetInt p_symbols->__config_GetInt_inner
# define __config_GetPsz p_symbols->__config_GetPsz_inner
# define __config_LoadCmdLine p_symbols->__config_LoadCmdLine_inner
# define __config_PutInt p_symbols->__config_PutInt_inner
# define __config_PutPsz p_symbols->__config_PutPsz_inner
# define __config_SaveConfigFile p_symbols->__config_SaveConfigFile_inner
+# define __input_FDClose p_symbols->__input_FDClose_inner
+# define __input_FDNetworkClose p_symbols->__input_FDNetworkClose_inner
+# define __input_Seek p_symbols->__input_Seek_inner
+# define __input_SetStatus p_symbols->__input_SetStatus_inner
+# define __input_Tell p_symbols->__input_Tell_inner
+# define __intf_Create p_symbols->__intf_Create_inner
+# define __intf_Eject p_symbols->__intf_Eject_inner
+# define __module_Need p_symbols->__module_Need_inner
+# define __module_Unneed p_symbols->__module_Unneed_inner
+# define __msg_Dbg p_symbols->__msg_Dbg_inner
+# define __msg_Err p_symbols->__msg_Err_inner
+# define __msg_Generic p_symbols->__msg_Generic_inner
+# define __msg_Info p_symbols->__msg_Info_inner
+# define __msg_Subscribe p_symbols->__msg_Subscribe_inner
+# define __msg_Unsubscribe p_symbols->__msg_Unsubscribe_inner
+# define __msg_Warn p_symbols->__msg_Warn_inner
+# define __network_ChannelCreate p_symbols->__network_ChannelCreate_inner
+# define __network_ChannelJoin p_symbols->__network_ChannelJoin_inner
+# define __vlc_cond_destroy p_symbols->__vlc_cond_destroy_inner
+# define __vlc_cond_init p_symbols->__vlc_cond_init_inner
+# define __vlc_dumpstructure p_symbols->__vlc_dumpstructure_inner
+# define __vlc_mutex_destroy p_symbols->__vlc_mutex_destroy_inner
+# define __vlc_mutex_init p_symbols->__vlc_mutex_init_inner
+# define __vlc_object_attach p_symbols->__vlc_object_attach_inner
+# define __vlc_object_create p_symbols->__vlc_object_create_inner
+# define __vlc_object_destroy p_symbols->__vlc_object_destroy_inner
+# define __vlc_object_detach p_symbols->__vlc_object_detach_inner
+# define __vlc_object_detach_all p_symbols->__vlc_object_detach_all_inner
+# define __vlc_object_find p_symbols->__vlc_object_find_inner
+# define __vlc_object_release p_symbols->__vlc_object_release_inner
+# define __vlc_object_yield p_symbols->__vlc_object_yield_inner
+# define __vlc_thread_create p_symbols->__vlc_thread_create_inner
+# define __vlc_thread_join p_symbols->__vlc_thread_join_inner
+# define __vlc_thread_ready p_symbols->__vlc_thread_ready_inner
+# define __vlc_threads_end p_symbols->__vlc_threads_end_inner
+# define __vlc_threads_init p_symbols->__vlc_threads_init_inner
+# define __vout_CreateThread p_symbols->__vout_CreateThread_inner
+# define aout_DestroyFifo p_symbols->aout_DestroyFifo_inner
+# define config_Duplicate p_symbols->config_Duplicate_inner
+# define config_FindConfig p_symbols->config_FindConfig_inner
+# define config_GetHomeDir p_symbols->config_GetHomeDir_inner
# define config_SetCallbacks p_symbols->config_SetCallbacks_inner
# define config_UnsetCallbacks p_symbols->config_UnsetCallbacks_inner
-# define CurrentPTS p_symbols->CurrentPTS_inner
-# define DecodeLanguage p_symbols->DecodeLanguage_inner
-# define DecoderError p_symbols->DecoderError_inner
-# define GetLang_1 p_symbols->GetLang_1_inner
-# define GetLang_2B p_symbols->GetLang_2B_inner
-# define GetLang_2T p_symbols->GetLang_2T_inner
-# define InitBitstream p_symbols->InitBitstream_inner
# define input_AccessEnd p_symbols->input_AccessEnd_inner
# define input_AccessInit p_symbols->input_AccessInit_inner
# define input_AccessReinit p_symbols->input_AccessReinit_inner
# define input_DecodePES p_symbols->input_DecodePES_inner
# define input_DelArea p_symbols->input_DelArea_inner
# define input_DelES p_symbols->input_DelES_inner
-# define input_DeletePacket p_symbols->input_DeletePacket_inner
-# define input_DeletePES p_symbols->input_DeletePES_inner
# define input_DelProgram p_symbols->input_DelProgram_inner
+# define input_DeletePES p_symbols->input_DeletePES_inner
+# define input_DeletePacket p_symbols->input_DeletePacket_inner
# define input_DemuxPS p_symbols->input_DemuxPS_inner
# define input_DemuxTS p_symbols->input_DemuxTS_inner
# define input_DumpStream p_symbols->input_DumpStream_inner
# define input_EndStream p_symbols->input_EndStream_inner
-# define input_FDClose p_symbols->input_FDClose_inner
-# define input_FDNetworkClose p_symbols->input_FDNetworkClose_inner
# define input_FDNetworkRead p_symbols->input_FDNetworkRead_inner
# define input_FDRead p_symbols->input_FDRead_inner
# define input_FDSeek p_symbols->input_FDSeek_inner
# define input_InfoCategory p_symbols->input_InfoCategory_inner
# define input_InitStream p_symbols->input_InitStream_inner
# define input_NewBuffer p_symbols->input_NewBuffer_inner
-# define input_NewPacket p_symbols->input_NewPacket_inner
# define input_NewPES p_symbols->input_NewPES_inner
+# define input_NewPacket p_symbols->input_NewPacket_inner
# define input_OffsetToTime p_symbols->input_OffsetToTime_inner
# define input_ParsePES p_symbols->input_ParsePES_inner
# define input_ParsePS p_symbols->input_ParsePS_inner
# define input_ReadPS p_symbols->input_ReadPS_inner
# define input_ReadTS p_symbols->input_ReadTS_inner
# define input_ReleaseBuffer p_symbols->input_ReleaseBuffer_inner
-# define __input_Seek p_symbols->__input_Seek_inner
# define input_SelectES p_symbols->input_SelectES_inner
# define input_SetProgram p_symbols->input_SetProgram_inner
-# define __input_SetStatus p_symbols->__input_SetStatus_inner
# define input_ShareBuffer p_symbols->input_ShareBuffer_inner
# define input_SplitBuffer p_symbols->input_SplitBuffer_inner
-# define __input_Tell p_symbols->__input_Tell_inner
# define input_ToggleES p_symbols->input_ToggleES_inner
# define input_UnselectES p_symbols->input_UnselectES_inner
-# define __intf_Create p_symbols->__intf_Create_inner
# define intf_Destroy p_symbols->intf_Destroy_inner
-# define __intf_Eject p_symbols->__intf_Eject_inner
# define intf_RunThread p_symbols->intf_RunThread_inner
# define intf_StopThread p_symbols->intf_StopThread_inner
# define mdate p_symbols->mdate_inner
-# define __module_Need p_symbols->__module_Need_inner
-# define module_Unneed p_symbols->module_Unneed_inner
-# define __msg_Dbg p_symbols->__msg_Dbg_inner
-# define __msg_Err p_symbols->__msg_Err_inner
-# define __msg_Generic p_symbols->__msg_Generic_inner
-# define __msg_Info p_symbols->__msg_Info_inner
-# define __msg_Subscribe p_symbols->__msg_Subscribe_inner
-# define __msg_Unsubscribe p_symbols->__msg_Unsubscribe_inner
-# define __msg_Warn p_symbols->__msg_Warn_inner
# define msleep p_symbols->msleep_inner
# define mstrtime p_symbols->mstrtime_inner
# define mwait p_symbols->mwait_inner
-# define __network_ChannelCreate p_symbols->__network_ChannelCreate_inner
-# define __network_ChannelJoin p_symbols->__network_ChannelJoin_inner
-# define NextDataPacket p_symbols->NextDataPacket_inner
# define playlist_Add p_symbols->playlist_Add_inner
# define playlist_Command p_symbols->playlist_Command_inner
# define playlist_Delete p_symbols->playlist_Delete_inner
-# define UnalignedGetBits p_symbols->UnalignedGetBits_inner
-# define UnalignedRemoveBits p_symbols->UnalignedRemoveBits_inner
-# define UnalignedShowBits p_symbols->UnalignedShowBits_inner
-# define __vlc_cond_destroy p_symbols->__vlc_cond_destroy_inner
-# define __vlc_cond_init p_symbols->__vlc_cond_init_inner
-# define __vlc_dumpstructure p_symbols->__vlc_dumpstructure_inner
-# define __vlc_mutex_destroy p_symbols->__vlc_mutex_destroy_inner
-# define __vlc_mutex_init p_symbols->__vlc_mutex_init_inner
-# define __vlc_object_attach p_symbols->__vlc_object_attach_inner
-# define __vlc_object_create p_symbols->__vlc_object_create_inner
-# define __vlc_object_destroy p_symbols->__vlc_object_destroy_inner
-# define __vlc_object_detach_all p_symbols->__vlc_object_detach_all_inner
-# define __vlc_object_detach p_symbols->__vlc_object_detach_inner
-# define __vlc_object_find p_symbols->__vlc_object_find_inner
-# define __vlc_object_release p_symbols->__vlc_object_release_inner
-# define __vlc_object_yield p_symbols->__vlc_object_yield_inner
-# define __vlc_thread_create p_symbols->__vlc_thread_create_inner
-# define __vlc_thread_join p_symbols->__vlc_thread_join_inner
-# define __vlc_thread_ready p_symbols->__vlc_thread_ready_inner
-# define __vlc_threads_end p_symbols->__vlc_threads_end_inner
-# define __vlc_threads_init p_symbols->__vlc_threads_init_inner
# define vout_AllocatePicture p_symbols->vout_AllocatePicture_inner
# define vout_ChromaCmp p_symbols->vout_ChromaCmp_inner
# define vout_CreatePicture p_symbols->vout_CreatePicture_inner
# define vout_CreateSubPicture p_symbols->vout_CreateSubPicture_inner
-# define __vout_CreateThread p_symbols->__vout_CreateThread_inner
# define vout_DatePicture p_symbols->vout_DatePicture_inner
# define vout_DestroyPicture p_symbols->vout_DestroyPicture_inner
# define vout_DestroySubPicture p_symbols->vout_DestroySubPicture_inner
* This header provides a portable threads implementation.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: vlc_threads.h,v 1.7 2002/07/30 07:56:40 gbazin Exp $
+ * $Id: vlc_threads.h,v 1.8 2002/07/31 20:56:50 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
* vlc_threads_init: initialize threads system
*****************************************************************************/
#define vlc_threads_init( P_THIS ) \
- __vlc_threads_init( CAST_TO_VLC_OBJECT(P_THIS) )
+ __vlc_threads_init( VLC_OBJECT(P_THIS) )
/*****************************************************************************
* vlc_threads_end: deinitialize threads system
*****************************************************************************/
#define vlc_threads_end( P_THIS ) \
- __vlc_threads_end( CAST_TO_VLC_OBJECT(P_THIS) )
+ __vlc_threads_end( VLC_OBJECT(P_THIS) )
/*****************************************************************************
* vlc_mutex_init: initialize a mutex
*****************************************************************************/
#define vlc_mutex_init( P_THIS, P_MUTEX ) \
- __vlc_mutex_init( CAST_TO_VLC_OBJECT(P_THIS), P_MUTEX )
+ __vlc_mutex_init( VLC_OBJECT(P_THIS), P_MUTEX )
/*****************************************************************************
* vlc_mutex_lock: lock a mutex
* vlc_cond_init: initialize a condition
*****************************************************************************/
#define vlc_cond_init( P_THIS, P_COND ) \
- __vlc_cond_init( CAST_TO_VLC_OBJECT(P_THIS), P_COND )
+ __vlc_cond_init( VLC_OBJECT(P_THIS), P_COND )
/*****************************************************************************
* vlc_cond_signal: start a thread on condition completion
* vlc_thread_create: create a thread
*****************************************************************************/
# define vlc_thread_create( P_THIS, PSZ_NAME, FUNC, WAIT ) \
- __vlc_thread_create( CAST_TO_VLC_OBJECT(P_THIS), __FILE__, __LINE__, PSZ_NAME, (void * ( * ) ( void * ))FUNC, WAIT )
+ __vlc_thread_create( VLC_OBJECT(P_THIS), __FILE__, __LINE__, PSZ_NAME, (void * ( * ) ( void * ))FUNC, WAIT )
/*****************************************************************************
* vlc_thread_ready: tell the parent thread we were successfully spawned
*****************************************************************************/
# define vlc_thread_ready( P_THIS ) \
- __vlc_thread_ready( CAST_TO_VLC_OBJECT(P_THIS) )
+ __vlc_thread_ready( VLC_OBJECT(P_THIS) )
/*****************************************************************************
* vlc_thread_join: wait until a thread exits
*****************************************************************************/
#ifdef DEBUG
# define vlc_thread_join( P_THIS ) \
- __vlc_thread_join( CAST_TO_VLC_OBJECT(P_THIS), __FILE__, __LINE__ )
+ __vlc_thread_join( VLC_OBJECT(P_THIS), __FILE__, __LINE__ )
#else
# define vlc_thread_join( P_THIS ) \
- __vlc_thread_join( CAST_TO_VLC_OBJECT(P_THIS), "(unknown)", 0 )
+ __vlc_thread_join( VLC_OBJECT(P_THIS), "(unknown)", 0 )
#endif
* (http://liba52.sf.net/).
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: a52.c,v 1.21 2002/07/23 00:39:16 sam Exp $
+ * $Id: a52.c,v 1.22 2002/07/31 20:56:50 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int decoder_Probe ( vlc_fourcc_t * );
-static int decoder_Run ( decoder_fifo_t * );
+static int OpenDecoder ( vlc_object_t * );
+static int RunDecoder ( decoder_fifo_t * );
static int DecodeFrame ( a52_adec_thread_t * );
static int InitThread ( a52_adec_thread_t * );
static void EndThread ( a52_adec_thread_t * );
static inline int16_t convert ( int32_t );
/*****************************************************************************
- * Capabilities
- *****************************************************************************/
-void _M( adec_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.dec.pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
-}
-
-/*****************************************************************************
- * Build configuration structure.
+ * Module descriptor
*****************************************************************************/
#define DYNRNG_TEXT N_("A/52 dynamic range compression")
#define DYNRNG_LONGTEXT N_( \
"compression the playback will be more adapted to a movie theater or a " \
"listening room.")
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_BOOL ( "a52-dynrng", 1, NULL, DYNRNG_TEXT, DYNRNG_LONGTEXT )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("a52 ATSC A/52 aka AC-3 audio decoder module") )
- ADD_CAPABILITY( DECODER, 60 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( adec_getfunctions )( &p_module->p_functions->dec );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_bool( "a52-dynrng", 1, NULL, DYNRNG_TEXT, DYNRNG_LONGTEXT );
+ set_description( _("a52 ATSC A/52 aka AC-3 audio decoder module") );
+ set_capability( "decoder", 60 );
+ set_callbacks( OpenDecoder, NULL );
+vlc_module_end();
/*****************************************************************************
- * decoder_Probe: probe the decoder and return score
+ * OpenDecoder: probe the decoder and return score
*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to choose.
*****************************************************************************/
-static int decoder_Probe( vlc_fourcc_t *pi_type )
+static int OpenDecoder( vlc_object_t *p_this )
{
- return *pi_type == VLC_FOURCC('a','5','2',' ') ? 0 : -1;
+ decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
+
+ if( p_fifo->i_fourcc != VLC_FOURCC('a','5','2',' ') )
+ {
+ return VLC_EGENERIC;
+ }
+
+ p_fifo->pf_run = RunDecoder;
+ return VLC_SUCCESS;
}
/*****************************************************************************
- * decoder_Run: this function is called just after the thread is created
+ * RunDecoder: this function is called just after the thread is created
*****************************************************************************/
-static int decoder_Run ( decoder_fifo_t *p_fifo )
+static int RunDecoder( decoder_fifo_t *p_fifo )
{
a52_adec_thread_t *p_a52_adec;
* a52_system.c : A52 input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: a52_system.c,v 1.2 2002/07/23 00:39:16 sam Exp $
+ * $Id: a52_system.c,v 1.3 2002/07/31 20:56:50 sam Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static void input_getfunctions( function_list_t * p_function_list );
-static int Demux ( struct input_thread_s * );
-static int Init ( struct input_thread_s * );
-static void End ( struct input_thread_s * );
-
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("A52 input") )
- ADD_CAPABILITY( DEMUX, 150 )
- ADD_SHORTCUT( "a52sys" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- input_getfunctions( &p_module->p_functions->demux );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+static int Init ( vlc_object_t * );
+static int Demux ( input_thread_t * );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Module descriptor
*****************************************************************************/
-static void input_getfunctions( function_list_t * p_function_list )
-{
-#define input p_function_list->functions.demux
- input.pf_init = Init;
- input.pf_end = End;
- input.pf_demux = Demux;
- input.pf_rewind = NULL;
-#undef input
-}
-
-/*
- * Data reading functions
- */
+vlc_module_begin();
+ set_description( "A52 demuxer" );
+ set_capability( "demux", 150 );
+ set_callbacks( Init, NULL );
+ add_shortcut( "a52sys" );
+vlc_module_end();
/*****************************************************************************
* Init: initializes ES structures
*****************************************************************************/
-static int Init( input_thread_t * p_input )
+static int Init( vlc_object_t * p_this )
{
+ input_thread_t * p_input = (input_thread_t *)p_this;
es_descriptor_t * p_es;
byte_t * p_peek;
p_input->i_bufsize = INPUT_DEFAULT_BUFSIZE;
}
+ p_input->pf_demux = Demux;
+ p_input->pf_rewind = NULL;
+
/* Have a peep at the show. */
if( input_Peek( p_input, &p_peek, 2 ) < 2 )
{
return( 0 );
}
-/*****************************************************************************
- * End: frees unused data
- *****************************************************************************/
-static void End( input_thread_t * p_input )
-{
-}
-
/*****************************************************************************
* Demux: reads and demuxes data packets
*****************************************************************************
* vout_aa.c: Aa video output display method for testing purposes
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: aa.c,v 1.8 2002/07/23 00:39:16 sam Exp $
+ * $Id: aa.c,v 1.9 2002/07/31 20:56:50 sam Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
#include <vlc/intf.h>
/*****************************************************************************
- * Capabilities defined in the other files.
- *****************************************************************************/
-static void vout_getfunctions ( function_list_t * p_function_list );
-
-/*****************************************************************************
- * Build configuration tree.
+ * Local prototypes
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("ASCII-art video output module") )
- ADD_CAPABILITY( VOUT, 10 )
- ADD_SHORTCUT( "aalib" )
-MODULE_INIT_STOP
+static int Create ( vlc_object_t * );
+static void Destroy ( vlc_object_t * );
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static int Manage ( vout_thread_t * );
+static void Render ( vout_thread_t *, picture_t * );
+static void Display ( vout_thread_t *, picture_t * );
-MODULE_ACTIVATE_START
- vout_getfunctions( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
+static void SetPalette ( vout_thread_t *, u16 *, u16 *, u16 * );
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+/*****************************************************************************
+ * Module descriptor
+ *****************************************************************************/
+vlc_module_begin();
+ set_description( _("ASCII-art video output module") );
+ set_capability( "video output", 10 );
+ add_shortcut( "aalib" );
+ set_callbacks( Create, Destroy );
+vlc_module_end();
/*****************************************************************************
* vout_sys_t: aa video output method descriptor
};
/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static int vout_Create ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static int vout_Manage ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
-
-static void SetPalette ( vout_thread_t *, u16 *, u16 *, u16 * );
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocates aa video thread output method
+ * Create: allocates aa video thread output method
*****************************************************************************
* This function allocates and initializes a aa vout method.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
+static int Create( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
/* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
return( 1 );
}
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = Manage;
+ p_vout->pf_render = Render;
+ p_vout->pf_display = Display;
+
p_vout->p_sys->i_width = aa_imgwidth(p_vout->p_sys->aa_context);
p_vout->p_sys->i_height = aa_imgheight(p_vout->p_sys->aa_context);
aa_autoinitkbd( p_vout->p_sys->aa_context, 0 );
}
/*****************************************************************************
- * vout_Init: initialize aa video thread output method
+ * Init: initialize aa video thread output method
*****************************************************************************/
-static int vout_Init( vout_thread_t *p_vout )
+static int Init( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic = NULL;
}
/*****************************************************************************
- * vout_End: terminate aa video thread output method
+ * End: terminate aa video thread output method
*****************************************************************************/
-static void vout_End( vout_thread_t *p_vout )
+static void End( vout_thread_t *p_vout )
{
;
}
/*****************************************************************************
- * vout_Destroy: destroy aa video thread output method
+ * Destroy: destroy aa video thread output method
*****************************************************************************
* Terminate an output method created by AaCreateOutputMethod
*****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
+static void Destroy( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
aa_close( p_vout->p_sys->aa_context );
free( p_vout->p_sys );
}
/*****************************************************************************
- * vout_Manage: handle aa events
+ * Manage: handle aa events
*****************************************************************************
* This function should be called regularly by video output thread. It manages
* console events. It returns a non null value on error.
*****************************************************************************/
-static int vout_Manage( vout_thread_t *p_vout )
+static int Manage( vout_thread_t *p_vout )
{
int event, x, y, b;
event = aa_getevent( p_vout->p_sys->aa_context, 0 );
}
/*****************************************************************************
- * vout_Render: render previously calculated output
+ * Render: render previously calculated output
*****************************************************************************/
-static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
+static void Render( vout_thread_t *p_vout, picture_t *p_pic )
{
aa_fastrender( p_vout->p_sys->aa_context, 0, 0,
aa_imgwidth( p_vout->p_sys->aa_context ),
}
/*****************************************************************************
- * vout_Display: displays previously rendered output
+ * Display: displays previously rendered output
*****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+static void Display( vout_thread_t *p_vout, picture_t *p_pic )
{
/* No need to do anything, the fake direct buffers stay as they are */
int i_width, i_height, i_x, i_y;
* ac3_adec.c: ac3 decoder module main file
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: ac3_adec.c,v 1.34 2002/07/23 00:39:16 sam Exp $
+ * $Id: ac3_adec.c,v 1.35 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int decoder_Probe ( vlc_fourcc_t * );
-static int decoder_Run ( decoder_fifo_t * );
+static int OpenDecoder ( vlc_object_t * );
+static int RunDecoder ( decoder_fifo_t * );
static int InitThread ( ac3dec_t * p_adec );
static void EndThread ( ac3dec_t * p_adec );
static void BitstreamCallback ( bit_stream_t *p_bit_stream,
vlc_bool_t b_new_pes );
/*****************************************************************************
- * Capabilities
+ * Module descriptor
*****************************************************************************/
-void _M( adec_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.dec.pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
-}
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_module ( "ac3-downmix", "downmix", NULL, NULL,
+ N_("AC3 downmix module"), NULL );
+ add_module ( "ac3-imdct", "imdct", NULL, NULL,
+ N_("AC3 IMDCT module"), NULL );
+ set_description( _("software AC3 decoder") );
+ set_capability( "decoder", 50 );
+ set_callbacks( OpenDecoder, NULL );
+ add_shortcut( "ac3" );
+vlc_module_end();
/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-/* Variable containing the AC3 downmix method */
-#define DOWNMIX_METHOD_VAR "ac3-downmix"
-/* Variable containing the AC3 IMDCT method */
-#define IMDCT_METHOD_VAR "ac3-imdct"
-
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL)
-ADD_MODULE ( DOWNMIX_METHOD_VAR, MODULE_CAPABILITY_DOWNMIX, NULL, NULL,
- N_("AC3 downmix module"), NULL )
-ADD_MODULE ( IMDCT_METHOD_VAR, MODULE_CAPABILITY_IMDCT, NULL, NULL,
- N_("AC3 IMDCT module"), NULL )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("software AC3 decoder") )
- ADD_CAPABILITY( DECODER, 50 )
- ADD_SHORTCUT( "ac3" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( adec_getfunctions )( &p_module->p_functions->dec );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-
-/*****************************************************************************
- * decoder_Probe: probe the decoder and return score
+ * OpenDecoder: probe the decoder and return score
*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
-static int decoder_Probe( vlc_fourcc_t *pi_type )
+static int OpenDecoder( vlc_object_t *p_this )
{
- return *pi_type == VLC_FOURCC('a','5','2',' ') ? 0 : -1;
+ decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
+
+ if( p_fifo->i_fourcc != VLC_FOURCC('a','5','2',' ') )
+ {
+ return VLC_EGENERIC;
+ }
+
+ p_fifo->pf_run = RunDecoder;
+ return VLC_SUCCESS;
}
/*****************************************************************************
- * decoder_Run: this function is called just after the thread is created
+ * RunDecoder: this function is called just after the thread is created
*****************************************************************************/
-static int decoder_Run ( decoder_fifo_t * p_fifo )
+static int RunDecoder( decoder_fifo_t *p_fifo )
{
ac3dec_t * p_ac3dec;
void * p_orig; /* pointer before memalign */
/*
* Choose the best downmix module
*/
-#define DOWNMIX p_ac3dec->downmix
- psz_name = config_GetPsz( p_ac3dec->p_fifo, DOWNMIX_METHOD_VAR );
- DOWNMIX.p_module = module_Need( p_ac3dec->p_fifo,
- MODULE_CAPABILITY_DOWNMIX, psz_name, NULL );
+ p_ac3dec->p_downmix = vlc_object_create( p_ac3dec->p_fifo,
+ sizeof( downmix_t ) );
+ p_ac3dec->p_downmix->psz_object_name = "downmix";
+
+ psz_name = config_GetPsz( p_ac3dec->p_downmix, "ac3-downmix" );
+ p_ac3dec->p_downmix->p_module =
+ module_Need( p_ac3dec->p_downmix, "downmix", psz_name );
if( psz_name ) free( psz_name );
- if( DOWNMIX.p_module == NULL )
+ if( p_ac3dec->p_downmix->p_module == NULL )
{
msg_Err( p_ac3dec->p_fifo, "no suitable downmix module" );
+ vlc_object_destroy( p_ac3dec->p_downmix );
return( -1 );
}
-#define F DOWNMIX.p_module->p_functions->downmix.functions.downmix
- DOWNMIX.pf_downmix_3f_2r_to_2ch = F.pf_downmix_3f_2r_to_2ch;
- DOWNMIX.pf_downmix_2f_2r_to_2ch = F.pf_downmix_2f_2r_to_2ch;
- DOWNMIX.pf_downmix_3f_1r_to_2ch = F.pf_downmix_3f_1r_to_2ch;
- DOWNMIX.pf_downmix_2f_1r_to_2ch = F.pf_downmix_2f_1r_to_2ch;
- DOWNMIX.pf_downmix_3f_0r_to_2ch = F.pf_downmix_3f_0r_to_2ch;
- DOWNMIX.pf_stream_sample_2ch_to_s16 = F.pf_stream_sample_2ch_to_s16;
- DOWNMIX.pf_stream_sample_1ch_to_s16 = F.pf_stream_sample_1ch_to_s16;
-#undef F
-#undef DOWNMIX
-
/*
* Choose the best IMDCT module
*/
- p_ac3dec->imdct = vlc_memalign( &p_ac3dec->imdct_orig,
- 16, sizeof(imdct_t) );
+ p_ac3dec->p_imdct = vlc_object_create( p_ac3dec->p_fifo,
+ sizeof( imdct_t ) );
-#define IMDCT p_ac3dec->imdct
- psz_name = config_GetPsz( p_ac3dec->p_fifo, IMDCT_METHOD_VAR );
- IMDCT->p_module = module_Need( p_ac3dec->p_fifo,
- MODULE_CAPABILITY_IMDCT, psz_name, NULL );
+#define IMDCT p_ac3dec->p_imdct
+ psz_name = config_GetPsz( p_ac3dec->p_fifo, "ac3-imdct" );
+ p_ac3dec->p_imdct->p_module =
+ module_Need( p_ac3dec->p_imdct, "imdct", psz_name );
if( psz_name ) free( psz_name );
- if( IMDCT->p_module == NULL )
+ if( p_ac3dec->p_imdct->p_module == NULL )
{
msg_Err( p_ac3dec->p_fifo, "no suitable IMDCT module" );
- module_Unneed( p_ac3dec->downmix.p_module );
- free( p_ac3dec->imdct_orig );
+ vlc_object_destroy( p_ac3dec->p_imdct );
+ module_Unneed( p_ac3dec->p_downmix, p_ac3dec->p_downmix->p_module );
+ vlc_object_destroy( p_ac3dec->p_downmix );
return( -1 );
}
-#define F IMDCT->p_module->p_functions->imdct.functions.imdct
- IMDCT->pf_imdct_init = F.pf_imdct_init;
- IMDCT->pf_imdct_256 = F.pf_imdct_256;
- IMDCT->pf_imdct_256_nol = F.pf_imdct_256_nol;
- IMDCT->pf_imdct_512 = F.pf_imdct_512;
- IMDCT->pf_imdct_512_nol = F.pf_imdct_512_nol;
-#undef F
-
/* Initialize the ac3 decoder structures */
p_ac3dec->samples = vlc_memalign( &p_ac3dec->samples_orig,
16, 6 * 256 * sizeof(float) );
16, 64 * sizeof(complex_t) );
#undef IMDCT
- _M( ac3_init )( p_ac3dec );
+ E_( ac3_init )( p_ac3dec );
/*
* Initialize the output properties
}
/* Free allocated structures */
-#define IMDCT p_ac3dec->imdct
+#define IMDCT p_ac3dec->p_imdct
free( IMDCT->w_1_orig );
free( IMDCT->w_64_orig );
free( IMDCT->w_32_orig );
free( p_ac3dec->samples_orig );
/* Unlock the modules */
- module_Unneed( p_ac3dec->downmix.p_module );
- module_Unneed( p_ac3dec->imdct->p_module );
+ module_Unneed( p_ac3dec->p_downmix, p_ac3dec->p_downmix->p_module );
+ vlc_object_destroy( p_ac3dec->p_downmix );
+
+ module_Unneed( p_ac3dec->p_imdct, p_ac3dec->p_imdct->p_module );
+ vlc_object_destroy( p_ac3dec->p_imdct );
/* Free what's left of the decoder */
free( p_ac3dec->imdct_orig );
* ac3_adec.h : ac3 decoder interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_adec.h,v 1.4 2002/06/01 12:31:58 sam Exp $
+ * $Id: ac3_adec.h,v 1.5 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Renaud Dartus <reno@videolan.org>
/**** ac3 decoder API - functions publically provided by the ac3 decoder ****/
-int _M( ac3_init )(ac3dec_t * p_ac3dec);
+int E_( ac3_init )(ac3dec_t * p_ac3dec);
int ac3_sync_frame (ac3dec_t * p_ac3dec, ac3_sync_info_t * p_sync_info);
int ac3_decode_frame (ac3dec_t * p_ac3dec, s16 * buffer);
bit_allocate_t bit_allocate;
mantissa_t mantissa;
- downmix_t downmix;
+ downmix_t * p_downmix;
/*
* Output properties
float * samples;
void * samples_orig; /* pointer before memalign */
- imdct_t * imdct;
+ imdct_t * p_imdct;
void * imdct_orig; /* pointer before memalign */
};
* ac3_decoder.c: core ac3 decoder
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: ac3_decoder.c,v 1.8 2002/06/01 12:31:58 sam Exp $
+ * $Id: ac3_decoder.c,v 1.9 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@zoy.org>
static const float cmixlev_lut[4] = { 0.707, 0.595, 0.500, 0.707 };
static const float smixlev_lut[4] = { 0.707, 0.500, 0.0 , 0.500 };
-int _M( ac3_init )(ac3dec_t * p_ac3dec)
+int E_( ac3_init )(ac3dec_t * p_ac3dec)
{
p_ac3dec->mantissa.lfsr_state = 1; /* dither_gen initialization */
- _M( imdct_init )(p_ac3dec->imdct) ;
+ E_( imdct_init )(p_ac3dec->p_imdct) ;
return 0;
}
* ac3_decoder.h : ac3 decoder interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_decoder.h,v 1.4 2002/04/23 23:44:36 fenrir Exp $
+ * $Id: ac3_decoder.h,v 1.5 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Renaud Dartus <reno@videolan.org>
/**** ac3 decoder API - functions publically provided by the ac3 decoder ****/
-int _M( ac3_init )(ac3dec_t * p_ac3dec);
+int E_( ac3_init )(ac3dec_t * p_ac3dec);
int ac3_sync_frame (ac3dec_t * p_ac3dec, ac3_sync_info_t * p_sync_info);
int ac3_decode_frame (ac3dec_t * p_ac3dec, s16 * buffer);
* ac3_imdct.c: ac3 DCT
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: ac3_imdct.c,v 1.9 2002/06/01 12:31:58 sam Exp $
+ * $Id: ac3_imdct.c,v 1.10 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
# define M_PI 3.14159265358979323846
#endif
-void _M( imdct_init )(imdct_t * p_imdct)
+void E_( imdct_init )(imdct_t * p_imdct)
{
int i;
float scale = 181.019;
/* test if dm in frequency is doable */
if (!(doable = p_ac3dec->audblk.blksw[0]))
{
- do_imdct = p_ac3dec->imdct->pf_imdct_512;
+ do_imdct = p_ac3dec->p_imdct->pf_imdct_512;
}
else
{
- do_imdct = p_ac3dec->imdct->pf_imdct_256;
+ do_imdct = p_ac3dec->p_imdct->pf_imdct_256;
}
/* downmix in the frequency domain if all the channels
switch(p_ac3dec->bsi.acmod)
{
case 7: /* 3/2 */
- p_ac3dec->downmix.pf_downmix_3f_2r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
+ p_ac3dec->p_downmix->pf_downmix_3f_2r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
break;
case 6: /* 2/2 */
- p_ac3dec->downmix.pf_downmix_2f_2r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
+ p_ac3dec->p_downmix->pf_downmix_2f_2r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
break;
case 5: /* 3/1 */
- p_ac3dec->downmix.pf_downmix_3f_1r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
+ p_ac3dec->p_downmix->pf_downmix_3f_1r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
break;
case 4: /* 2/1 */
- p_ac3dec->downmix.pf_downmix_2f_1r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
+ p_ac3dec->p_downmix->pf_downmix_2f_1r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
break;
case 3: /* 3/0 */
- p_ac3dec->downmix.pf_downmix_3f_0r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
+ p_ac3dec->p_downmix->pf_downmix_3f_0r_to_2ch (p_ac3dec->samples, &p_ac3dec->dm_par);
break;
case 2:
break;
center = p_ac3dec->samples;
// else if (p_ac3dec->bsi.acmod == 0)
// center = samples[ac3_config.dual_mono_ch_sel];
- do_imdct(p_ac3dec->imdct, center, p_ac3dec->imdct->delay); /* no downmix*/
+ do_imdct(p_ac3dec->p_imdct, center, p_ac3dec->p_imdct->delay); /* no downmix*/
- p_ac3dec->downmix.pf_stream_sample_1ch_to_s16 (buffer, center);
+ p_ac3dec->p_downmix->pf_stream_sample_1ch_to_s16 (buffer, center);
return;
break;
}
- do_imdct (p_ac3dec->imdct, p_ac3dec->samples, p_ac3dec->imdct->delay);
- do_imdct (p_ac3dec->imdct, p_ac3dec->samples+256, p_ac3dec->imdct->delay+256);
- p_ac3dec->downmix.pf_stream_sample_2ch_to_s16(buffer, p_ac3dec->samples, p_ac3dec->samples+256);
+ do_imdct (p_ac3dec->p_imdct, p_ac3dec->samples, p_ac3dec->p_imdct->delay);
+ do_imdct (p_ac3dec->p_imdct, p_ac3dec->samples+256, p_ac3dec->p_imdct->delay+256);
+ p_ac3dec->p_downmix->pf_stream_sample_2ch_to_s16(buffer, p_ac3dec->samples, p_ac3dec->samples+256);
} else {
/* imdct and then downmix
if (p_ac3dec->audblk.blksw[i])
{
/* There is only a C function */
- p_ac3dec->imdct->pf_imdct_256_nol( p_ac3dec->imdct,
- p_ac3dec->samples+256*i, p_ac3dec->imdct->delay1+256*i );
+ p_ac3dec->p_imdct->pf_imdct_256_nol( p_ac3dec->p_imdct,
+ p_ac3dec->samples+256*i, p_ac3dec->p_imdct->delay1+256*i );
}
else
{
- p_ac3dec->imdct->pf_imdct_512_nol( p_ac3dec->imdct,
- p_ac3dec->samples+256*i, p_ac3dec->imdct->delay1+256*i );
+ p_ac3dec->p_imdct->pf_imdct_512_nol( p_ac3dec->p_imdct,
+ p_ac3dec->samples+256*i, p_ac3dec->p_imdct->delay1+256*i );
}
}
right = p_ac3dec->samples+2*256;
left_sur = p_ac3dec->samples+3*256;
right_sur = p_ac3dec->samples+4*256;
- delay_left = p_ac3dec->imdct->delay;
- delay_right = p_ac3dec->imdct->delay+256;
- delay1_left = p_ac3dec->imdct->delay1;
- delay1_center = p_ac3dec->imdct->delay1+256;
- delay1_right = p_ac3dec->imdct->delay1+2*256;
- delay1_sl = p_ac3dec->imdct->delay1+3*256;
- delay1_sr = p_ac3dec->imdct->delay1+4*256;
+ delay_left = p_ac3dec->p_imdct->delay;
+ delay_right = p_ac3dec->p_imdct->delay+256;
+ delay1_left = p_ac3dec->p_imdct->delay1;
+ delay1_center = p_ac3dec->p_imdct->delay1+256;
+ delay1_right = p_ac3dec->p_imdct->delay1+2*256;
+ delay1_sl = p_ac3dec->p_imdct->delay1+3*256;
+ delay1_sr = p_ac3dec->p_imdct->delay1+4*256;
for (i = 0; i < 256; i++) {
left_tmp = p_ac3dec->dm_par.unit * *left++ + p_ac3dec->dm_par.clev * *center + p_ac3dec->dm_par.slev * *left_sur++;
right = p_ac3dec->samples+256;
left_sur = p_ac3dec->samples+2*256;
right_sur = p_ac3dec->samples+3*256;
- delay_left = p_ac3dec->imdct->delay;
- delay_right = p_ac3dec->imdct->delay+256;
- delay1_left = p_ac3dec->imdct->delay1;
- delay1_right = p_ac3dec->imdct->delay1+256;
- delay1_sl = p_ac3dec->imdct->delay1+2*256;
- delay1_sr = p_ac3dec->imdct->delay1+3*256;
+ delay_left = p_ac3dec->p_imdct->delay;
+ delay_right = p_ac3dec->p_imdct->delay+256;
+ delay1_left = p_ac3dec->p_imdct->delay1;
+ delay1_right = p_ac3dec->p_imdct->delay1+256;
+ delay1_sl = p_ac3dec->p_imdct->delay1+2*256;
+ delay1_sr = p_ac3dec->p_imdct->delay1+3*256;
for (i = 0; i < 256; i++) {
left_tmp = p_ac3dec->dm_par.unit * *left++ + p_ac3dec->dm_par.slev * *left_sur++;
center = p_ac3dec->samples+256;
right = p_ac3dec->samples+2*256;
right_sur = p_ac3dec->samples+3*256;
- delay_left = p_ac3dec->imdct->delay;
- delay_right = p_ac3dec->imdct->delay+256;
- delay1_left = p_ac3dec->imdct->delay1;
- delay1_center = p_ac3dec->imdct->delay1+256;
- delay1_right = p_ac3dec->imdct->delay1+2*256;
- delay1_sl = p_ac3dec->imdct->delay1+3*256;
+ delay_left = p_ac3dec->p_imdct->delay;
+ delay_right = p_ac3dec->p_imdct->delay+256;
+ delay1_left = p_ac3dec->p_imdct->delay1;
+ delay1_center = p_ac3dec->p_imdct->delay1+256;
+ delay1_right = p_ac3dec->p_imdct->delay1+2*256;
+ delay1_sl = p_ac3dec->p_imdct->delay1+3*256;
for (i = 0; i < 256; i++) {
left_tmp = p_ac3dec->dm_par.unit * *left++ + p_ac3dec->dm_par.clev * *center - p_ac3dec->dm_par.slev * *right_sur;
left = p_ac3dec->samples;
right = p_ac3dec->samples+256;
right_sur = p_ac3dec->samples+2*256;
- delay_left = p_ac3dec->imdct->delay;
- delay_right = p_ac3dec->imdct->delay+256;
- delay1_left = p_ac3dec->imdct->delay1;
- delay1_right = p_ac3dec->imdct->delay1+256;
- delay1_sl = p_ac3dec->imdct->delay1+2*256;
+ delay_left = p_ac3dec->p_imdct->delay;
+ delay_right = p_ac3dec->p_imdct->delay+256;
+ delay1_left = p_ac3dec->p_imdct->delay1;
+ delay1_right = p_ac3dec->p_imdct->delay1+256;
+ delay1_sl = p_ac3dec->p_imdct->delay1+2*256;
for (i = 0; i < 256; i++) {
left_tmp = p_ac3dec->dm_par.unit * *left++ - p_ac3dec->dm_par.slev * *right_sur;
left = p_ac3dec->samples;
center = p_ac3dec->samples+256;
right = p_ac3dec->samples+2*256;
- delay_left = p_ac3dec->imdct->delay;
- delay_right = p_ac3dec->imdct->delay+256;
- delay1_left = p_ac3dec->imdct->delay1;
- delay1_center = p_ac3dec->imdct->delay1+256;
- delay1_right = p_ac3dec->imdct->delay1+2*256;
+ delay_left = p_ac3dec->p_imdct->delay;
+ delay_right = p_ac3dec->p_imdct->delay+256;
+ delay1_left = p_ac3dec->p_imdct->delay1;
+ delay1_center = p_ac3dec->p_imdct->delay1+256;
+ delay1_right = p_ac3dec->p_imdct->delay1+2*256;
for (i = 0; i < 256; i++) {
left_tmp = p_ac3dec->dm_par.unit * *left++ + p_ac3dec->dm_par.clev * *center;
* ac3_internals.h: needed by the ac3 decoder
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: ac3_internal.h,v 1.2 2002/04/23 23:44:36 fenrir Exp $
+ * $Id: ac3_internal.h,v 1.3 2002/07/31 20:56:50 sam Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
*
int exponent_unpack (ac3dec_t *);
/* ac3_imdct.c */
-void _M( imdct_init )(imdct_t * p_imdct);
+void E_( imdct_init )(imdct_t * p_imdct);
void imdct (ac3dec_t * p_ac3dec, s16 * buffer);
/* ac3_mantissa.c */
* ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: ac3_spdif.c,v 1.31 2002/07/23 00:39:16 sam Exp $
+ * $Id: ac3_spdif.c,v 1.32 2002/07/31 20:56:50 sam Exp $
*
* Authors: Stéphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi>
#include "ac3_spdif.h"
/****************************************************************************
- * Local Prototypes
+ * Local prototypes
****************************************************************************/
-static int decoder_Probe ( vlc_fourcc_t * );
-static int decoder_Run ( decoder_fifo_t * );
+static int OpenDecoder ( vlc_object_t * );
+static int RunDecoder ( decoder_fifo_t * );
+
static int InitThread ( ac3_spdif_thread_t * );
static void EndThread ( ac3_spdif_thread_t * );
static void BitstreamCallback ( bit_stream_t *, vlc_bool_t );
};
/*****************************************************************************
- * Capabilities
+ * Module descriptor
*****************************************************************************/
-void _M( adec_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.dec.pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
-}
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("SPDIF pass-through AC3 decoder") )
- ADD_CAPABILITY( DECODER, 0 )
- ADD_SHORTCUT( "pass_through" )
- ADD_SHORTCUT( "pass" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( adec_getfunctions )( &p_module->p_functions->dec );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("SPDIF pass-through AC3 decoder") );
+ set_capability( "decoder", 0 );
+ set_callbacks( OpenDecoder, NULL );
+ add_shortcut( "pass_through" );
+ add_shortcut( "pass" );
+vlc_module_end();
/*****************************************************************************
- * decoder_Probe: probe the decoder and return score
+ * OpenDecoder: probe the decoder and return score
*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
-static int decoder_Probe( vlc_fourcc_t *pi_type )
-{
- return( *pi_type == VLC_FOURCC('a','5','2',' ') ) ? 0 : -1;
-}
+static int OpenDecoder( vlc_object_t *p_this )
+{
+ decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
+ if( p_fifo->i_fourcc != VLC_FOURCC('a','5','2',' ') )
+ {
+ return VLC_EGENERIC;
+ }
+
+ p_fifo->pf_run = RunDecoder;
+ return VLC_SUCCESS;
+}
/****************************************************************************
- * decoder_Run: the whole thing
+ * RunDecoder: the whole thing
****************************************************************************
* This function is called just after the thread is launched.
****************************************************************************/
-static int decoder_Run( decoder_fifo_t * p_fifo )
+static int RunDecoder( decoder_fifo_t *p_fifo )
{
ac3_spdif_thread_t * p_spdif;
mtime_t i_frame_time;
* file.c: file input (file: access plug-in)
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: file.c,v 1.7 2002/06/01 12:31:58 sam Exp $
+ * $Id: file.c,v 1.8 2002/07/31 20:56:50 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
#endif
/*****************************************************************************
- * Local prototypes
+ * Open: open the file
*****************************************************************************/
-static void input_getfunctions( function_list_t * );
-static int FileOpen ( input_thread_t * );
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("Standard filesystem file reading") )
- ADD_CAPABILITY( ACCESS, 50 )
- ADD_SHORTCUT( "stream" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- input_getfunctions( &p_module->p_functions->access );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void input_getfunctions( function_list_t * p_function_list )
-{
-#define input p_function_list->functions.access
- input.pf_open = FileOpen;
- input.pf_read = input_FDRead;
- input.pf_close = input_FDClose;
- input.pf_set_program = input_SetProgram;
- input.pf_set_area = NULL;
- input.pf_seek = input_FDSeek;
-#undef input
-}
-
-/*****************************************************************************
- * FileOpen: open the file
- *****************************************************************************/
-static int FileOpen( input_thread_t * p_input )
+static int Open( vlc_object_t *p_this )
{
+ input_thread_t * p_input = (input_thread_t *)p_this;
char * psz_name = p_input->psz_name;
int i_stat;
struct stat stat_info;
return( -1 );
}
+ p_input->pf_read = input_FDRead;
+ p_input->pf_set_program = input_SetProgram;
+ p_input->pf_set_area = NULL;
+ p_input->pf_seek = input_FDSeek;
+
vlc_mutex_lock( &p_input->stream.stream_lock );
if( *p_input->psz_access && !strncmp( p_input->psz_access, "stream", 7 ) )
return( 0 );
}
+
+/*****************************************************************************
+ * Module descriptor
+ *****************************************************************************/
+vlc_module_begin();
+ set_description( _("Standard filesystem file reading") );
+ set_capability( "access", 50 );
+ add_shortcut( "stream" );
+ set_callbacks( Open, __input_FDClose );
+vlc_module_end();
+
* http.c: HTTP access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: http.c,v 1.18 2002/07/25 21:53:53 sigmunau Exp $
+ * $Id: http.c,v 1.19 2002/07/31 20:56:50 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static void input_getfunctions( function_list_t * );
-static int HTTPOpen ( input_thread_t * );
-static void HTTPClose ( input_thread_t * );
-static int HTTPSetProgram ( input_thread_t *, pgrm_descriptor_t * );
-static void HTTPSeek ( input_thread_t *, off_t );
+static int Open ( vlc_object_t * );
+static void Close ( vlc_object_t * );
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("HTTP access plug-in") )
- ADD_CAPABILITY( ACCESS, 0 )
- ADD_SHORTCUT( "http4" )
- ADD_SHORTCUT( "http6" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- input_getfunctions( &p_module->p_functions->access );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+static int SetProgram ( input_thread_t *, pgrm_descriptor_t * );
+static void Seek ( input_thread_t *, off_t );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Module descriptor
*****************************************************************************/
-static void input_getfunctions( function_list_t * p_function_list )
-{
-#define input p_function_list->functions.access
- input.pf_open = HTTPOpen;
- input.pf_read = input_FDNetworkRead;
- input.pf_close = HTTPClose;
- input.pf_set_program = HTTPSetProgram;
- input.pf_set_area = NULL;
- input.pf_seek = HTTPSeek;
-#undef input
-}
+vlc_module_begin();
+ set_description( _("HTTP access module") );
+ set_capability( "access", 0 );
+ add_shortcut( "http4" );
+ add_shortcut( "http6" );
+ set_callbacks( Open, Close );
+vlc_module_end();
/*****************************************************************************
* _input_socket_t: private access plug-in data, modified to add private
char * psz_return_alpha;
/* Find an appropriate network module */
- p_network = module_Need( p_input, MODULE_CAPABILITY_NETWORK,
- p_access_data->psz_network,
- &p_access_data->socket_desc );
+ p_input->p_private = (void*) &p_access_data->socket_desc;
+ p_network = module_Need( p_input, "network", p_access_data->psz_network );
if( p_network == NULL )
{
return( -1 );
}
- module_Unneed( p_network );
+ module_Unneed( p_input, p_network );
p_access_data->_socket.i_handle = p_access_data->socket_desc.i_handle;
/* Prepare the input thread for reading. */
p_input->i_bufsize = INPUT_DEFAULT_BUFSIZE;
- /* FIXME: we shouldn't have to do that ! */
+
+ /* FIXME: we shouldn't have to do that ! It's UGLY but mandatory because
+ * input_FillBuffer assumes p_input->pf_read exists */
p_input->pf_read = input_FDNetworkRead;
while( !input_FillBuffer( p_input ) )
}
/*****************************************************************************
- * HTTPOpen: parse URL and open the remote file at the beginning
+ * Open: parse URL and open the remote file at the beginning
*****************************************************************************/
-static int HTTPOpen( input_thread_t * p_input )
+static int Open( vlc_object_t *p_this )
{
+ input_thread_t * p_input = (input_thread_t *)p_this;
_input_socket_t * p_access_data;
char * psz_name = strdup(p_input->psz_name);
char * psz_parser = psz_name;
msg_Dbg( p_input, "opening server=%s port=%d path=%s",
psz_server_addr, i_server_port, psz_path );
+ p_input->pf_read = input_FDNetworkRead;
+ p_input->pf_set_program = SetProgram;
+ p_input->pf_set_area = NULL;
+ p_input->pf_seek = Seek;
+
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.b_pace_control = 1;
p_input->stream.b_seekable = 1;
}
/*****************************************************************************
- * HTTPClose: free unused data structures
+ * Close: free unused data structures
*****************************************************************************/
-static void HTTPClose( input_thread_t * p_input )
+static void Close( vlc_object_t *p_this )
{
+ input_thread_t * p_input = (input_thread_t *)p_this;
_input_socket_t * p_access_data =
(_input_socket_t *)p_input->p_access_data;
}
/*****************************************************************************
- * HTTPSetProgram: do nothing
+ * SetProgram: do nothing
*****************************************************************************/
-static int HTTPSetProgram( input_thread_t * p_input,
- pgrm_descriptor_t * p_program )
+static int SetProgram( input_thread_t * p_input,
+ pgrm_descriptor_t * p_program )
{
return( 0 );
}
/*****************************************************************************
- * HTTPSeek: close and re-open a connection at the right place
+ * Seek: close and re-open a connection at the right place
*****************************************************************************/
-static void HTTPSeek( input_thread_t * p_input, off_t i_pos )
+static void Seek( input_thread_t * p_input, off_t i_pos )
{
_input_socket_t * p_access_data = p_input->p_access_data;
close( p_access_data->_socket.i_handle );
* udp.c: raw UDP access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: udp.c,v 1.11 2002/06/01 12:31:58 sam Exp $
+ * $Id: udp.c,v 1.12 2002/07/31 20:56:50 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static void input_getfunctions( function_list_t * );
-static int UDPOpen ( input_thread_t * );
+static int Open ( vlc_object_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("Raw UDP access plug-in") )
- ADD_CAPABILITY( ACCESS, 0 )
- ADD_SHORTCUT( "udpstream" )
- ADD_SHORTCUT( "udp4" )
- ADD_SHORTCUT( "udp6" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- input_getfunctions( &p_module->p_functions->access );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("raw UDP access module") );
+ set_capability( "access", 0 );
+ add_shortcut( "udpstream" );
+ add_shortcut( "udp4" );
+ add_shortcut( "udp6" );
+ set_callbacks( Open, __input_FDNetworkClose );
+vlc_module_end();
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Open: open the socket
*****************************************************************************/
-static void input_getfunctions( function_list_t * p_function_list )
-{
-#define input p_function_list->functions.access
- input.pf_open = UDPOpen;
- input.pf_read = input_FDNetworkRead;
- input.pf_close = input_FDNetworkClose;
- input.pf_set_program = input_SetProgram;
- input.pf_set_area = NULL;
- input.pf_seek = NULL;
-#undef input
-}
-
-/*****************************************************************************
- * UDPOpen: open the socket
- *****************************************************************************/
-static int UDPOpen( input_thread_t * p_input )
+static int Open( vlc_object_t *p_this )
{
+ input_thread_t * p_input = (input_thread_t *)p_this;
input_socket_t * p_access_data;
module_t * p_network;
char * psz_network = "";
}
}
+ p_input->pf_read = input_FDNetworkRead;
+ p_input->pf_set_program = input_SetProgram;
+ p_input->pf_set_area = NULL;
+ p_input->pf_seek = NULL;
+
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.b_pace_control = 0;
p_input->stream.b_seekable = 0;
socket_desc.i_server_port = i_server_port;
/* Find an appropriate network module */
- p_network = module_Need( p_input, MODULE_CAPABILITY_NETWORK,
- psz_network, &socket_desc );
+ p_input->p_private = (void*) &socket_desc;
+ p_network = module_Need( p_input, "network", psz_network );
free(psz_name);
if( p_network == NULL )
{
return( -1 );
}
- module_Unneed( p_network );
+ module_Unneed( p_input, p_network );
p_access_data = p_input->p_access_data = malloc( sizeof(input_socket_t) );
if( p_access_data == NULL )
* alsa.c : alsa plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: alsa.c,v 1.20 2002/07/20 18:01:42 sam Exp $
+ * $Id: alsa.c,v 1.21 2002/07/31 20:56:50 sam Exp $
*
* Authors: Henri Fallon <henri@videolan.org> - Original Author
* Jeffrey Baker <jwbaker@acm.org> - Port to ALSA 1.0 API
#include <alsa/asoundlib.h>
/*****************************************************************************
- * Capabilities defined in the other files.
+ * Local prototypes
*****************************************************************************/
-static void aout_getfunctions( function_list_t * p_function_list );
-static int aout_Open ( aout_thread_t * );
-static int aout_SetFormat ( aout_thread_t * );
-static void aout_HandleXrun ( aout_thread_t *);
-static int aout_GetBufInfo ( aout_thread_t *, int i_buffer_limit );
-static void aout_Play ( aout_thread_t *, byte_t *buffer, int i_size );
-static void aout_Close ( aout_thread_t * );
+static int Open ( vlc_object_t * );
+static void Close ( vlc_object_t * );
+
+static int SetFormat ( aout_thread_t * );
+static int GetBufInfo ( aout_thread_t *, int );
+static void Play ( aout_thread_t *, byte_t *, int );
+
+static void HandleXrun ( aout_thread_t *);
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
- ADD_CATEGORY_HINT( N_("Device"), NULL )
- ADD_STRING( "alsa-device", NULL, NULL, N_("Name"), NULL )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("ALSA audio module") )
- ADD_CAPABILITY( AOUT, 50 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- aout_getfunctions( &p_module->p_functions->aout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( N_("Device"), NULL );
+ add_string( "alsa-device", NULL, NULL, N_("Name"), NULL );
+ set_description( _("ALSA audio module") );
+ set_capability( "audio output", 50 );
+ set_callbacks( Open, Close );
+vlc_module_end();
/*****************************************************************************
* Preamble
};
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void aout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.aout.pf_open = aout_Open;
- p_function_list->functions.aout.pf_setformat = aout_SetFormat;
- p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
- p_function_list->functions.aout.pf_play = aout_Play;
- p_function_list->functions.aout.pf_close = aout_Close;
-}
-
-/*****************************************************************************
- * aout_Open : creates a handle and opens an alsa device
+ * Open: create a handle and open an alsa device
*****************************************************************************
* This function opens an alsa device, through the alsa API
*****************************************************************************/
-static int aout_Open( aout_thread_t *p_aout )
+static int Open( vlc_object_t *p_this )
{
+ aout_thread_t *p_aout = (aout_thread_t *)p_this;
+
/* Allows user to choose which ALSA device to use */
char psz_alsadev[128];
char *psz_device, *psz_userdev;
return -1;
}
+ p_aout->pf_setformat = SetFormat;
+ p_aout->pf_getbufinfo = GetBufInfo;
+ p_aout->pf_play = Play;
+
/* Read in ALSA device preferences from configuration */
psz_userdev = config_GetPsz( p_aout, "alsa-device" );
}
/*****************************************************************************
- * aout_SetFormat : sets the alsa output format
+ * SetFormat : sets the alsa output format
*****************************************************************************
* This function prepares the device, sets the rate, format, the mode
* ( "play as soon as you have data" ), and buffer information.
*****************************************************************************/
-static int aout_SetFormat( aout_thread_t *p_aout )
+static int SetFormat( aout_thread_t *p_aout )
{
int i_rv;
int i_format;
}
/*****************************************************************************
- * aout_HandleXrun : reprepare the output
+ * HandleXrun : reprepare the output
*****************************************************************************
* When buffer gets empty, the driver goes in "Xrun" state, where it needs
* to be reprepared before playing again
*****************************************************************************/
-static void aout_HandleXrun(aout_thread_t *p_aout)
+static void HandleXrun(aout_thread_t *p_aout)
{
int i_rv;
/*****************************************************************************
- * aout_BufInfo: buffer status query
+ * BufInfo: buffer status query
*****************************************************************************
* This function returns the number of used byte in the queue.
* It also deals with errors : indeed if the device comes to run out
* of data to play, it switches to the "underrun" status. It has to
* be flushed and re-prepared
*****************************************************************************/
-static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
+static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
{
snd_pcm_status_t *p_status;
int i_alsa_get_status_returns;
switch( snd_pcm_status_get_state( p_status ) )
{
case SND_PCM_STATE_XRUN :
- aout_HandleXrun( p_aout );
+ HandleXrun( p_aout );
break;
case SND_PCM_STATE_OPEN:
}
/*****************************************************************************
- * aout_Play : plays a sample
+ * Play : plays a sample
*****************************************************************************
* Plays a sample using the snd_pcm_writei function from the alsa API
*****************************************************************************/
-static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
snd_pcm_uframes_t tot_frames;
snd_pcm_uframes_t frames_left;
}
/*****************************************************************************
- * aout_Close : close the Alsa device
+ * Close: close the Alsa device
*****************************************************************************/
-static void aout_Close( aout_thread_t *p_aout )
+static void Close( vlc_object_t *p_this )
{
+ aout_thread_t *p_aout = (aout_thread_t *)p_this;
int i_close_returns;
i_close_returns = snd_pcm_close( p_aout->p_sys->p_alsa_handle );
};
/*****************************************************************************
- * Local prototypes.
+ * Local prototypes
*****************************************************************************/
-static void aout_getfunctions ( function_list_t * );
-static int aout_Open ( aout_thread_t * );
-static int aout_SetFormat ( aout_thread_t * );
-static int aout_GetBufInfo ( aout_thread_t *, int );
-static void aout_Play ( aout_thread_t *, byte_t *, int );
-static void aout_Close ( aout_thread_t * );
+static int Open ( vlc_object_t * );
+static void Close ( vlc_object_t * );
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("aRts audio module") )
- ADD_CAPABILITY( AOUT, 50 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- aout_getfunctions( &p_module->p_functions->aout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+static int SetFormat ( aout_thread_t * );
+static int GetBufInfo ( aout_thread_t *, int );
+static void Play ( aout_thread_t *, byte_t *, int );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Module descriptor
*****************************************************************************/
-static void aout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.aout.pf_open = aout_Open;
- p_function_list->functions.aout.pf_setformat = aout_SetFormat;
- p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
- p_function_list->functions.aout.pf_play = aout_Play;
- p_function_list->functions.aout.pf_close = aout_Close;
-}
+vlc_module_begin();
+ set_description( _("aRts audio module") );
+ set_capability( "audio output", 50 );
+ set_callbacks( Open, Close );
+vlc_module_end();
/*****************************************************************************
- * aout_Open: initialize arts connection to server
+ * Open: initialize arts connection to server
*****************************************************************************/
-static int aout_Open( aout_thread_t *p_aout )
+static int Open( vlc_object_t *p_this )
{
+ aout_thread_t *p_aout = (aout_thread_t *)p_this;
int i_err = 0;
/* Allocate structure */
return(-1);
}
+ p_aout->pf_setformat = SetFormat;
+ p_aout->pf_getbufinfo = GetBufInfo;
+ p_aout->pf_play = Play;
+
p_aout->p_sys->stream =
arts_play_stream( p_aout->i_rate, 16, p_aout->i_channels, "vlc" );
}
/*****************************************************************************
- * aout_SetFormat: set the output format
+ * SetFormat: set the output format
*****************************************************************************/
-static int aout_SetFormat( aout_thread_t *p_aout )
+static int SetFormat( aout_thread_t *p_aout )
{
/*Not ready*/
/* p_aout->i_latency = esd_get_latency(i_fd);*/
}
/*****************************************************************************
- * aout_GetBufInfo: buffer status query
+ * GetBufInfo: buffer status query
*****************************************************************************/
-static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
+static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
{
/* arbitrary value that should be changed */
return( i_buffer_limit );
}
/*****************************************************************************
- * aout_Play: play a sound samples buffer
+ * Play: play a sound samples buffer
*****************************************************************************
* This function writes a buffer of i_length bytes in the socket
*****************************************************************************/
-static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
int i_err = arts_write( p_aout->p_sys->stream, buffer, i_size );
}
/*****************************************************************************
- * aout_Close: close the Esound socket
+ * Close: close the Esound socket
*****************************************************************************/
-static void aout_Close( aout_thread_t *p_aout )
+static void Close( vlc_object_t *p_this )
{
+ aout_thread_t *p_aout = (aout_thread_t *)p_this;
+
arts_close_stream( p_aout->p_sys->stream );
free( p_aout->p_sys );
}
* avi.c : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: avi.c,v 1.32 2002/07/23 00:39:16 sam Exp $
+ * $Id: avi.c,v 1.33 2002/07/31 20:56:50 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static void input_getfunctions( function_list_t * );
-static int AVIDemux ( input_thread_t * );
-static int AVIInit ( input_thread_t * );
-static void AVIEnd ( input_thread_t * );
+static int AVIInit ( vlc_object_t * );
+static void __AVIEnd ( vlc_object_t * );
+static int AVIDemux ( input_thread_t * );
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( "RIFF-AVI Stream input" )
- ADD_CAPABILITY( DEMUX, 150 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- input_getfunctions( &p_module->p_functions->demux );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+#define AVIEnd(a) __AVIEnd(VLC_OBJECT(a))
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Module descriptor
*****************************************************************************/
-static void input_getfunctions( function_list_t * p_function_list )
-{
-#define input p_function_list->functions.demux
- input.pf_init = AVIInit;
- input.pf_end = AVIEnd;
- input.pf_demux = AVIDemux;
- input.pf_rewind = NULL;
-#undef input
-}
-
+vlc_module_begin();
+ set_description( "RIFF-AVI demuxer" );
+ set_capability( "demux", 150 );
+ set_callbacks( AVIInit, __AVIEnd );
+vlc_module_end();
/*****************************************************************************
* Some usefull functions to manipulate memory
/*****************************************************************************
* AVIEnd: frees unused data
*****************************************************************************/
-static void AVIEnd( input_thread_t *p_input )
+static void __AVIEnd ( vlc_object_t * p_this )
{
+ input_thread_t * p_input = (input_thread_t *)p_this;
int i;
demux_data_avi_file_t *p_avi_demux;
p_avi_demux = (demux_data_avi_file_t*)p_input->p_demux_data ;
/*****************************************************************************
* AVIInit: check file and initializes AVI structures
*****************************************************************************/
-static int AVIInit( input_thread_t *p_input )
-{
+static int AVIInit( vlc_object_t * p_this )
+{
+ input_thread_t * p_input = (input_thread_t *)p_this;
riffchunk_t *p_riff,*p_hdrl,*p_movi;
riffchunk_t *p_avih;
riffchunk_t *p_strl,*p_strh,*p_strf;
es_descriptor_t *p_es = NULL; /* for not warning */
int i;
+ p_input->pf_demux = AVIDemux;
+
if( !( p_input->p_demux_data =
p_avi_demux = malloc( sizeof(demux_data_avi_file_t) ) ) )
{
AVIStreamInfo_t *p_info )
{
pes_packet_t *p_pes;
- int i_length;
+ int i_length, i_ret;
i_length = __MIN( p_info->p_index[p_info->i_idxposc].i_length
- p_info->i_idxposb,
(off_t)p_info->p_index[p_info->i_idxposc].i_pos +
p_info->i_idxposb + 8);
- if( __AVI_GetDataInPES( p_input,
- &p_pes,
- i_length ,
- 0) != i_length )
+ i_ret = __AVI_GetDataInPES( p_input, &p_pes, i_length , 0);
+
+ if( i_ret != i_length )
{
return( 0 );
}
{
return( NULL );
}
+fprintf(stderr, "blah ibyte %i\n", i_byte);
if( !( p_data = input_NewPacket( p_input->p_method_data, i_byte ) ) )
{
input_DeletePES( p_input->p_method_data, p_pes );
* aout_beos.cpp: BeOS audio output
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: aout_beos.cpp,v 1.25 2002/07/20 18:01:42 sam Exp $
+ * $Id: aout_beos.cpp,v 1.26 2002/07/31 20:56:50 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#include <malloc.h>
#include <string.h>
-extern "C"
-{
#include <vlc/vlc.h>
#include <vlc/aout.h>
-}
/*****************************************************************************
* aout_sys_t: BeOS audio output method descriptor
int i_buffer_pos;
};
-extern "C"
-{
-
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int aout_Open ( aout_thread_t *p_aout );
-static int aout_SetFormat ( aout_thread_t *p_aout );
-static int aout_GetBufInfo ( aout_thread_t *p_aout, int i_buffer_info );
-static void aout_Play ( aout_thread_t *p_aout,
- byte_t *buffer, int i_size );
-static void aout_Close ( aout_thread_t *p_aout );
+static int SetFormat ( aout_thread_t * );
+static int GetBufInfo ( aout_thread_t *, int );
+static void Play ( aout_thread_t *, byte_t *, int );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * OpenAudio: opens a BPushGameSound
*****************************************************************************/
-void _M( aout_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.aout.pf_open = aout_Open;
- p_function_list->functions.aout.pf_setformat = aout_SetFormat;
- p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
- p_function_list->functions.aout.pf_play = aout_Play;
- p_function_list->functions.aout.pf_close = aout_Close;
-}
+int E_(OpenAudio) ( vlc_object_t *p_this )
+{
+ aout_thread_t * p_aout = (aout_thread_t *)p_this;
-/*****************************************************************************
- * aout_Open: opens a BPushGameSound
- *****************************************************************************/
-static int aout_Open( aout_thread_t *p_aout )
-{
/* Allocate structure */
p_aout->p_sys = (aout_sys_t*) malloc( sizeof( aout_sys_t ) );
if( p_aout->p_sys == NULL )
p_aout->p_sys->p_format->buffer_size = 4*8192;
p_aout->p_sys->i_buffer_pos = 0;
+ p_aout->pf_setformat = SetFormat;
+ p_aout->pf_getbufinfo = GetBufInfo;
+ p_aout->pf_play = Play;
+
/* Allocate BPushGameSound */
p_aout->p_sys->p_sound = new BPushGameSound( 8192,
p_aout->p_sys->p_format,
}
/*****************************************************************************
- * aout_SetFormat: sets the dsp output format
+ * SetFormat: sets the dsp output format
*****************************************************************************/
-static int aout_SetFormat( aout_thread_t *p_aout )
+static int SetFormat( aout_thread_t *p_aout )
{
return( 0 );
}
/*****************************************************************************
- * aout_GetBufInfo: buffer status query
+ * GetBufInfo: buffer status query
*****************************************************************************/
-static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
+static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
{
/* Each value is 4 bytes long (stereo signed 16 bits) */
int i_hard_pos = 4 * p_aout->p_sys->p_sound->CurrentPosition();
}
/*****************************************************************************
- * aout_Play: plays a sound samples buffer
+ * Play: plays a sound samples buffer
*****************************************************************************
* This function writes a buffer of i_length bytes in the dsp
*****************************************************************************/
-static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
int i_newbuf_pos;
}
/*****************************************************************************
- * aout_Close: closes the dsp audio device
+ * CloseAudio: closes the dsp audio device
*****************************************************************************/
-static void aout_Close( aout_thread_t *p_aout )
-{
+void E_(CloseAudio) ( vlc_object_t *p_this )
+{
+ aout_thread_t * p_aout = (aout_thread_t *)p_this;
+
p_aout->p_sys->p_sound->UnlockCyclic();
p_aout->p_sys->p_sound->StopPlaying( );
delete p_aout->p_sys->p_sound;
free( p_aout->p_sys );
}
-} /* extern "C" */
-
* beos.cpp : BeOS plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: beos.cpp,v 1.19 2002/06/01 12:31:58 sam Exp $
+ * $Id: beos.cpp,v 1.20 2002/07/31 20:56:50 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#include <vlc/vlc.h>
-extern "C"
-{
/*****************************************************************************
- * Capabilities defined in the other files.
+ * External prototypes
*****************************************************************************/
-void _M( aout_getfunctions )( function_list_t * p_function_list );
-void _M( vout_getfunctions )( function_list_t * p_function_list );
-void _M( intf_getfunctions )( function_list_t * p_function_list );
+int E_(OpenIntf) ( vlc_object_t * );
+void E_(CloseIntf) ( vlc_object_t * );
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("BeOS standard API module") )
- ADD_CAPABILITY( INTF, 100 )
- ADD_CAPABILITY( VOUT, 100 )
- ADD_CAPABILITY( AOUT, 100 )
-MODULE_INIT_STOP
+int E_(OpenAudio) ( vlc_object_t * );
+void E_(CloseAudio) ( vlc_object_t * );
-MODULE_ACTIVATE_START
- _M( aout_getfunctions )( &p_module->p_functions->aout );
- _M( vout_getfunctions )( &p_module->p_functions->vout );
- _M( intf_getfunctions )( &p_module->p_functions->intf );
-MODULE_ACTIVATE_STOP
+int E_(OpenVideo) ( vlc_object_t * );
+void E_(CloseVideo) ( vlc_object_t * );
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+/*****************************************************************************
+ * Module descriptor
+ *****************************************************************************/
+vlc_module_begin();
+ set_description( _("BeOS standard API module") );
+ add_submodule();
+ set_capability( "interface", 100 );
+ set_callbacks( E_(OpenIntf), E_(CloseIntf) );
+ add_submodule();
+ set_capability( "video output", 100 );
+ set_callbacks( E_(OpenVideo), E_(CloseVideo) );
+ add_submodule();
+ set_capability( "audio output", 100 );
+ set_callbacks( E_(OpenAudio), E_(CloseAudio) );
+vlc_module_end();
-} /* extern "C" */
* intf_beos.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: intf_beos.cpp,v 1.43 2002/07/23 12:42:17 tcastley Exp $
+ * $Id: intf_beos.cpp,v 1.44 2002/07/31 20:56:50 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#include "intf_vlc_wrapper.h"
#include "InterfaceWindow.h"
-extern "C"
-{
-
-/*****************************************************************************
- * Local prototypes.
- *****************************************************************************/
-static int intf_Open ( intf_thread_t *p_intf );
-static void intf_Close ( intf_thread_t *p_intf );
-static void intf_Run ( intf_thread_t *p_intf );
-
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Local prototype
*****************************************************************************/
-void _M( intf_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.intf.pf_open = intf_Open;
- p_function_list->functions.intf.pf_close = intf_Close;
- p_function_list->functions.intf.pf_run = intf_Run;
-}
+static void Run ( intf_thread_t *p_intf );
/*****************************************************************************
- * intf_Open: initialize interface
+ * OpenIntf: initialize interface
*****************************************************************************/
-static int intf_Open( intf_thread_t *p_intf )
-{
+int E_(OpenIntf) ( vlc_object_t *p_this )
+{
+ intf_thread_t *p_intf = (intf_thread_t*) p_this;
BScreen *screen;
screen = new BScreen();
BRect rect = screen->Frame();
// p_intf->p_sys->p_sub = msg_Subscribe( p_intf );
p_intf->p_sys->p_input = NULL;
+ p_intf->pf_run = Run;
/* Create the interface window */
p_intf->p_sys->p_window =
}
/*****************************************************************************
- * intf_Close: destroy dummy interface
+ * CloseIntf: destroy interface
*****************************************************************************/
-static void intf_Close( intf_thread_t *p_intf )
+void E_(CloseIntf) ( vlc_object_t *p_this )
{
+ intf_thread_t *p_intf = (intf_thread_t*) p_this;
+
if( p_intf->p_sys->p_input )
{
vlc_object_release( p_intf->p_sys->p_input );
/*****************************************************************************
- * intf_Run: event loop
+ * Run: event loop
*****************************************************************************/
-static void intf_Run( intf_thread_t *p_intf )
+static void Run( intf_thread_t *p_intf )
{
while( !p_intf->b_die )
{
}
-} /* extern "C" */
-
* vout_beos.cpp: beos video output display method
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: vout_beos.cpp,v 1.64 2002/07/28 01:46:26 tcastley Exp $
+ * $Id: vout_beos.cpp,v 1.65 2002/07/31 20:56:50 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
FillRect(updateRect);
}
-
-extern "C"
-{
-
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int vout_Create ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static int vout_Manage ( vout_thread_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static int Manage ( vout_thread_t * );
+static void Display ( vout_thread_t *, picture_t * );
static int BeosOpenDisplay ( vout_thread_t *p_vout );
static void BeosCloseDisplay( vout_thread_t *p_vout );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( vout_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_display = vout_Display;
- p_function_list->functions.vout.pf_render = vout_Render;
-}
-
-/*****************************************************************************
- * vout_Create: allocates BeOS video thread output method
+ * OpenVideo: allocates BeOS video thread output method
*****************************************************************************
* This function allocates and initializes a BeOS vout method.
*****************************************************************************/
-int vout_Create( vout_thread_t *p_vout )
+int E_(OpenVideo) ( vlc_object_t *p_this )
{
+ vout_thread_t * p_vout = (vout_thread_t *)p_this;
+
/* Allocate structure */
p_vout->p_sys = (vout_sys_t*) malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
p_vout->p_sys->i_height = p_vout->render.i_height;
p_vout->p_sys->source_chroma = p_vout->render.i_chroma;
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = NULL;
+ p_vout->pf_render = NULL;
+ p_vout->pf_display = Display;
+
return( 0 );
}
/*****************************************************************************
- * vout_Init: initialize BeOS video thread output method
+ * Init: initialize BeOS video thread output method
*****************************************************************************/
-int vout_Init( vout_thread_t *p_vout )
+int Init( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic;
}
/*****************************************************************************
- * vout_End: terminate BeOS video thread output method
+ * End: terminate BeOS video thread output method
*****************************************************************************/
-void vout_End( vout_thread_t *p_vout )
+void End( vout_thread_t *p_vout )
{
BeosCloseDisplay( p_vout );
}
/*****************************************************************************
- * vout_Destroy: destroy BeOS video thread output method
+ * CloseVideo: destroy BeOS video thread output method
*****************************************************************************
* Terminate an output method created by DummyCreateOutputMethod
*****************************************************************************/
-void vout_Destroy( vout_thread_t *p_vout )
+void E_(CloseVideo) ( vlc_object_t *p_this )
{
- free( p_vout->p_sys );
-}
+ vout_thread_t * p_vout = (vout_thread_t *)p_this;
-/*****************************************************************************
- * vout_Manage: handle BeOS events
- *****************************************************************************
- * This function should be called regularly by video output thread. It manages
- * console events. It returns a non null value on error.
- *****************************************************************************/
-int vout_Manage( vout_thread_t *p_vout )
-{
-
- return( 0 );
-}
-
-/*****************************************************************************
- * vout_Render: render previously calculated output
- *****************************************************************************/
-void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
+ free( p_vout->p_sys );
}
/*****************************************************************************
- * vout_Display: displays previously rendered output
+ * Display: displays previously rendered output
*****************************************************************************
* This function send the currently rendered image to BeOS image, waits until
* it is displayed and switch the two rendering buffers, preparing next frame.
*****************************************************************************/
-void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+void Display( vout_thread_t *p_vout, picture_t *p_pic )
{
VideoWindow * p_win = p_vout->p_sys->p_window;
p_win = NULL;
}
-
-
-} /* extern "C" */
* i420_rgb.c : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: i420_rgb.c,v 1.10 2002/07/23 00:39:16 sam Exp $
+ * $Id: i420_rgb.c,v 1.11 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local and extern prototypes.
*****************************************************************************/
-static void chroma_getfunctions ( function_list_t * p_function_list );
-
-static int chroma_Init ( vout_thread_t * );
-static void chroma_End ( vout_thread_t * );
+static int Activate ( vlc_object_t * );
+static void Deactivate ( vlc_object_t * );
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
static void SetGammaTable ( int *pi_table, double f_gamma );
#endif
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor.
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
+vlc_module_begin();
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
- SET_DESCRIPTION( _("I420,IYUV,YV12 to "
- "RGB,RV15,RV16,RV24,RV32 conversions") )
- ADD_CAPABILITY( CHROMA, 80 )
+ set_description( _("I420,IYUV,YV12 to "
+ "RGB,RV15,RV16,RV24,RV32 conversions") );
+ set_capability( "chroma", 80 );
#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
- SET_DESCRIPTION( _( "MMX I420,IYUV,YV12 to "
- "RV15,RV16,RV24,RV32 conversions") )
- ADD_CAPABILITY( CHROMA, 100 )
- ADD_REQUIREMENT( MMX )
+ set_description( _( "MMX I420,IYUV,YV12 to "
+ "RV15,RV16,RV24,RV32 conversions") );
+ set_capability( "chroma", 100 );
+ add_requirement( MMX );
#endif
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- chroma_getfunctions( &p_module->p_functions->chroma );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void chroma_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.chroma.pf_init = chroma_Init;
- p_function_list->functions.chroma.pf_end = chroma_End;
-}
+ set_callbacks( Activate, Deactivate );
+vlc_module_end();
/*****************************************************************************
- * chroma_Init: allocate a chroma function
+ * Activate: allocate a chroma function
*****************************************************************************
* This function allocates and initializes a chroma function
*****************************************************************************/
-static int chroma_Init( vout_thread_t *p_vout )
+static int Activate( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
size_t i_tables_size;
#endif
{
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
case VLC_FOURCC('R','G','B','2'):
- p_vout->chroma.pf_convert = _M( I420_RGB8 );
+ p_vout->chroma.pf_convert = E_(I420_RGB8);
break;
#endif
case VLC_FOURCC('R','V','1','5'):
- p_vout->chroma.pf_convert = _M( I420_RGB15 );
+ p_vout->chroma.pf_convert = E_(I420_RGB15);
break;
case VLC_FOURCC('R','V','1','6'):
- p_vout->chroma.pf_convert = _M( I420_RGB16 );
+ p_vout->chroma.pf_convert = E_(I420_RGB16);
break;
case VLC_FOURCC('R','V','2','4'):
case VLC_FOURCC('R','V','3','2'):
- p_vout->chroma.pf_convert = _M( I420_RGB32 );
+ p_vout->chroma.pf_convert = E_(I420_RGB32);
break;
default:
}
/*****************************************************************************
- * chroma_End: free the chroma function
+ * Deactivate: free the chroma function
*****************************************************************************
* This function frees the previously allocated chroma function
*****************************************************************************/
-static void chroma_End( vout_thread_t *p_vout )
+static void Deactivate( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
#if defined (MODULE_NAME_IS_chroma_i420_rgb)
free( p_vout->chroma.p_sys->p_base );
#endif
* i420_rgb.h : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: i420_rgb.h,v 1.7 2002/07/20 18:01:42 sam Exp $
+ * $Id: i420_rgb.h,v 1.8 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* Prototypes
*****************************************************************************/
#ifdef MODULE_NAME_IS_chroma_i420_rgb
-void _M( I420_RGB8 ) ( vout_thread_t *, picture_t *, picture_t * );
+void E_(I420_RGB8) ( vout_thread_t *, picture_t *, picture_t * );
#endif
-void _M( I420_RGB15 )( vout_thread_t *, picture_t *, picture_t * );
-void _M( I420_RGB16 )( vout_thread_t *, picture_t *, picture_t * );
-void _M( I420_RGB32 )( vout_thread_t *, picture_t *, picture_t * );
+void E_(I420_RGB15)( vout_thread_t *, picture_t *, picture_t * );
+void E_(I420_RGB16)( vout_thread_t *, picture_t *, picture_t * );
+void E_(I420_RGB32)( vout_thread_t *, picture_t *, picture_t * );
/*****************************************************************************
* CONVERT_*_PIXEL: pixel conversion macros
* i420_rgb16.c : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: i420_rgb16.c,v 1.9 2002/07/23 00:39:16 sam Exp $
+ * $Id: i420_rgb16.c,v 1.10 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* - input: 2 lines (2 Y lines, 1 U/V line)
* - output: 1 line
*****************************************************************************/
-void _M( I420_RGB15 )( vout_thread_t *p_vout, picture_t *p_src,
- picture_t *p_dest )
+void E_(I420_RGB15)( vout_thread_t *p_vout, picture_t *p_src,
+ picture_t *p_dest )
{
/* We got this one from the old arguments */
u16 *p_pic = (u16*)p_dest->p->p_pixels;
* - input: 2 lines (2 Y lines, 1 U/V line)
* - output: 1 line
*****************************************************************************/
-void _M( I420_RGB16 )( vout_thread_t *p_vout, picture_t *p_src,
- picture_t *p_dest )
+void E_(I420_RGB16)( vout_thread_t *p_vout, picture_t *p_src,
+ picture_t *p_dest )
{
/* We got this one from the old arguments */
u16 *p_pic = (u16*)p_dest->p->p_pixels;
* - input: 2 lines (2 Y lines, 1 U/V line)
* - output: 1 line
*****************************************************************************/
-void _M( I420_RGB32 )( vout_thread_t *p_vout, picture_t *p_src,
- picture_t *p_dest )
+void E_(I420_RGB32)( vout_thread_t *p_vout, picture_t *p_src,
+ picture_t *p_dest )
{
/* We got this one from the old arguments */
u32 *p_pic = (u32*)p_dest->p->p_pixels;
* i420_rgb8.c : YUV to bitmap RGB conversion module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: i420_rgb8.c,v 1.7 2002/07/23 00:39:16 sam Exp $
+ * $Id: i420_rgb8.c,v 1.8 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* I420_RGB8: color YUV 4:2:0 to RGB 8 bpp
*****************************************************************************/
-void _M( I420_RGB8 )( vout_thread_t *p_vout, picture_t *p_src,
- picture_t *p_dest )
+void E_(I420_RGB8)( vout_thread_t *p_vout, picture_t *p_src, picture_t *p_dest )
{
/* We got this one from the old arguments */
u8 *p_pic = (u8*)p_dest->p->p_pixels;
* i420_ymga.c : YUV to YUV conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: i420_ymga.c,v 1.7 2002/07/23 00:39:16 sam Exp $
+ * $Id: i420_ymga.c,v 1.8 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local and extern prototypes.
*****************************************************************************/
-static void chroma_getfunctions ( function_list_t * p_function_list );
-
-static int chroma_Init ( vout_thread_t *p_vout );
-static void chroma_End ( vout_thread_t *p_vout );
-
-static void I420_YMGA ( vout_thread_t *, picture_t *, picture_t * );
+static int Activate ( vlc_object_t * );
+static void I420_YMGA ( vout_thread_t *, picture_t *, picture_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
+vlc_module_begin();
#if defined (MODULE_NAME_IS_chroma_i420_ymga)
- SET_DESCRIPTION( _("conversions from " SRC_FOURCC " to " DEST_FOURCC) )
- ADD_CAPABILITY( CHROMA, 80 )
+ set_description( _("conversions from " SRC_FOURCC " to " DEST_FOURCC) );
+ set_capability( "chroma", 80 );
#elif defined (MODULE_NAME_IS_chroma_i420_ymga_mmx)
- SET_DESCRIPTION( _("MMX conversions from " SRC_FOURCC " to " DEST_FOURCC) )
- ADD_CAPABILITY( CHROMA, 100 )
- ADD_REQUIREMENT( MMX )
+ set_description( _("MMX conversions from " SRC_FOURCC " to " DEST_FOURCC) );
+ set_capability( "chroma", 100 );
+ add_requirement( MMX );
#endif
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- chroma_getfunctions( &p_module->p_functions->chroma );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+ set_callbacks( Activate, NULL );
+vlc_module_end();
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void chroma_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.chroma.pf_init = chroma_Init;
- p_function_list->functions.chroma.pf_end = chroma_End;
-}
-
-/*****************************************************************************
- * chroma_Init: allocate a chroma function
+ * Activate: allocate a chroma function
*****************************************************************************
* This function allocates and initializes a chroma function
*****************************************************************************/
-static int chroma_Init( vout_thread_t *p_vout )
+static int Activate( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
if( p_vout->render.i_width & 1 || p_vout->render.i_height & 1 )
{
return -1;
return 0;
}
-/*****************************************************************************
- * chroma_End: free the chroma function
- *****************************************************************************
- * This function frees the previously allocated chroma function
- *****************************************************************************/
-static void chroma_End( vout_thread_t *p_vout )
-{
- ;
-}
-
/* Following functions are local */
/*****************************************************************************
* i420_yuy2.c : YUV to YUV conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: i420_yuy2.c,v 1.10 2002/07/23 00:39:16 sam Exp $
+ * $Id: i420_yuy2.c,v 1.11 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local and extern prototypes.
*****************************************************************************/
-static void chroma_getfunctions ( function_list_t * p_function_list );
-
-static int chroma_Init ( vout_thread_t *p_vout );
-static void chroma_End ( vout_thread_t *p_vout );
+static int Activate ( vlc_object_t * );
static void I420_YUY2 ( vout_thread_t *, picture_t *, picture_t * );
static void I420_YVYU ( vout_thread_t *, picture_t *, picture_t * );
#endif
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor.
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
+vlc_module_begin();
#if defined (MODULE_NAME_IS_chroma_i420_yuy2)
- SET_DESCRIPTION( _("conversions from " SRC_FOURCC " to " DEST_FOURCC) )
- ADD_CAPABILITY( CHROMA, 80 )
+ set_description( _("conversions from " SRC_FOURCC " to " DEST_FOURCC) );
+ set_capability( "chroma", 80 );
#elif defined (MODULE_NAME_IS_chroma_i420_yuy2_mmx)
- SET_DESCRIPTION( _("MMX conversions from " SRC_FOURCC " to " DEST_FOURCC) )
- ADD_CAPABILITY( CHROMA, 100 )
- ADD_REQUIREMENT( MMX )
+ set_description( _("MMX conversions from " SRC_FOURCC " to " DEST_FOURCC) );
+ set_capability( "chroma", 100 );
+ add_requirement( MMX );
/* Initialize MMX-specific constants */
i_00ffw = 0x00ff00ff00ff00ff;
i_80w = 0x0000000080808080;
#endif
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- chroma_getfunctions( &p_module->p_functions->chroma );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void chroma_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.chroma.pf_init = chroma_Init;
- p_function_list->functions.chroma.pf_end = chroma_End;
-}
+ set_callbacks( Activate, NULL );
+vlc_module_end();
/*****************************************************************************
- * chroma_Init: allocate a chroma function
+ * Activate: allocate a chroma function
*****************************************************************************
* This function allocates and initializes a chroma function
*****************************************************************************/
-static int chroma_Init( vout_thread_t *p_vout )
+static int Activate( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
if( p_vout->render.i_width & 1 || p_vout->render.i_height & 1 )
{
return -1;
return 0;
}
-/*****************************************************************************
- * chroma_End: free the chroma function
- *****************************************************************************
- * This function frees the previously allocated chroma function
- *****************************************************************************/
-static void chroma_End( vout_thread_t *p_vout )
-{
- ;
-}
-
/* Following functions are local */
/*****************************************************************************
* i422_yuy2.c : YUV to YUV conversion module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: i422_yuy2.c,v 1.7 2002/07/23 00:39:16 sam Exp $
+ * $Id: i422_yuy2.c,v 1.8 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local and extern prototypes.
*****************************************************************************/
-static void chroma_getfunctions ( function_list_t * p_function_list );
-
-static int chroma_Init ( vout_thread_t *p_vout );
-static void chroma_End ( vout_thread_t *p_vout );
+static int Activate ( vlc_object_t * );
static void I422_YUY2 ( vout_thread_t *, picture_t *, picture_t * );
static void I422_YVYU ( vout_thread_t *, picture_t *, picture_t * );
#endif
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
+vlc_module_begin();
#if defined (MODULE_NAME_IS_chroma_i422_yuy2)
- SET_DESCRIPTION( _("conversions from " SRC_FOURCC " to " DEST_FOURCC) )
- ADD_CAPABILITY( CHROMA, 80 )
+ set_description( _("conversions from " SRC_FOURCC " to " DEST_FOURCC) );
+ set_capability( "chroma", 80 );
#elif defined (MODULE_NAME_IS_chroma_i422_yuy2_mmx)
- SET_DESCRIPTION( _("MMX conversions from " SRC_FOURCC " to " DEST_FOURCC) )
- ADD_CAPABILITY( CHROMA, 100 )
- ADD_REQUIREMENT( MMX )
+ set_description( _("MMX conversions from " SRC_FOURCC " to " DEST_FOURCC) );
+ set_capability( "chroma", 100 );
+ add_requirement( MMX );
#endif
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- chroma_getfunctions( &p_module->p_functions->chroma );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void chroma_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.chroma.pf_init = chroma_Init;
- p_function_list->functions.chroma.pf_end = chroma_End;
-}
+ set_callbacks( Activate, NULL );
+vlc_module_end();
/*****************************************************************************
- * chroma_Init: allocate a chroma function
+ * Activate: allocate a chroma function
*****************************************************************************
* This function allocates and initializes a chroma function
*****************************************************************************/
-static int chroma_Init( vout_thread_t *p_vout )
+static int Activate( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
if( p_vout->render.i_width & 1 || p_vout->render.i_height & 1 )
{
return -1;
return 0;
}
-/*****************************************************************************
- * chroma_End: free the chroma function
- *****************************************************************************
- * This function frees the previously allocated chroma function
- *****************************************************************************/
-static void chroma_End( vout_thread_t *p_vout )
-{
- ;
-}
-
/* Following functions are local */
/*****************************************************************************
* cinepak.c: cinepak video decoder
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: cinepak.c,v 1.4 2002/07/23 17:19:02 fenrir Exp $
+ * $Id: cinepak.c,v 1.5 2002/07/31 20:56:51 sam Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
#include "vdec_ext-plugins.h"
#include "cinepak.h"
-/*
+/*****************************************************************************
* Local prototypes
- */
-static int decoder_Probe ( vlc_fourcc_t * );
-static int decoder_Run ( decoder_fifo_t * );
+ *****************************************************************************/
+static int OpenDecoder ( vlc_object_t * );
+static int RunDecoder ( decoder_fifo_t * );
static int InitThread ( videodec_thread_t * );
static void EndThread ( videodec_thread_t * );
static void DecodeThread ( videodec_thread_t * );
-
-/*****************************************************************************
- * Capabilities
- *****************************************************************************/
-void _M( vdec_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.dec.pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
-}
-
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( "Cinepak Video Decoder" )
- ADD_CAPABILITY( DECODER, 70 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( vdec_getfunctions )( &p_module->p_functions->dec );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
+vlc_module_begin();
+ set_description( "Cinepak video decoder" );
+ set_capability( "decoder", 70 );
+ set_callbacks( OpenDecoder, NULL );
+vlc_module_end();
/*****************************************************************************
- * decoder_Probe: probe the decoder and return score
+ * OpenDecoder: probe the decoder and return score
*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
-static int decoder_Probe( vlc_fourcc_t *pi_type )
+static int OpenDecoder( vlc_object_t *p_this )
{
- switch( *pi_type )
+ decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
+
+ switch( p_fifo->i_fourcc )
{
- case( VLC_FOURCC('c','v','i','d') ):
- case( VLC_FOURCC('C','V','I','D') ):
- return( 0);
- default:
- return( -1 );
+ case VLC_FOURCC('c','v','i','d'):
+ case VLC_FOURCC('C','V','I','D'):
+ p_fifo->pf_run = RunDecoder;
+ return VLC_SUCCESS;
}
+
+ return VLC_EGENERIC;
}
/*****************************************************************************
- * decoder_Run: this function is called just after the thread is created
+ * RunDecoder: this function is called just after the thread is created
*****************************************************************************/
-static int decoder_Run ( decoder_fifo_t * p_fifo )
-{
+static int RunDecoder( decoder_fifo_t *p_fifo )
+{
videodec_thread_t *p_vdec;
int b_error;
* aout_directx.c: Windows DirectX audio output method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: aout_directx.c,v 1.25 2002/07/20 18:01:42 sam Exp $
+ * $Id: aout_directx.c,v 1.26 2002/07/31 20:56:51 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int aout_Open ( aout_thread_t * );
-static int aout_SetFormat ( aout_thread_t * );
-static int aout_GetBufInfo ( aout_thread_t *, int );
-static void aout_Play ( aout_thread_t *, byte_t *, int );
-static void aout_Close ( aout_thread_t * );
+static int SetFormat ( aout_thread_t * );
+static int GetBufInfo ( aout_thread_t *, int );
+static void Play ( aout_thread_t *, byte_t *, int );
/* local functions */
static int DirectxCreateSecondaryBuffer ( aout_thread_t * );
static void DirectSoundThread ( notification_thread_t * );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( aout_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.aout.pf_open = aout_Open;
- p_function_list->functions.aout.pf_setformat = aout_SetFormat;
- p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
- p_function_list->functions.aout.pf_play = aout_Play;
- p_function_list->functions.aout.pf_close = aout_Close;
-}
-
-/*****************************************************************************
- * aout_Open: open the audio device
+ * OpenAudio: open the audio device
*****************************************************************************
* This function opens and setups Direct Sound.
*****************************************************************************/
-static int aout_Open( aout_thread_t *p_aout )
+int E_(OpenAudio) ( vlc_object_t *p_this )
{
+ aout_thread_t * p_aout = (aout_thread_t *)p_this;
HRESULT dsresult;
DSBUFFERDESC dsbuffer_desc;
- msg_Dbg( p_aout, "aout_Open" );
+ msg_Dbg( p_aout, "Open" );
/* Allocate structure */
p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
p_aout->p_sys->l_data_played_from_beginning = 0;
vlc_mutex_init( p_aout, &p_aout->p_sys->buffer_lock );
+ p_aout->pf_setformat = SetFormat;
+ p_aout->pf_getbufinfo = GetBufInfo;
+ p_aout->pf_play = Play;
/* Initialise DirectSound */
if( DirectxInitDSound( p_aout ) )
}
/*****************************************************************************
- * aout_SetFormat: reset the audio device and sets its format
+ * SetFormat: reset the audio device and sets its format
*****************************************************************************
* This functions set a new audio format.
* For this we need to close the current secondary buffer and create another
* one with the desired format.
*****************************************************************************/
-static int aout_SetFormat( aout_thread_t *p_aout )
+static int SetFormat( aout_thread_t *p_aout )
{
HRESULT dsresult;
WAVEFORMATEX *p_waveformat;
unsigned long i_size_struct;
- msg_Dbg( p_aout, "aout_SetFormat" );
+ msg_Dbg( p_aout, "SetFormat" );
/* Set the format of Direct Sound primary buffer */
}
/*****************************************************************************
- * aout_GetBufInfo: buffer status query
+ * GetBufInfo: buffer status query
*****************************************************************************
* returns the number of bytes in the audio buffer that have not yet been
* sent to the sound device.
*****************************************************************************/
-static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
+static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
{
long l_play_position, l_notused, l_result;
HRESULT dsresult;
if( p_aout->p_sys->b_buffer_underflown )
{
- msg_Warn( p_aout, "aout_GetBufInfo underflow" );
+ msg_Warn( p_aout, "GetBufInfo underflow" );
return( i_buffer_limit );
}
&l_play_position, &l_notused);
if( dsresult != DS_OK )
{
- msg_Warn( p_aout, "aout_GetBufInfo cannot get current pos" );
+ msg_Warn( p_aout, "GetBufInfo cannot get current pos" );
return( i_buffer_limit );
}
+ p_aout->p_sys->l_write_position);
#if 0
- msg_Dbg( p_aout, "aout_GetBufInfo: %i", i_result);
+ msg_Dbg( p_aout, "GetBufInfo: %i", i_result);
#endif
return l_result;
}
/*****************************************************************************
- * aout_Play: play a sound buffer
+ * Play: play a sound buffer
*****************************************************************************
* This function writes a buffer of i_length bytes
* Don't forget that DirectSound buffers are circular buffers.
*****************************************************************************/
-static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
VOID *p_write_position, *p_start_buffer;
long l_bytes1, l_bytes2, l_play_position;
p_aout->p_sys->l_write_position = 0;
}
- msg_Warn( p_aout, "aout_Play underflow" );
+ msg_Warn( p_aout, "Play underflow" );
/* reinitialise the underflow detection counters */
p_aout->p_sys->b_buffer_underflown = 0;
p_aout->p_sys->l_data_written_from_beginning = 0;
}
if( dsresult != DS_OK )
{
- msg_Warn( p_aout, "aout_Play cannot lock buffer" );
+ msg_Warn( p_aout, "Play cannot lock buffer" );
vlc_mutex_unlock( &p_aout->p_sys->buffer_lock );
return;
}
}
if( dsresult != DS_OK )
{
- msg_Warn( p_aout, "aout_Play cannot play buffer" );
+ msg_Warn( p_aout, "Play cannot play buffer" );
return;
}
}
/*****************************************************************************
- * aout_Close: close the audio device
+ * CloseAudio: close the audio device
*****************************************************************************/
-static void aout_Close( aout_thread_t *p_aout )
+void E_(CloseAudio) ( vlc_object_t *p_this )
{
+ aout_thread_t * p_aout = (aout_thread_t *)p_this;
- msg_Dbg( p_aout, "aout_Close" );
+ msg_Dbg( p_aout, "Close" );
/* kill the position notification thread, if any */
vlc_object_detach_all( p_aout->p_sys->p_notif );
}
if( dsresult != DS_OK )
{
- msg_Warn( p_notif, "aout_Play cannot lock buffer" );
+ msg_Warn( p_notif, "Play cannot lock buffer" );
vlc_mutex_unlock( &p_aout->p_sys->buffer_lock );
return;
}
* directx.c : Windows DirectX plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: directx.c,v 1.11 2002/06/01 12:31:58 sam Exp $
+ * $Id: directx.c,v 1.12 2002/07/31 20:56:51 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
#include <vlc/vlc.h>
/*****************************************************************************
- * Capabilities defined in the other files.
+ * External prototypes
*****************************************************************************/
-void _M( aout_getfunctions )( function_list_t * p_function_list );
-void _M( vout_getfunctions )( function_list_t * p_function_list );
+int E_(OpenVideo) ( vlc_object_t * );
+void E_(CloseVideo) ( vlc_object_t * );
+
+int E_(OpenAudio) ( vlc_object_t * );
+void E_(CloseAudio) ( vlc_object_t * );
/*****************************************************************************
- * Building configuration tree
+ * Module descriptor
*****************************************************************************/
#define HW_YUV_TEXT N_("use hardware YUV->RGB conversions")
#define HW_YUV_LONGTEXT N_( \
"more hardware acceleration (like rescaling or YUV->RGB conversions). " \
"This option doesn't have any effect when using overlays." )
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Video"), NULL )
-ADD_BOOL ( "directx-hw-yuv", 1, NULL, HW_YUV_TEXT, HW_YUV_LONGTEXT )
-ADD_BOOL ( "directx-use-sysmem", 0, NULL, SYSMEM_TEXT, SYSMEM_LONGTEXT )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("DirectX extension module") )
- ADD_CAPABILITY( AOUT, 150 )
- ADD_CAPABILITY( VOUT, 150 )
-MODULE_INIT_STOP
+vlc_module_begin();
+ add_category_hint( N_("Video"), NULL );
+ add_bool( "directx-hw-yuv", 1, NULL, HW_YUV_TEXT, HW_YUV_LONGTEXT );
+ add_bool( "directx-use-sysmem", 0, NULL, SYSMEM_TEXT, SYSMEM_LONGTEXT );
+ set_description( _("DirectX extension module") )
+ add_submodule();
+ set_capability( "video output", 150 );
+ set_callbacks( E_(OpenVideo), E_(CloseVideo) );
+ add_submodule();
+ set_capability( "audio output", 150 );
+ set_callbacks( E_(OpenAudio), E_(CloseAudio) );
+vlc_module_end();
-MODULE_ACTIVATE_START
- _M( aout_getfunctions )( &p_module->p_functions->aout );
- _M( vout_getfunctions )( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
+#if 0 /* FIXME */
/* check if we registered a window class because we need to
* unregister it */
WNDCLASS wndclass;
if( GetClassInfo( GetModuleHandle(NULL), "VLC DirectX", &wndclass ) )
UnregisterClass( "VLC DirectX", GetModuleHandle(NULL) );
-MODULE_DEACTIVATE_STOP
+#endif
+
* vout_directx.c: Windows DirectX video output display method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: vout_directx.c,v 1.41 2002/07/29 19:07:00 gbazin Exp $
+ * $Id: vout_directx.c,v 1.42 2002/07/31 20:56:51 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int vout_Create ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
-static int vout_Manage ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static int Manage ( vout_thread_t * );
+static void Display ( vout_thread_t *, picture_t * );
static int NewPictureVec ( vout_thread_t *, picture_t *, int );
static void FreePictureVec ( vout_thread_t *, picture_t *, int );
static int DirectXGetSurfaceDesc ( picture_t *p_pic );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( vout_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocate DirectX video thread output method
+ * OpenVideo: allocate DirectX video thread output method
*****************************************************************************
* This function allocates and initialize the DirectX vout method.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
+int E_(OpenVideo) ( vlc_object_t *p_this )
{
+ vout_thread_t * p_vout = (vout_thread_t *)p_this;
+
/* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
}
/* Initialisations */
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = Manage;
+ p_vout->pf_render = NULL;
+ p_vout->pf_display = Display;
+
p_vout->p_sys->p_ddobject = NULL;
p_vout->p_sys->p_display = NULL;
p_vout->p_sys->p_current_surface = NULL;
return 0;
error:
- vout_Destroy( p_vout );
+ Destroy( p_vout );
return 1;
}
/*****************************************************************************
- * vout_Init: initialize DirectX video thread output method
+ * Init: initialize DirectX video thread output method
*****************************************************************************
* This function create the directx surfaces needed by the output thread.
* It is called at the beginning of the thread.
*****************************************************************************/
-static int vout_Init( vout_thread_t *p_vout )
+static int Init( vout_thread_t *p_vout )
{
int i_chroma_backup;
}
/*****************************************************************************
- * vout_End: terminate Sys video thread output method
+ * End: terminate Sys video thread output method
*****************************************************************************
- * Terminate an output method created by vout_Create.
+ * Terminate an output method created by Create.
* It is called at the end of the thread.
*****************************************************************************/
-static void vout_End( vout_thread_t *p_vout )
+static void End( vout_thread_t *p_vout )
{
FreePictureVec( p_vout, p_vout->p_picture, I_OUTPUTPICTURES );
return;
}
/*****************************************************************************
- * vout_Destroy: destroy Sys video thread output method
+ * CloseVideo: destroy Sys video thread output method
*****************************************************************************
- * Terminate an output method created by vout_Create
+ * Terminate an output method created by Create
*****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
-{
- msg_Dbg( p_vout, "vout_Destroy" );
+void E_(CloseVideo) ( vlc_object_t *p_this )
+{
+ vout_thread_t * p_vout = (vout_thread_t *)p_this;
+
+ msg_Dbg( p_vout, "CloseVideo" );
DirectXCloseDisplay( p_vout );
DirectXCloseDDraw( p_vout );
}
/*****************************************************************************
- * vout_Manage: handle Sys events
+ * Manage: handle Sys events
*****************************************************************************
* This function should be called regularly by the video output thread.
* It returns a non null value if an error occured.
*****************************************************************************/
-static int vout_Manage( vout_thread_t *p_vout )
+static int Manage( vout_thread_t *p_vout )
{
WINDOWPLACEMENT window_placement;
}
/*****************************************************************************
- * vout_Render: render previously calculated output
- *****************************************************************************/
-static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
-}
-
-/*****************************************************************************
- * vout_Display: displays previously rendered output
+ * Display: displays previously rendered output
*****************************************************************************
* This function sends the currently rendered image to the display, wait until
* it is displayed and switch the two rendering buffers, preparing next frame.
*****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+static void Display( vout_thread_t *p_vout, picture_t *p_pic )
{
HRESULT dxresult;
*****************************************************************************
* This function is used to move or resize an overlay surface on the screen.
* Ususally the overlay is moved by the user and thus, by a move or resize
- * event (in vout_Manage).
+ * event (in Manage).
*****************************************************************************/
void DirectXUpdateOverlay( vout_thread_t *p_vout )
{
downmix_SOURCES = downmix.c ac3_downmix_c.c
-downmixsse_SOURCES = downmixsse.c ac3_downmix_sse.c
-downmix3dn_SOURCES = downmix3dn.c ac3_downmix_3dn.c
+downmixsse_SOURCES = downmix.c ac3_downmix_sse.c
+downmix3dn_SOURCES = downmix.c ac3_downmix_3dn.c
* ac3_downmix_3dn.c: accelerated 3D Now! ac3 downmix functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: ac3_downmix_3dn.c,v 1.11 2002/06/01 12:31:58 sam Exp $
+ * $Id: ac3_downmix_3dn.c,v 1.12 2002/07/31 20:56:51 sam Exp $
*
* Authors: Renaud Dartus <reno@videolan.org>
*
static const float sqrt2_3dn __asm__ ("sqrt2_3dn") = 0.7071068;
-void _M( downmix_3f_2r_to_2ch ) (float * samples, dm_par_t * dm_par)
+void E_( downmix_3f_2r_to_2ch ) (float * samples, dm_par_t * dm_par)
{
__asm__ __volatile__ (
".align 16\n"
: "a" (samples), "c" (dm_par));
}
-void _M( downmix_2f_2r_to_2ch ) (float *samples, dm_par_t * dm_par)
+void E_( downmix_2f_2r_to_2ch ) (float *samples, dm_par_t * dm_par)
{
__asm__ __volatile__ (
".align 16\n"
: "a" (samples), "c" (dm_par));
}
-void _M( downmix_3f_1r_to_2ch ) (float *samples, dm_par_t * dm_par)
+void E_( downmix_3f_1r_to_2ch ) (float *samples, dm_par_t * dm_par)
{
__asm__ __volatile__ (
".align 16\n"
: "a" (samples), "c" (dm_par));
}
-void _M( downmix_2f_1r_to_2ch ) (float *samples, dm_par_t * dm_par)
+void E_( downmix_2f_1r_to_2ch ) (float *samples, dm_par_t * dm_par)
{
__asm__ __volatile__ (
".align 16\n"
: "a" (samples), "c" (dm_par));
}
-void _M( downmix_3f_0r_to_2ch ) (float *samples, dm_par_t * dm_par)
+void E_( downmix_3f_0r_to_2ch ) (float *samples, dm_par_t * dm_par)
{
__asm__ __volatile__ (
".align 16\n"
: "a" (samples), "c" (dm_par));
}
-void _M( stream_sample_1ch_to_s16 ) (s16 *s16_samples, float *left)
+void E_( stream_sample_1ch_to_s16 ) (s16 *s16_samples, float *left)
{
__asm__ __volatile__ (
".align 16\n"
: "a" (s16_samples), "c" (left));
}
-void _M( stream_sample_2ch_to_s16 ) (s16 *s16_samples, float *left, float *right)
+void E_( stream_sample_2ch_to_s16 ) (s16 *s16_samples, float *left, float *right)
{
__asm__ __volatile__ (
* ac3_downmix_c.c: ac3 downmix functions in C
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: ac3_downmix_c.c,v 1.5 2002/06/01 12:31:58 sam Exp $
+ * $Id: ac3_downmix_c.c,v 1.6 2002/07/31 20:56:51 sam Exp $
*
* Authors: Renaud Dartus <reno@videolan.org>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
#include "ac3_downmix.h"
-void _M( downmix_3f_2r_to_2ch ) (float *samples, dm_par_t *dm_par)
+void E_( downmix_3f_2r_to_2ch ) (float *samples, dm_par_t *dm_par)
{
int i;
float *left, *right, *center, *left_sur, *right_sur;
}
}
-void _M( downmix_2f_2r_to_2ch ) (float *samples, dm_par_t *dm_par)
+void E_( downmix_2f_2r_to_2ch ) (float *samples, dm_par_t *dm_par)
{
int i;
float *left, *right, *left_sur, *right_sur;
}
}
-void _M( downmix_3f_1r_to_2ch ) (float *samples, dm_par_t *dm_par)
+void E_( downmix_3f_1r_to_2ch ) (float *samples, dm_par_t *dm_par)
{
int i;
float *left, *right, *center, *right_sur;
}
-void _M( downmix_2f_1r_to_2ch ) (float *samples, dm_par_t *dm_par)
+void E_( downmix_2f_1r_to_2ch ) (float *samples, dm_par_t *dm_par)
{
int i;
float *left, *right, *right_sur;
}
-void _M( downmix_3f_0r_to_2ch ) (float *samples, dm_par_t *dm_par)
+void E_( downmix_3f_0r_to_2ch ) (float *samples, dm_par_t *dm_par)
{
int i;
float *left, *right, *center;
}
-void _M( stream_sample_2ch_to_s16 ) (s16 *out_buf, float *left, float *right)
+void E_( stream_sample_2ch_to_s16 ) (s16 *out_buf, float *left, float *right)
{
int i;
for (i=0; i < 256; i++) {
}
-void _M( stream_sample_1ch_to_s16 ) (s16 *out_buf, float *center)
+void E_( stream_sample_1ch_to_s16 ) (s16 *out_buf, float *center)
{
int i;
float tmp;
* ac3_downmix_common.h: ac3 downmix functions headers
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: ac3_downmix_common.h,v 1.1 2001/05/15 16:19:42 sam Exp $
+ * $Id: ac3_downmix_common.h,v 1.2 2002/07/31 20:56:51 sam Exp $
*
* Authors: Renaud Dartus <reno@videolan.org>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-void _M( downmix_3f_2r_to_2ch ) ( float *, dm_par_t * );
-void _M( downmix_2f_2r_to_2ch ) ( float *, dm_par_t * );
-void _M( downmix_3f_1r_to_2ch ) ( float *, dm_par_t * );
-void _M( downmix_2f_1r_to_2ch ) ( float *, dm_par_t * );
-void _M( downmix_3f_0r_to_2ch ) ( float *, dm_par_t * );
-void _M( stream_sample_2ch_to_s16 ) ( s16 *, float *, float * );
-void _M( stream_sample_1ch_to_s16 ) ( s16 *, float * );
+void E_( downmix_3f_2r_to_2ch ) ( float *, dm_par_t * );
+void E_( downmix_2f_2r_to_2ch ) ( float *, dm_par_t * );
+void E_( downmix_3f_1r_to_2ch ) ( float *, dm_par_t * );
+void E_( downmix_2f_1r_to_2ch ) ( float *, dm_par_t * );
+void E_( downmix_3f_0r_to_2ch ) ( float *, dm_par_t * );
+void E_( stream_sample_2ch_to_s16 ) ( s16 *, float *, float * );
+void E_( stream_sample_1ch_to_s16 ) ( s16 *, float * );
* ac3_downmix_sse.c: accelerated SSE ac3 downmix functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: ac3_downmix_sse.c,v 1.11 2002/06/01 12:31:58 sam Exp $
+ * $Id: ac3_downmix_sse.c,v 1.12 2002/07/31 20:56:51 sam Exp $
*
* Authors: Renaud Dartus <reno@videolan.org>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
static const float sqrt2_sse __asm__ ("sqrt2_sse") __attribute__ ((aligned (16))) = 0.7071068;
-void _M( downmix_3f_2r_to_2ch ) (float * samples, dm_par_t * dm_par)
+void E_( downmix_3f_2r_to_2ch ) (float * samples, dm_par_t * dm_par)
{
__asm__ __volatile__ (
".align 16\n"
: "a" (samples), "c" (dm_par));
}
-void _M( downmix_2f_2r_to_2ch ) (float *samples, dm_par_t * dm_par)
+void E_( downmix_2f_2r_to_2ch ) (float *samples, dm_par_t * dm_par)
{
__asm__ __volatile__ (
".align 16\n"
: "a" (samples), "c" (dm_par));
}
-void _M( downmix_3f_1r_to_2ch ) (float *samples, dm_par_t * dm_par)
+void E_( downmix_3f_1r_to_2ch ) (float *samples, dm_par_t * dm_par)
{
__asm__ __volatile__ (
".align 16\n"
: "a" (samples), "c" (dm_par));
}
-void _M( downmix_2f_1r_to_2ch ) (float *samples, dm_par_t * dm_par)
+void E_( downmix_2f_1r_to_2ch ) (float *samples, dm_par_t * dm_par)
{
__asm__ __volatile__ (
".align 16\n"
: "a" (samples), "c" (dm_par));
}
-void _M( downmix_3f_0r_to_2ch ) (float *samples, dm_par_t * dm_par)
+void E_( downmix_3f_0r_to_2ch ) (float *samples, dm_par_t * dm_par)
{
__asm__ __volatile__ (
".align 16\n"
: "a" (samples), "c" (dm_par));
}
-void _M( stream_sample_1ch_to_s16 ) (s16 *s16_samples, float *left)
+void E_( stream_sample_1ch_to_s16 ) (s16 *s16_samples, float *left)
{
__asm__ __volatile__ (
".align 16\n"
: "a" (s16_samples), "c" (left));
}
-void _M( stream_sample_2ch_to_s16 ) (s16 *s16_samples, float *left, float *right)
+void E_( stream_sample_2ch_to_s16 ) (s16 *s16_samples, float *left, float *right)
{
__asm__ __volatile__ (
".align 16\n"
* downmix.c : AC3 downmix module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: downmix.c,v 1.9 2002/06/01 12:31:58 sam Exp $
+ * $Id: downmix.c,v 1.10 2002/07/31 20:56:51 sam Exp $
*
* Authors: Renaud Dartus <reno@via.ecp.fr>
*
#include "ac3_downmix_common.h"
/*****************************************************************************
- * Local and extern prototypes.
+ * Module initializer
*****************************************************************************/
-static void downmix_getfunctions( function_list_t * p_function_list );
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("AC3 downmix module") )
- ADD_CAPABILITY( DOWNMIX, 50 )
- ADD_SHORTCUT( "c" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- downmix_getfunctions( &p_module->p_functions->downmix );
-MODULE_ACTIVATE_STOP
+static int Open ( vlc_object_t *p_this )
+{
+ downmix_t *p_downmix = (downmix_t *)p_this;
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+ p_downmix->pf_downmix_3f_2r_to_2ch = E_( downmix_3f_2r_to_2ch );
+ p_downmix->pf_downmix_3f_1r_to_2ch = E_( downmix_3f_1r_to_2ch );
+ p_downmix->pf_downmix_2f_2r_to_2ch = E_( downmix_2f_2r_to_2ch );
+ p_downmix->pf_downmix_2f_1r_to_2ch = E_( downmix_2f_1r_to_2ch );
+ p_downmix->pf_downmix_3f_0r_to_2ch = E_( downmix_3f_0r_to_2ch );
+ p_downmix->pf_stream_sample_2ch_to_s16 = E_( stream_sample_2ch_to_s16 );
+ p_downmix->pf_stream_sample_1ch_to_s16 = E_( stream_sample_1ch_to_s16 );
-/* Following functions are local */
+ return VLC_SUCCESS;
+}
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Module descriptor
*****************************************************************************/
-static void downmix_getfunctions( function_list_t * p_function_list )
-{
-#define F p_function_list->functions.downmix
- F.pf_downmix_3f_2r_to_2ch = _M( downmix_3f_2r_to_2ch );
- F.pf_downmix_3f_1r_to_2ch = _M( downmix_3f_1r_to_2ch );
- F.pf_downmix_2f_2r_to_2ch = _M( downmix_2f_2r_to_2ch );
- F.pf_downmix_2f_1r_to_2ch = _M( downmix_2f_1r_to_2ch );
- F.pf_downmix_3f_0r_to_2ch = _M( downmix_3f_0r_to_2ch );
- F.pf_stream_sample_2ch_to_s16 = _M( stream_sample_2ch_to_s16 );
- F.pf_stream_sample_1ch_to_s16 = _M( stream_sample_1ch_to_s16 );
-#undef F
-}
+vlc_module_begin();
+#ifdef MODULE_NAME_IS_downmix
+ set_description( _("AC3 downmix module") );
+ set_capability( "downmix", 50 );
+ add_shortcut( "c" );
+#elif defined( MODULE_NAME_IS_downmixsse )
+ set_description( _("SSE AC3 downmix module") );
+ set_capability( "downmix", 200 );
+ add_shortcut( "sse" );
+#elif defined( MODULE_NAME_IS_downmix3dn )
+ set_description( _("3D Now! AC3 downmix module") );
+ set_capability( "downmix", 200 );
+ add_shortcut( "3dn" );
+ add_shortcut( "3dnow" );
+#endif
+ set_callbacks( Open, NULL );
+vlc_module_end();
+++ /dev/null
-/*****************************************************************************
- * downmix3dn.c : accelerated 3D Now! AC3 downmix module
- *****************************************************************************
- * Copyright (C) 1999-2001 VideoLAN
- * $Id: downmix3dn.c,v 1.10 2002/06/01 12:31:58 sam Exp $
- *
- * Authors: Renaud Dartus <reno@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.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <stdlib.h>
-#include <string.h>
-
-#include <vlc/vlc.h>
-
-#include "ac3_downmix.h"
-#include "ac3_downmix_common.h"
-
-/*****************************************************************************
- * Local and extern prototypes.
- *****************************************************************************/
-static void downmix_getfunctions( function_list_t * p_function_list );
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("3D Now! AC3 downmix module") )
- ADD_CAPABILITY( DOWNMIX, 200 )
- ADD_REQUIREMENT( 3DNOW )
- ADD_SHORTCUT( "3dn" )
- ADD_SHORTCUT( "3dnow" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- downmix_getfunctions( &p_module->p_functions->downmix );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/* Following functions are local */
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void downmix_getfunctions( function_list_t * p_function_list )
-{
-#define F p_function_list->functions.downmix
- F.pf_downmix_3f_2r_to_2ch = _M( downmix_3f_2r_to_2ch );
- F.pf_downmix_3f_1r_to_2ch = _M( downmix_3f_1r_to_2ch );
- F.pf_downmix_2f_2r_to_2ch = _M( downmix_2f_2r_to_2ch );
- F.pf_downmix_2f_1r_to_2ch = _M( downmix_2f_1r_to_2ch );
- F.pf_downmix_3f_0r_to_2ch = _M( downmix_3f_0r_to_2ch );
- F.pf_stream_sample_2ch_to_s16 = _M( stream_sample_2ch_to_s16 );
- F.pf_stream_sample_1ch_to_s16 = _M( stream_sample_1ch_to_s16 );
-#undef F
-}
-
+++ /dev/null
-/*****************************************************************************
- * downmixsse.c : accelerated SSE AC3 downmix module
- *****************************************************************************
- * Copyright (C) 1999-2001 VideoLAN
- * $Id: downmixsse.c,v 1.10 2002/06/01 12:31:58 sam Exp $
- *
- * Authors: Renaud Dartus <reno@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.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <stdlib.h>
-#include <string.h>
-
-#include <vlc/vlc.h>
-
-#include "ac3_downmix.h"
-#include "ac3_downmix_common.h"
-
-/*****************************************************************************
- * Local and extern prototypes.
- *****************************************************************************/
-static void downmix_getfunctions( function_list_t * p_function_list );
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("SSE AC3 downmix module") )
- ADD_CAPABILITY( DOWNMIX, 200 )
- ADD_REQUIREMENT( SSE )
- ADD_SHORTCUT( "sse" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- downmix_getfunctions( &p_module->p_functions->downmix );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/* Following functions are local */
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void downmix_getfunctions( function_list_t * p_function_list )
-{
-#define F p_function_list->functions.downmix
- F.pf_downmix_3f_2r_to_2ch = _M( downmix_3f_2r_to_2ch );
- F.pf_downmix_3f_1r_to_2ch = _M( downmix_3f_1r_to_2ch );
- F.pf_downmix_2f_2r_to_2ch = _M( downmix_2f_2r_to_2ch );
- F.pf_downmix_2f_1r_to_2ch = _M( downmix_2f_1r_to_2ch );
- F.pf_downmix_3f_0r_to_2ch = _M( downmix_3f_0r_to_2ch );
- F.pf_stream_sample_2ch_to_s16 = _M( stream_sample_2ch_to_s16 );
- F.pf_stream_sample_1ch_to_s16 = _M( stream_sample_1ch_to_s16 );
-#undef F
-}
-
* dsp.c : OSS /dev/dsp module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: dsp.c,v 1.18 2002/07/20 18:01:42 sam Exp $
+ * $Id: dsp.c,v 1.19 2002/07/31 20:56:51 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
};
/*****************************************************************************
- * Local prototypes.
+ * Local prototypes
*****************************************************************************/
-static void aout_getfunctions ( function_list_t * );
-static int aout_Open ( aout_thread_t * );
-static int aout_SetFormat ( aout_thread_t * );
-static int aout_GetBufInfo ( aout_thread_t *, int );
-static void aout_Play ( aout_thread_t *, byte_t *, int );
-static void aout_Close ( aout_thread_t * );
+static int Open ( vlc_object_t * );
+static void Close ( vlc_object_t * );
-/*****************************************************************************
- * Capabilities defined in the other files.
- *****************************************************************************/
+static int SetFormat ( aout_thread_t * );
+static int GetBufInfo ( aout_thread_t *, int );
+static void Play ( aout_thread_t *, byte_t *, int );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_FILE ( "dspdev", "/dev/dsp", NULL, N_("OSS dsp device"), NULL )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("Linux OSS /dev/dsp module") )
- ADD_CAPABILITY( AOUT, 100 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- aout_getfunctions( &p_module->p_functions->aout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_file( "dspdev", "/dev/dsp", NULL, N_("OSS dsp device"), NULL );
+ set_description( _("Linux OSS /dev/dsp module") );
+ set_capability( "audio output", 100 );
+ set_callbacks( Open, Close );
+vlc_module_end();
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void aout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.aout.pf_open = aout_Open;
- p_function_list->functions.aout.pf_setformat = aout_SetFormat;
- p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
- p_function_list->functions.aout.pf_play = aout_Play;
- p_function_list->functions.aout.pf_close = aout_Close;
-}
-
-/*****************************************************************************
- * aout_Open: opens the audio device (the digital sound processor)
+ * Open: opens the audio device (the digital sound processor)
*****************************************************************************
* This function opens the dsp as a usual non-blocking write-only file, and
* modifies the p_aout->p_sys->i_fd with the file's descriptor.
*****************************************************************************/
-static int aout_Open( aout_thread_t *p_aout )
+static int Open( vlc_object_t *p_this )
{
+ aout_thread_t *p_aout = (aout_thread_t *)p_this;
+
/* Allocate structure */
p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
if( p_aout->p_sys == NULL )
return( -1 );
}
+ p_aout->pf_setformat = SetFormat;
+ p_aout->pf_getbufinfo = GetBufInfo;
+ p_aout->pf_play = Play;
+
/* Open the sound device */
if( (p_aout->p_sys->i_fd = open( p_aout->p_sys->psz_device, O_WRONLY ))
< 0 )
}
/*****************************************************************************
- * aout_SetFormat: resets the dsp and sets its format
+ * SetFormat: resets the dsp and sets its format
*****************************************************************************
* This functions resets the DSP device, tries to initialize the output
* format with the value contained in the dsp structure, and if this value
* could not be set, the default value returned by ioctl is set. It then
* does the same for the stereo mode, and for the output rate.
*****************************************************************************/
-static int aout_SetFormat( aout_thread_t *p_aout )
+static int SetFormat( aout_thread_t *p_aout )
{
int i_format;
int i_rate;
}
/*****************************************************************************
- * aout_GetBufInfo: buffer status query
+ * GetBufInfo: buffer status query
*****************************************************************************
* This function fills in the audio_buf_info structure :
* - returns : number of available fragments (not partially used ones)
* - int bytes : available space in bytes (includes partially used fragments)
* Note! 'bytes' could be more than fragments*fragsize
*****************************************************************************/
-static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
+static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
{
ioctl( p_aout->p_sys->i_fd, SNDCTL_DSP_GETOSPACE,
&p_aout->p_sys->audio_buf );
}
/*****************************************************************************
- * aout_Play: plays a sound samples buffer
+ * Play: plays a sound samples buffer
*****************************************************************************
* This function writes a buffer of i_length bytes in the dsp
*****************************************************************************/
-static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
int i_tmp;
i_tmp = write( p_aout->p_sys->i_fd, buffer, i_size );
}
/*****************************************************************************
- * aout_Close: closes the dsp audio device
+ * Close: closes the dsp audio device
*****************************************************************************/
-static void aout_Close( aout_thread_t *p_aout )
+static void Close( vlc_object_t *p_this )
{
+ aout_thread_t *p_aout = (aout_thread_t *)p_this;
+
close( p_aout->p_sys->i_fd );
free( p_aout->p_sys->psz_device );
}
* aout_dummy.c : dummy audio output plugin
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: aout_dummy.c,v 1.22 2002/07/20 18:01:42 sam Exp $
+ * $Id: aout_dummy.c,v 1.23 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include <vlc/vlc.h>
#include <vlc/aout.h>
-/*****************************************************************************
- * vout_dummy_t: dummy video output method descriptor
- *****************************************************************************
- * This structure is part of the video output thread descriptor.
- * It describes the dummy specific properties of an output thread.
- *****************************************************************************/
-struct aout_sys_t
-{
- /* Prevent malloc(0) */
- int i_dummy;
-};
-
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int aout_Open ( aout_thread_t *p_aout );
-static int aout_SetFormat ( aout_thread_t *p_aout );
-static int aout_GetBufInfo ( aout_thread_t *p_aout, int i_buffer_info );
-static void aout_Play ( aout_thread_t *p_aout,
- byte_t *buffer, int i_size );
-static void aout_Close ( aout_thread_t *p_aout );
+static int SetFormat ( aout_thread_t * );
+static int GetBufInfo ( aout_thread_t *, int );
+static void Play ( aout_thread_t *, byte_t *, int );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * OpenAudio: opens a dummy audio device
*****************************************************************************/
-void _M( aout_getfunctions )( function_list_t * p_function_list )
+int E_(OpenAudio) ( vlc_object_t *p_this )
{
- p_function_list->functions.aout.pf_open = aout_Open;
- p_function_list->functions.aout.pf_setformat = aout_SetFormat;
- p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
- p_function_list->functions.aout.pf_play = aout_Play;
- p_function_list->functions.aout.pf_close = aout_Close;
-}
+ aout_thread_t * p_aout = (aout_thread_t *)p_this;
-/*****************************************************************************
- * aout_Open: opens a dummy audio device
- *****************************************************************************/
-static int aout_Open( aout_thread_t *p_aout )
-{
- return( 0 );
+ p_aout->pf_setformat = SetFormat;
+ p_aout->pf_getbufinfo = GetBufInfo;
+ p_aout->pf_play = Play;
+
+ return VLC_SUCCESS;
}
/*****************************************************************************
- * aout_SetFormat: pretends to set the dsp output format
+ * SetFormat: pretends to set the dsp output format
*****************************************************************************/
-static int aout_SetFormat( aout_thread_t *p_aout )
+static int SetFormat( aout_thread_t *p_aout )
{
return( 0 );
}
/*****************************************************************************
- * aout_GetBufInfo: returns available bytes in buffer
+ * GetBufInfo: returns available bytes in buffer
*****************************************************************************/
-static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
+static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
{
return( sizeof(s16) * i_buffer_limit + 1 ); /* value big enough to sleep */
}
/*****************************************************************************
- * aout_Play: pretends to play a sound
- *****************************************************************************/
-static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
-{
- ;
-}
-
-/*****************************************************************************
- * aout_Close: closes the dummy audio device
+ * Play: pretends to play a sound
*****************************************************************************/
-static void aout_Close( aout_thread_t *p_aout )
+static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
;
}
* dec_dummy.c: dummy decoder plugin for vlc.
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: dec_dummy.c,v 1.1 2002/07/23 20:15:41 sam Exp $
+ * $Id: dec_dummy.c,v 1.2 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int Probe ( vlc_fourcc_t * );
-static int Run ( decoder_fifo_t * );
+static int Run ( decoder_fifo_t * );
/*****************************************************************************
- * Capabilities
- *****************************************************************************/
-void _M( dec_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.dec.pf_probe = Probe;
- p_function_list->functions.dec.pf_run = Run;
-}
-
-/*****************************************************************************
- * Probe: probe the decoder and return score
+ * OpenDecoder: probe the decoder and return score
*****************************************************************************
* Always returns 0 because we are the dummy decoder!
*****************************************************************************/
-static int Probe( vlc_fourcc_t *pi_type )
+int E_(OpenDecoder) ( vlc_object_t *p_this )
{
- return 0;
+ ((decoder_fifo_t*)p_this)->pf_run = Run;
+
+ return VLC_SUCCESS;
}
/*****************************************************************************
* dummy.c : dummy plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: dummy.c,v 1.23 2002/07/23 20:15:41 sam Exp $
+ * $Id: dummy.c,v 1.24 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include <vlc/vlc.h>
-/*****************************************************************************
- * Capabilities defined in the other files.
- *****************************************************************************/
-void _M( access_getfunctions ) ( function_list_t * p_function_list );
-void _M( demux_getfunctions ) ( function_list_t * p_function_list );
-void _M( aout_getfunctions ) ( function_list_t * p_function_list );
-void _M( vout_getfunctions ) ( function_list_t * p_function_list );
-void _M( intf_getfunctions ) ( function_list_t * p_function_list );
-void _M( dec_getfunctions ) ( function_list_t * p_function_list );
+#include "dummy.h"
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
#define CHROMA_TEXT N_("dummy image chroma format")
#define CHROMA_LONGTEXT N_( \
"format instead of trying to improve performances by using the most " \
"efficient one.")
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Video"), NULL )
-ADD_STRING ( "dummy-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT )
-MODULE_CONFIG_STOP
-
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("dummy functions module") )
- /* Capability score set to 0 because we don't want to be spawned
- * unless explicitly requested to */
- ADD_CAPABILITY( INTF, 0 )
- ADD_CAPABILITY( ACCESS, 0 )
- ADD_CAPABILITY( DEMUX, 0 )
- ADD_CAPABILITY( DECODER, 0 )
- ADD_CAPABILITY( AOUT, 0 )
- ADD_CAPABILITY( VOUT, 0 )
- ADD_SHORTCUT( "vlc" )
-MODULE_INIT_STOP
-
-
-MODULE_ACTIVATE_START
- _M( access_getfunctions )( &p_module->p_functions->access );
- _M( demux_getfunctions )( &p_module->p_functions->demux );
- _M( aout_getfunctions )( &p_module->p_functions->aout );
- _M( vout_getfunctions )( &p_module->p_functions->vout );
- _M( intf_getfunctions )( &p_module->p_functions->intf );
- _M( dec_getfunctions )( &p_module->p_functions->dec );
-MODULE_ACTIVATE_STOP
-
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("dummy functions module") );
+ add_shortcut( "vlc" );
+ add_submodule();
+ set_capability( "interface", 0 );
+ set_callbacks( E_(OpenIntf), NULL );
+ add_submodule();
+ set_capability( "access", 0 );
+ set_callbacks( E_(OpenAccess), NULL );
+ add_submodule();
+ set_capability( "demux", 0 );
+ set_callbacks( E_(OpenDemux), E_(CloseDemux) );
+ add_submodule();
+ set_capability( "decoder", 0 );
+ set_callbacks( E_(OpenDecoder), NULL );
+ add_submodule();
+ set_capability( "audio output", 0 );
+ set_callbacks( E_(OpenAudio), NULL );
+ add_submodule();
+ set_capability( "video output", 0 );
+ set_callbacks( E_(OpenVideo), NULL );
+ add_category_hint( N_("Video"), NULL );
+ add_string( "dummy-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT );
+vlc_module_end();
--- /dev/null
+/*****************************************************************************
+ * dummy.h : dummy plugin for vlc
+ *****************************************************************************
+ * Copyright (C) 2000, 2001, 2002 VideoLAN
+ * $Id: dummy.h,v 1.1 2002/07/31 20:56:51 sam Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ *
+ * 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.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * External prototypes
+ *****************************************************************************/
+int E_(OpenIntf) ( vlc_object_t * );
+
+int E_(OpenAccess) ( vlc_object_t * );
+
+int E_(OpenDemux) ( vlc_object_t * );
+void E_(CloseDemux) ( vlc_object_t * );
+
+int E_(OpenDecoder) ( vlc_object_t * );
+
+int E_(OpenAudio) ( vlc_object_t * );
+
+int E_(OpenVideo) ( vlc_object_t * );
+
* input_dummy.c: dummy input plugin, to manage "vlc:***" special options
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: input_dummy.c,v 1.20 2002/07/20 18:01:42 sam Exp $
+ * $Id: input_dummy.c,v 1.21 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int DummyInit ( input_thread_t * );
-static int DummyOpen ( input_thread_t * );
-static void DummyClose ( input_thread_t * );
-static void DummyEnd ( input_thread_t * );
-static int DummyDemux ( input_thread_t * );
+static int Demux ( input_thread_t * );
/*****************************************************************************
* access_sys_t: private input data
#define COMMAND_PAUSE 3
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * OpenAccess: open the target, ie. do nothing
*****************************************************************************/
-void _M( access_getfunctions )( function_list_t * p_function_list )
+int E_(OpenAccess) ( vlc_object_t *p_this )
{
-#define input p_function_list->functions.access
- input.pf_open = DummyOpen;
- input.pf_read = NULL;
- input.pf_close = DummyClose;
- input.pf_set_program = NULL;
- input.pf_set_area = NULL;
- input.pf_seek = NULL;
-#undef input
-}
-
-void _M( demux_getfunctions )( function_list_t * p_function_list )
-{
-#define input p_function_list->functions.demux
- input.pf_init = DummyInit;
- input.pf_end = DummyEnd;
- input.pf_demux = DummyDemux;
- input.pf_rewind = NULL;
-#undef input
-}
+ input_thread_t *p_input = (input_thread_t *)p_this;
-/*****************************************************************************
- * DummyOpen: open the target, ie. do nothing
- *****************************************************************************/
-static int DummyOpen( input_thread_t * p_input )
-{
p_input->stream.i_method = INPUT_METHOD_NONE;
/* Force dummy demux plug-in */
p_input->psz_demux = "vlc";
- return 0;
-}
-/*****************************************************************************
- * DummyClose: close the target, ie. do nothing
- *****************************************************************************/
-static void DummyClose( input_thread_t * p_input )
-{
+ return VLC_SUCCESS;
}
/*****************************************************************************
- * DummyInit: initialize the target, ie. parse the command
+ * OpenDemux: initialize the target, ie. parse the command
*****************************************************************************/
-static int DummyInit( input_thread_t *p_input )
+int E_(OpenDemux) ( vlc_object_t *p_this )
{
+ input_thread_t *p_input = (input_thread_t *)p_this;
char * psz_name = p_input->psz_name;
int i_len = strlen( psz_name );
struct demux_sys_t * p_method;
int i_arg;
p_input->stream.b_seekable = 0;
+ p_input->pf_demux = Demux;
+ p_input->pf_rewind = NULL;
p_method = malloc( sizeof( struct demux_sys_t ) );
if( p_method == NULL )
}
/*****************************************************************************
- * DummyEnd: end the target, ie. do nothing
+ * CloseDemux: initialize the target, ie. parse the command
*****************************************************************************/
-static void DummyEnd( input_thread_t *p_input )
+void E_(CloseDemux) ( vlc_object_t *p_this )
{
+ input_thread_t *p_input = (input_thread_t *)p_this;
+
free( p_input->p_demux_data );
}
/*****************************************************************************
- * DummyDemux: do what the command says
+ * Demux: do what the command says
*****************************************************************************/
-static int DummyDemux( input_thread_t *p_input )
+static int Demux( input_thread_t *p_input )
{
struct demux_sys_t * p_method = p_input->p_demux_data;
playlist_t *p_playlist;
* intf_dummy.c: dummy interface plugin
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: intf_dummy.c,v 1.21 2002/07/20 18:01:42 sam Exp $
+ * $Id: intf_dummy.c,v 1.22 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include <vlc/vlc.h>
#include <vlc/intf.h>
-/*****************************************************************************
- * intf_sys_t: description and status of FB interface
- *****************************************************************************/
-struct intf_sys_t
-{
- /* Prevent malloc(0) */
- int i_dummy;
-};
-
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int intf_Open ( intf_thread_t *p_intf );
-static void intf_Close ( intf_thread_t *p_intf );
-static void intf_Run ( intf_thread_t *p_intf );
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( intf_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.intf.pf_open = intf_Open;
- p_function_list->functions.intf.pf_close = intf_Close;
- p_function_list->functions.intf.pf_run = intf_Run;
-}
+static void Run ( intf_thread_t * );
/*****************************************************************************
- * intf_Open: initialize dummy interface
+ * Open: initialize dummy interface
*****************************************************************************/
-static int intf_Open( intf_thread_t *p_intf )
+int E_(OpenIntf) ( vlc_object_t *p_this )
{
- /* Allocate instance and initialize some members */
- p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
- if( p_intf->p_sys == NULL )
- {
- return( 1 );
- };
-
+ intf_thread_t *p_intf = (intf_thread_t*) p_this;
#ifdef WIN32
AllocConsole();
freopen( "CONOUT$", "w", stdout );
msg_Info( p_intf, _("\nUsing the dummy interface plugin...") );
#endif
- return( 0 );
-}
+ p_intf->pf_run = Run;
-/*****************************************************************************
- * intf_Close: destroy dummy interface
- *****************************************************************************/
-static void intf_Close( intf_thread_t *p_intf )
-{
- /* Destroy structure */
- free( p_intf->p_sys );
+ return VLC_SUCCESS;
}
-
/*****************************************************************************
- * intf_Run: main loop
+ * Run: main loop
*****************************************************************************/
-static void intf_Run( intf_thread_t *p_intf )
+static void Run( intf_thread_t *p_intf )
{
while( !p_intf->b_die )
{
* null.c : NULL module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: null.c,v 1.7 2002/06/01 12:31:58 sam Exp $
+ * $Id: null.c,v 1.8 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdlib.h> /* malloc(), free() */
-#include <string.h> /* strdup() */
-
#include <vlc/vlc.h>
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor.
*****************************************************************************/
-MODULE_CONFIG_START
- /* ADD_PANE( "First pane" )
- ADD_SUBCATEGORY_HINT( "First frame" )
-
- ADD_STRING( "Random text: ", MODULE_VAR(text), NULL )
- ADD_SUBCATEGORY_HINT( "Second frame" )
-
- ADD_FILE( "Select file: ", MODULE_VAR(file), NULL )
- ADD_SUBCATEGORY_HINT( "Third frame" )
-
- ADD_PANE( "Second pane" )
- ADD_SUBCATEGORY_HINT( "Frame" )
- */
-MODULE_CONFIG_STOP
-
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("the Null module that does nothing") )
-MODULE_INIT_STOP
-
-
-MODULE_ACTIVATE_START
- /* Since the Null module can't do anything, there is no need to
- * fill the p_functions structure. */
-MODULE_ACTIVATE_STOP
-
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("the module that does nothing") );
+vlc_module_end();
* vout_dummy.c: Dummy video output display method for testing purposes
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: vout_dummy.c,v 1.26 2002/07/23 00:39:16 sam Exp $
+ * $Id: vout_dummy.c,v 1.27 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#define DUMMY_HEIGHT 16
#define DUMMY_MAX_DIRECTBUFFERS 10
-/*****************************************************************************
- * vout_sys_t: dummy video output method descriptor
- *****************************************************************************
- * This structure is part of the video output thread descriptor.
- * It describes the dummy specific properties of an output thread.
- *****************************************************************************/
-struct vout_sys_t
-{
- /* Nothing needed here. Maybe stats ? */
-
- /* Prevent malloc(0) */
- int i_dummy;
-};
-
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int vout_Create ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static int vout_Manage ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( vout_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static int Manage ( vout_thread_t * );
+static void Render ( vout_thread_t *, picture_t * );
+static void Display ( vout_thread_t *, picture_t * );
/*****************************************************************************
- * vout_Create: allocates dummy video thread output method
+ * OpenVideo: activates dummy video thread output method
*****************************************************************************
- * This function allocates and initializes a dummy vout method.
+ * This function initializes a dummy vout method.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
+int E_(OpenVideo) ( vlc_object_t *p_this )
{
- /* Allocate structure */
- p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
- if( p_vout->p_sys == NULL )
- {
- msg_Err( p_vout, "out of memory" );
- return( 1 );
- }
+ vout_thread_t * p_vout = (vout_thread_t *)p_this;
- return( 0 );
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = Manage;
+ p_vout->pf_render = Render;
+ p_vout->pf_display = Display;
+
+ return VLC_SUCCESS;
}
/*****************************************************************************
- * vout_Init: initialize dummy video thread output method
+ * Init: initialize dummy video thread output method
*****************************************************************************/
-static int vout_Init( vout_thread_t *p_vout )
+static int Init( vout_thread_t *p_vout )
{
int i_index, i_chroma;
char *psz_chroma;
}
/*****************************************************************************
- * vout_End: terminate dummy video thread output method
+ * End: terminate dummy video thread output method
*****************************************************************************/
-static void vout_End( vout_thread_t *p_vout )
+static void End( vout_thread_t *p_vout )
{
int i_index;
}
/*****************************************************************************
- * vout_Destroy: destroy dummy video thread output method
- *****************************************************************************
- * Terminate an output method created by DummyCreateOutputMethod
- *****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
-{
- free( p_vout->p_sys );
-}
-
-/*****************************************************************************
- * vout_Manage: handle dummy events
+ * Manage: handle dummy events
*****************************************************************************
* This function should be called regularly by video output thread. It manages
* console events. It returns a non null value on error.
*****************************************************************************/
-static int vout_Manage( vout_thread_t *p_vout )
+static int Manage( vout_thread_t *p_vout )
{
return( 0 );
}
/*****************************************************************************
- * vout_Render: render previously calculated output
+ * Render: render previously calculated output
*****************************************************************************/
-static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
+static void Render( vout_thread_t *p_vout, picture_t *p_pic )
{
/* No need to do anything, the fake direct buffers stay as they are */
}
/*****************************************************************************
- * vout_Display: displays previously rendered output
+ * Display: displays previously rendered output
*****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+static void Display( vout_thread_t *p_vout, picture_t *p_pic )
{
/* No need to do anything, the fake direct buffers stay as they are */
}
* dvd.c : DVD input module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: dvd.c,v 1.33 2002/07/17 21:28:19 stef Exp $
+ * $Id: dvd.c,v 1.34 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
# include "dummy_dvdcss.h"
#endif
-/*****************************************************************************
- * Capabilities defined in the other files.
- *****************************************************************************/
-void _M( access_getfunctions)( function_list_t * p_function_list );
-void _M( demux_getfunctions)( function_list_t * p_function_list );
-
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
+int E_(DVDOpen) ( vlc_object_t * );
+void E_(DVDClose) ( vlc_object_t * );
+
+int E_(DVDInit) ( vlc_object_t * );
+
#ifdef GOD_DAMN_DMCA
static void *p_libdvdcss;
static void ProbeLibDVDCSS ( void );
#endif
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("[dvd:][device][@raw_device][@[title][,[chapter][,angle]]]"), NULL )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- ADD_CAPABILITY( DEMUX, 0 )
+vlc_module_begin();
+ int i;
+ add_category_hint( N_("[dvd:][device][@raw_device][@[title][,[chapter][,angle]]]"), NULL );
#ifdef GOD_DAMN_DMCA
- SET_DESCRIPTION( _("DVD input module, uses libdvdcss if present") )
- ADD_CAPABILITY( ACCESS, 90 )
+ set_description( _("DVD input module, uses libdvdcss if installed") );
+ i = 90;
#else
- SET_DESCRIPTION( _("DVD input module, uses libdvdcss") )
- ADD_CAPABILITY( ACCESS, 100 )
+ set_description( _("DVD input module, uses libdvdcss") );
+ i = 100;
#endif
- ADD_SHORTCUT( "dvdold" );
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( access_getfunctions)( &p_module->p_functions->access );
- _M( demux_getfunctions)( &p_module->p_functions->demux );
+ add_shortcut( "dvdold" );
+ add_submodule();
+ set_capability( "access", i );
+ set_callbacks( E_(DVDOpen), E_(DVDClose) );
+ add_submodule();
+ set_capability( "demux", 0 );
+ set_callbacks( E_(DVDInit), NULL );
#ifdef GOD_DAMN_DMCA
ProbeLibDVDCSS();
#endif
-MODULE_ACTIVATE_STOP
+vlc_module_end();
-MODULE_DEACTIVATE_START
-#ifdef GOD_DAMN_DMCA
+#if 0 /* FIXME */
UnprobeLibDVDCSS();
#endif
-MODULE_DEACTIVATE_STOP
-
/* Following functions are local */
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: dvd_access.c,v 1.21 2002/07/17 21:28:19 stef Exp $
+ * $Id: dvd_access.c,v 1.22 2002/07/31 20:56:51 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
*****************************************************************************/
/* called from outside */
-static int DVDOpen ( input_thread_t * );
-static void DVDClose ( input_thread_t * );
static int DVDSetArea ( input_thread_t *, input_area_t * );
static int DVDSetProgram ( input_thread_t *, pgrm_descriptor_t * );
static ssize_t DVDRead ( input_thread_t *, byte_t *, size_t );
static char * DVDParse( input_thread_t * );
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( access_getfunctions)( function_list_t * p_function_list )
-{
-#define input p_function_list->functions.access
- input.pf_open = DVDOpen;
- input.pf_close = DVDClose;
- input.pf_read = DVDRead;
- input.pf_set_area = DVDSetArea;
- input.pf_set_program = DVDSetProgram;
- input.pf_seek = DVDSeek;
-#undef input
-}
-
/*
* Data access functions
*/
/*****************************************************************************
* DVDOpen: open dvd
*****************************************************************************/
-static int DVDOpen( input_thread_t *p_input )
+int E_(DVDOpen) ( vlc_object_t *p_this )
{
+ input_thread_t * p_input = (input_thread_t *)p_this;
char * psz_device;
thread_dvd_data_t * p_dvd;
input_area_t * p_area;
}
p_input->p_access_data = (void *)p_dvd;
+ p_input->pf_read = DVDRead;
+ p_input->pf_seek = DVDSeek;
+ p_input->pf_set_area = DVDSetArea;
+ p_input->pf_set_program = DVDSetProgram;
+
/* Parse command line */
if( !( psz_device = DVDParse( p_input ) ) )
{
/*****************************************************************************
* DVDClose: close dvd
*****************************************************************************/
-static void DVDClose( input_thread_t *p_input )
+void E_(DVDClose) ( vlc_object_t *p_this )
{
+ input_thread_t * p_input = (input_thread_t *)p_this;
thread_dvd_data_t *p_dvd = (thread_dvd_data_t*)p_input->p_access_data;
IfoDestroy( p_dvd->p_ifo );
DVDReadAudio( p_input );
DVDReadSPU ( p_input );
- if( p_input->p_demux_module )
+ if( p_input->p_demux )
{
DVDLaunchDecoders( p_input );
}
/* dvd_demux.c: DVD demux functions.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: dvd_demux.c,v 1.7 2002/06/01 12:31:58 sam Exp $
+ * $Id: dvd_demux.c,v 1.8 2002/07/31 20:56:51 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-
-/* called from outside */
-static int DVDRewind ( input_thread_t * );
static int DVDDemux ( input_thread_t * );
-static int DVDInit ( input_thread_t * );
-static void DVDEnd ( input_thread_t * );
void DVDLaunchDecoders( input_thread_t * );
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( demux_getfunctions)( function_list_t * p_function_list )
-{
-#define demux p_function_list->functions.demux
- demux.pf_init = DVDInit;
- demux.pf_end = DVDEnd;
- demux.pf_demux = DVDDemux;
- demux.pf_rewind = DVDRewind;
-#undef demux
-}
-
/*
* Data demux functions
*/
/*****************************************************************************
* DVDInit: initializes DVD structures
*****************************************************************************/
-static int DVDInit( input_thread_t * p_input )
+int E_(DVDInit) ( vlc_object_t *p_this )
{
+ input_thread_t *p_input = (input_thread_t *)p_this;
+
if( p_input->stream.i_method != INPUT_METHOD_DVD )
{
return -1;
}
+ p_input->pf_demux = DVDDemux;
+ p_input->pf_rewind = NULL;
+
vlc_mutex_lock( &p_input->stream.stream_lock );
DVDLaunchDecoders( p_input );
return 0;
}
-/*****************************************************************************
- * DVDEnd: frees unused data
- *****************************************************************************/
-static void DVDEnd( input_thread_t * p_input )
-{
-}
-
/*****************************************************************************
* DVDDemux
*****************************************************************************/
return i;
}
-
-/*****************************************************************************
- * DVDRewind : reads a stream backward
- *****************************************************************************/
-static int DVDRewind( input_thread_t * p_input )
-{
- return( -1 );
-}
* access.c: access capabilities for dvdplay plugin.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: access.c,v 1.2 2002/07/25 20:34:35 stef Exp $
+ * $Id: access.c,v 1.3 2002/07/31 20:56:51 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
* Local prototypes
*****************************************************************************/
/* called from outside */
-static int dvdplay_Open ( input_thread_t * );
-static void dvdplay_Close ( input_thread_t * );
-static int dvdplay_SetArea ( input_thread_t *,
- input_area_t * );
-static int dvdplay_SetProgram ( input_thread_t *,
- pgrm_descriptor_t * );
-static int dvdplay_Read ( input_thread_t *,
- byte_t *, size_t );
+static int dvdplay_SetArea ( input_thread_t *, input_area_t * );
+static int dvdplay_SetProgram ( input_thread_t *, pgrm_descriptor_t * );
+static int dvdplay_Read ( input_thread_t *, byte_t *, size_t );
static void dvdplay_Seek ( input_thread_t *, off_t );
static void pf_vmg_callback ( void*, dvdplay_event_t );
/* only from inside */
-
static int dvdNewArea( input_thread_t *, input_area_t * );
static int dvdNewPGC ( input_thread_t * );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( access_getfunctions )( function_list_t * p_function_list )
-{
-#define access p_function_list->functions.access
- access.pf_open = dvdplay_Open;
- access.pf_close = dvdplay_Close;
- access.pf_read = dvdplay_Read;
- access.pf_set_area = dvdplay_SetArea;
- access.pf_set_program = dvdplay_SetProgram;
- access.pf_seek = dvdplay_Seek;
-#undef access
-}
-
-/*****************************************************************************
- * dvdplay_Open: open libdvdplay
+ * OpenDVD: open libdvdplay
*****************************************************************************/
-static int dvdplay_Open( input_thread_t *p_input )
+int E_(OpenDVD) ( vlc_object_t *p_this )
{
+ input_thread_t * p_input = (input_thread_t *)p_this;
char * psz_source;
dvd_data_t * p_dvd;
input_area_t * p_area;
p_input->p_access_data = (void *)p_dvd;
+ p_input->pf_read = dvdplay_Read;
+ p_input->pf_seek = dvdplay_Seek;
+ p_input->pf_set_area = dvdplay_SetArea;
+ p_input->pf_set_program = dvdplay_SetProgram;
+
/* command line */
if( ( psz_source = dvdplay_ParseCL( p_input,
&i_title, &i_chapter, &i_angle ) ) == NULL )
}
/*****************************************************************************
- * dvdplay_Close: close libdvdplay
+ * CloseDVD: close libdvdplay
*****************************************************************************/
-static void dvdplay_Close( input_thread_t *p_input )
+void E_(CloseDVD) ( vlc_object_t *p_this )
{
- dvd_data_t * p_dvd;
-
- p_dvd = (dvd_data_t *)p_input->p_access_data;
+ input_thread_t * p_input = (input_thread_t *)p_this;
+ dvd_data_t * p_dvd = (dvd_data_t *)p_input->p_access_data;
/* close libdvdplay */
dvdplay_close( p_dvd->vmg );
* demux.c: demux functions for dvdplay.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: demux.c,v 1.1 2002/07/23 19:56:19 stef Exp $
+ * $Id: demux.c,v 1.2 2002/07/31 20:56:51 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-
-/* called from outside */
-static int dvdplay_Rewind ( struct input_thread_t * );
-static int dvdplay_Demux ( struct input_thread_t * );
-static int dvdplay_Init ( struct input_thread_t * );
-static void dvdplay_End ( struct input_thread_t * );
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( demux_getfunctions)( function_list_t * p_function_list )
-{
-#define demux p_function_list->functions.demux
- demux.pf_init = dvdplay_Init;
- demux.pf_end = dvdplay_End;
- demux.pf_demux = dvdplay_Demux;
- demux.pf_rewind = dvdplay_Rewind;
-#undef demux
-}
-
-/*
- * Data demux functions
- */
+static int Demux ( input_thread_t * );
/*****************************************************************************
- * dvdplay_Init: initializes dvdplay structures
+ * InitDVD: initializes dvdplay structures
*****************************************************************************/
-static int dvdplay_Init( input_thread_t * p_input )
+int E_(InitDVD) ( vlc_object_t *p_this )
{
+ input_thread_t *p_input = (input_thread_t *)p_this;
dvd_data_t * p_dvd;
char * psz_intf = NULL;
p_input->p_demux_data = (void*)p_input->p_access_data;
p_dvd = (dvd_data_t *)p_input->p_demux_data;
+ p_input->pf_demux = Demux;
+ p_input->pf_rewind = NULL;
+
psz_intf = config_GetPsz( p_input, "intf" );
config_PutPsz( p_input, "intf", "dvdplay" );
p_dvd->p_intf = intf_Create( p_input );
}
/*****************************************************************************
- * dvdplay_End: frees unused data
+ * EndDVD: frees unused data
*****************************************************************************/
-static void dvdplay_End( input_thread_t * p_input )
+void E_(EndDVD) ( vlc_object_t *p_this )
{
+ input_thread_t *p_input = (input_thread_t *)p_this;
dvd_data_t * p_dvd;
intf_thread_t * p_intf = NULL;
}
/*****************************************************************************
- * dvdplay_Demux
+ * Demux
*****************************************************************************/
-static int dvdplay_Demux( input_thread_t * p_input )
+static int Demux( input_thread_t * p_input )
{
dvd_data_t * p_dvd;
data_packet_t * p_data;
return i_data_nb;
}
-/*****************************************************************************
- * dvdplay_Rewind : reads a stream backward
- *****************************************************************************/
-static int dvdplay_Rewind( input_thread_t * p_input )
-{
- return( -1 );
-}
*****************************************************************************
*
* Copyright (C) 2001 VideoLAN
- * $Id: dvd.c,v 1.1 2002/07/23 19:56:19 stef Exp $
+ * $Id: dvd.c,v 1.2 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include <vlc/vlc.h>
/*****************************************************************************
- * Capabilities defined in the other files.
+ * Exported prototypes
*****************************************************************************/
-void _M( access_getfunctions)( function_list_t * p_function_list );
-void _M( demux_getfunctions)( function_list_t * p_function_list );
-void _M( intf_getfunctions)( function_list_t * p_function_list );
+int E_(OpenDVD) ( vlc_object_t * );
+void E_(CloseDVD) ( vlc_object_t * );
+int E_(InitDVD) ( vlc_object_t * );
+void E_(EndDVD) ( vlc_object_t * );
+int E_(OpenIntf) ( vlc_object_t * );
+void E_(CloseIntf) ( vlc_object_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( "[dvdplay:][device][@[title][,[chapter][,angle]]]", NULL )
-MODULE_CONFIG_STOP
+vlc_module_begin();
+ add_category_hint( "[dvdplay:][device][@[title][,[chapter][,angle]]]", NULL );
+ set_description( "dvdplay input module" );
+ add_submodule();
+ set_capability( "access", 120 );
+ set_callbacks( E_(OpenDVD), E_(CloseDVD) );
+ add_shortcut( "dvd" );
+ add_submodule();
+ set_capability( "demux", 0 );
+ set_callbacks( E_(InitDVD), E_(EndDVD) );
+ add_submodule();
+ set_capability( "interface", 0 );
+ set_callbacks( E_(OpenIntf), E_(CloseIntf) );
+vlc_module_end();
-MODULE_INIT_START
- SET_DESCRIPTION( "dvdplay input module" )
- ADD_CAPABILITY( INTF, 0 )
- ADD_CAPABILITY( DEMUX, 0 )
- ADD_CAPABILITY( ACCESS, 120 )
- ADD_SHORTCUT( "dvd" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( access_getfunctions)( &p_module->p_functions->access );
- _M( demux_getfunctions)( &p_module->p_functions->demux );
- _M( intf_getfunctions)( &p_module->p_functions->intf );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
* intf.c: interface for DVD video manager
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: intf.c,v 1.1 2002/07/23 19:56:19 stef Exp $
+ * $Id: intf.c,v 1.2 2002/07/31 20:56:51 sam Exp $
*
* Authors: Stéphane Borel <stef@via.ecp.fr>
*
static int InitThread ( intf_thread_t *p_intf );
/* Exported functions */
-static int intf_Open ( intf_thread_t *p_intf );
-static void intf_Close ( intf_thread_t *p_intf );
-static void intf_Run ( intf_thread_t *p_intf );
-
+static void RunIntf ( intf_thread_t *p_intf );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * OpenIntf: initialize dummy interface
*****************************************************************************/
-void _M( intf_getfunctions )( function_list_t * p_function_list )
+int E_(OpenIntf) ( vlc_object_t *p_this )
{
- p_function_list->functions.intf.pf_open = intf_Open;
- p_function_list->functions.intf.pf_close = intf_Close;
- p_function_list->functions.intf.pf_run = intf_Run;
-}
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
-/*****************************************************************************
- * intf_Open: initialize dummy interface
- *****************************************************************************/
-static int intf_Open( intf_thread_t *p_intf )
-{
/* Allocate instance and initialize some members */
p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
return( 1 );
};
+ p_intf->pf_run = RunIntf;
+
p_intf->p_sys->m_still_time = 0;
p_intf->p_sys->b_inf_still = 0;
p_intf->p_sys->b_still = 0;
}
/*****************************************************************************
- * intf_Close: destroy dummy interface
+ * CloseIntf: destroy dummy interface
*****************************************************************************/
-static void intf_Close( intf_thread_t *p_intf )
+void E_(CloseIntf) ( vlc_object_t *p_this )
{
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
+
/* Destroy structure */
free( p_intf->p_sys );
}
/*****************************************************************************
- * intf_Run: main loop
+ * RunIntf: main loop
*****************************************************************************/
-static void intf_Run( intf_thread_t *p_intf )
+static void RunIntf( intf_thread_t *p_intf )
{
vout_thread_t * p_vout;
dvdplay_ctrl_t control;
* dvdread.c : DvdRead input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: dvdread.c,v 1.17 2002/06/02 23:11:48 sam Exp $
+ * $Id: dvdread.c,v 1.18 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include <vlc/vlc.h>
/*****************************************************************************
- * Capabilities defined in the other files.
+ * External prototypes
*****************************************************************************/
-void _M( access_getfunctions)( function_list_t * p_function_list );
-void _M( demux_getfunctions)( function_list_t * p_function_list );
+int E_(OpenDVD) ( vlc_object_t * );
+void E_(CloseDVD) ( vlc_object_t * );
+
+int E_(InitDVD) ( vlc_object_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("[dvdread:][device][@[title][,[chapter][,angle]]]"), NULL )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("DVDRead input module") )
- ADD_CAPABILITY( DEMUX, 0 )
- ADD_CAPABILITY( ACCESS, 110 )
- //ADD_SHORTCUT( "dvd" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( access_getfunctions)( &p_module->p_functions->access );
- _M( demux_getfunctions)( &p_module->p_functions->demux );
-MODULE_ACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( "[dvdread:][device][@[title][,[chapter][,angle]]]", NULL );
+ set_description( _("DVDRead input module") );
+ add_submodule();
+ set_capability( "access", 110 );
+ set_callbacks( E_(OpenDVD), E_(CloseDVD) );
+ add_submodule();
+ set_capability( "demux", 0 );
+ set_callbacks( E_(InitDVD), NULL );
+vlc_module_end();
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
* It depends on: libdvdread for ifo files and block reading.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: input_dvdread.c,v 1.41 2002/07/23 00:39:17 sam Exp $
+ * $Id: input_dvdread.c,v 1.42 2002/07/31 20:56:51 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
* Local prototypes
*****************************************************************************/
/* called from outside */
-static int DvdReadInit ( input_thread_t * );
-static void DvdReadEnd ( input_thread_t * );
static int DvdReadDemux ( input_thread_t * );
static int DvdReadRewind ( input_thread_t * );
-static int DvdReadOpen ( input_thread_t * );
-static void DvdReadClose ( input_thread_t * );
static int DvdReadSetArea ( input_thread_t *, input_area_t * );
static int DvdReadSetProgram ( input_thread_t *, pgrm_descriptor_t * );
static int DvdReadRead ( input_thread_t *, byte_t *, size_t );
static void DvdReadHandleDSI( thread_dvd_data_t * p_dvd, u8 * p_data );
static void DvdReadFindCell ( thread_dvd_data_t * p_dvd );
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( access_getfunctions )( function_list_t * p_function_list )
-{
-#define access p_function_list->functions.access
- access.pf_open = DvdReadOpen;
- access.pf_close = DvdReadClose;
- access.pf_read = DvdReadRead;
- access.pf_set_area = DvdReadSetArea;
- access.pf_set_program = DvdReadSetProgram;
- access.pf_seek = DvdReadSeek;
-#undef access
-}
-
-void _M( demux_getfunctions )( function_list_t * p_function_list )
-{
-#define demux p_function_list->functions.demux
- demux.pf_init = DvdReadInit;
- demux.pf_end = DvdReadEnd;
- demux.pf_demux = DvdReadDemux;
- demux.pf_rewind = DvdReadRewind;
-#undef demux
-}
-
/*
* Data demux functions
*/
/*****************************************************************************
- * DvdReadInit: initializes DVD structures
+ * InitDVD: initializes DVD structures
*****************************************************************************/
-static int DvdReadInit( input_thread_t * p_input )
+int E_(InitDVD) ( vlc_object_t *p_this )
{
+ input_thread_t *p_input = (input_thread_t *)p_this;
+
if( p_input->stream.i_method != INPUT_METHOD_DVD )
{
return -1;
}
+ p_input->pf_demux = DvdReadDemux;
+ p_input->pf_rewind = NULL;
+
vlc_mutex_lock( &p_input->stream.stream_lock );
DvdReadLauchDecoders( p_input );
return 0;
}
-/*****************************************************************************
- * DvdReadEnd: frees unused data
- *****************************************************************************/
-static void DvdReadEnd( input_thread_t * p_input )
-{
-}
-
/*****************************************************************************
* DvdReadDemux
*****************************************************************************/
*/
/*****************************************************************************
- * DvdReadOpen: open libdvdread
+ * OpenDVD: open libdvdread
*****************************************************************************/
-static int DvdReadOpen( input_thread_t *p_input )
+int E_(OpenDVD) ( vlc_object_t *p_this )
{
+ input_thread_t * p_input = (input_thread_t *)p_this;
char * psz_orig;
char * psz_parser;
char * psz_source;
return( -1 );
}
+ p_input->pf_read = DvdReadRead;
+ p_input->pf_seek = DvdReadSeek;
+ p_input->pf_set_area = DvdReadSetArea;
+ p_input->pf_set_program = DvdReadSetProgram;
+
while( *psz_parser && *psz_parser != '@' )
{
psz_parser++;
}
/*****************************************************************************
- * DvdReadClose: close libdvdread
+ * CloseDVD: close libdvdread
*****************************************************************************/
-static void DvdReadClose( input_thread_t *p_input )
+void E_(CloseDVD) ( vlc_object_t *p_this )
{
- thread_dvd_data_t * p_dvd;
-
- p_dvd = (thread_dvd_data_t *)p_input->p_access_data;
+ input_thread_t * p_input = (input_thread_t *)p_this;
+ thread_dvd_data_t * p_dvd = (thread_dvd_data_t *)p_input->p_access_data;
/* close libdvdread */
DVDCloseFile( p_dvd->p_title );
/* FIXME: hack to check that the demuxer is ready, and set
* the decoders */
- if( p_input->p_demux_module )
+ if( p_input->p_demux )
{
DvdReadLauchDecoders( p_input );
}
* esd.c : EsounD module
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: esd.c,v 1.16 2002/07/20 18:01:42 sam Exp $
+ * $Id: esd.c,v 1.17 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
};
/*****************************************************************************
- * Local prototypes.
+ * Local prototypes
*****************************************************************************/
-static void aout_getfunctions ( function_list_t * p_function_list );
-static int aout_Open ( aout_thread_t * );
-static int aout_SetFormat ( aout_thread_t * );
-static int aout_GetBufInfo ( aout_thread_t *, int );
-static void aout_Play ( aout_thread_t *, byte_t *, int );
-static void aout_Close ( aout_thread_t * );
+static int Open ( vlc_object_t * );
+static void Close ( vlc_object_t * );
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("EsounD audio module") )
- ADD_CAPABILITY( AOUT, 50 )
- ADD_SHORTCUT( "esound" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- aout_getfunctions( &p_module->p_functions->aout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+static int SetFormat ( aout_thread_t * );
+static int GetBufInfo ( aout_thread_t *, int );
+static void Play ( aout_thread_t *, byte_t *, int );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Module descriptor
*****************************************************************************/
-static void aout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.aout.pf_open = aout_Open;
- p_function_list->functions.aout.pf_setformat = aout_SetFormat;
- p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
- p_function_list->functions.aout.pf_play = aout_Play;
- p_function_list->functions.aout.pf_close = aout_Close;
-}
+vlc_module_begin();
+ set_description( _("EsounD audio module") );
+ set_capability( "audio output", 50 );
+ set_callbacks( Open, Close );
+ add_shortcut( "esound" );
+vlc_module_end();
/*****************************************************************************
- * aout_Open: open an esd socket
+ * Open: open an esd socket
*****************************************************************************/
-static int aout_Open( aout_thread_t *p_aout )
+static int Open( vlc_object_t *p_this )
{
+ aout_thread_t *p_aout = (aout_thread_t *)p_this;
+
/* mpg123 does it this way */
int i_bits = ESD_BITS16;
int i_mode = ESD_STREAM;
return( -1 );
}
+ p_aout->pf_setformat = SetFormat;
+ p_aout->pf_getbufinfo = GetBufInfo;
+ p_aout->pf_play = Play;
+
return( 0 );
}
/*****************************************************************************
- * aout_SetFormat: set the output format
+ * SetFormat: set the output format
*****************************************************************************/
-static int aout_SetFormat( aout_thread_t *p_aout )
+static int SetFormat( aout_thread_t *p_aout )
{
int i_fd;
}
/*****************************************************************************
- * aout_GetBufInfo: buffer status query
+ * GetBufInfo: buffer status query
*****************************************************************************/
-static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
+static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
{
/* arbitrary value that should be changed */
return( i_buffer_limit );
}
/*****************************************************************************
- * aout_Play: play a sound samples buffer
+ * Play: play a sound samples buffer
*****************************************************************************
* This function writes a buffer of i_length bytes in the socket
*****************************************************************************/
-static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
int i_amount;
}
/*****************************************************************************
- * aout_Close: close the Esound socket
+ * Close: close the Esound socket
*****************************************************************************/
-static void aout_Close( aout_thread_t *p_aout )
+static void Close( vlc_object_t *p_this )
{
+ aout_thread_t *p_aout = (aout_thread_t *)p_this;
+
close( p_aout->p_sys->i_fd );
}
* familiar.c : familiar plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: familiar.c,v 1.6 2002/07/24 20:46:08 jpsaman Exp $
+ * $Id: familiar.c,v 1.7 2002/07/31 20:56:51 sam Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static void intf_getfunctions ( function_list_t * p_function_list );
-static int intf_Open ( intf_thread_t *p_intf );
-static void intf_Close ( intf_thread_t *p_intf );
-static void intf_Run ( intf_thread_t *p_intf );
-
-/*****************************************************************************
- * Building configuration tree
- *****************************************************************************/
-MODULE_CONFIG_START
- ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("Familiar Linux Gtk+ interface module") )
- ADD_CAPABILITY( INTF, 70 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( intf_getfunctions )( &p_module->p_functions->intf );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+static int Open ( vlc_object_t * );
+static void Close ( vlc_object_t * );
+static void Run ( intf_thread_t * );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Module descriptor
*****************************************************************************/
-static void intf_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.intf.pf_open = intf_Open;
- p_function_list->functions.intf.pf_close = intf_Close;
- p_function_list->functions.intf.pf_run = intf_Run;
-}
+vlc_module_begin();
+ set_description( _("Familiar Linux Gtk+ interface module") );
+ set_capability( "interface", 70 );
+ set_callbacks( Open, Close );
+vlc_module_end();
/*****************************************************************************
- * intf_Open: initialize and create window
+ * Open: initialize and create window
*****************************************************************************/
-static int intf_Open( intf_thread_t *p_intf )
-{
+static int Open( vlc_object_t *p_this )
+{
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
+
/* Allocate instance and initialize some members */
p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
/* Initialize Gtk+ thread */
p_intf->p_sys->p_input = NULL;
+ p_intf->pf_run = Run;
+
return( 0 );
}
/*****************************************************************************
- * intf_Close: destroy interface window
+ * Close: destroy interface window
*****************************************************************************/
-static void intf_Close( intf_thread_t *p_intf )
-{
+static void Close( vlc_object_t *p_this )
+{
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
+
if( p_intf->p_sys->p_input )
{
vlc_object_release( p_intf->p_sys->p_input );
}
/*****************************************************************************
- * intf_Run: Gtk+ thread
+ * Run: Gtk+ thread
*****************************************************************************
* this part of the interface is in a separate thread so that we can call
* gtk_main() from within it without annoying the rest of the program.
* XXX: the approach may look kludgy, and probably is, but I could not find
* a better way to dynamically load a Gtk+ interface at runtime.
*****************************************************************************/
-static void intf_Run( intf_thread_t *p_intf )
+static void Run( intf_thread_t *p_intf )
{
/* gtk_init needs to know the command line. We don't care, so we
* give it an empty one */
* fb.c : framebuffer plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: fb.c,v 1.21 2002/07/23 00:39:17 sam Exp $
+ * $Id: fb.c,v 1.22 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include <vlc/vout.h>
/*****************************************************************************
- * Capabilities defined in the other files.
+ * Local prototypes
*****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list );
+static int Create ( vlc_object_t * );
+static void Destroy ( vlc_object_t * );
-static int vout_Create ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
-static int vout_Manage ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static int Manage ( vout_thread_t * );
+static void Display ( vout_thread_t *, picture_t * );
static int OpenDisplay ( vout_thread_t * );
static void CloseDisplay ( vout_thread_t * );
static void GfxMode ( int i_tty );
/*****************************************************************************
- * Building configuration tree
+ * Module descriptor
*****************************************************************************/
#define FB_DEV_VAR "fbdev"
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_STRING ( FB_DEV_VAR, "/dev/fb0", NULL, N_("framebuffer device"), NULL )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("Linux console framebuffer module") )
- ADD_CAPABILITY( VOUT, 30 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- vout_getfunctions( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_string( FB_DEV_VAR, "/dev/fb0", NULL, N_("framebuffer device"), NULL );
+ set_description( _("Linux console framebuffer module") );
+ set_capability( "video output", 30 );
+ set_callbacks( Create, Destroy );
+vlc_module_end();
/*****************************************************************************
* vout_sys_t: video output framebuffer method descriptor
};
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocates FB video thread output method
+ * Create: allocates FB video thread output method
*****************************************************************************
* This function allocates and initializes a FB vout method.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
+static int Create( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
struct sigaction sig_tty; /* sigaction for tty change */
struct vt_mode vt_mode; /* vt current mode */
struct termios new_termios;
return( 1 );
};
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = Manage;
+ p_vout->pf_render = NULL;
+ p_vout->pf_display = Display;
+
/* Set tty and fb devices */
p_vout->p_sys->i_tty = 0; /* 0 == /dev/tty0 == current console */
}
/*****************************************************************************
- * vout_Init: initialize framebuffer video thread output method
+ * Init: initialize framebuffer video thread output method
*****************************************************************************/
-static int vout_Init( vout_thread_t *p_vout )
+static int Init( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic;
}
/*****************************************************************************
- * vout_End: terminate framebuffer video thread output method
+ * End: terminate framebuffer video thread output method
*****************************************************************************/
-static void vout_End( vout_thread_t *p_vout )
+static void End( vout_thread_t *p_vout )
{
/* Clear the screen */
memset( p_vout->p_sys->p_video, 0, p_vout->p_sys->i_page_size );
}
/*****************************************************************************
- * vout_Destroy: destroy FB video thread output method
+ * Destroy: destroy FB video thread output method
*****************************************************************************
- * Terminate an output method created by vout_CreateOutputMethod
+ * Terminate an output method created by Create
*****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
+static void Destroy( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
CloseDisplay( p_vout );
/* Reset the terminal */
}
/*****************************************************************************
- * vout_Manage: handle FB events
+ * Manage: handle FB events
*****************************************************************************
* This function should be called regularly by video output thread. It manages
* console events. It returns a non null value on error.
*****************************************************************************/
-static int vout_Manage( vout_thread_t *p_vout )
+static int Manage( vout_thread_t *p_vout )
{
#if 0
u8 buf;
p_vout->i_changes &= ~VOUT_SIZE_CHANGE;
/* Destroy XImages to change their size */
- vout_End( p_vout );
+ End( p_vout );
/* Recreate XImages. If SysInit failed, the thread can't go on. */
- if( vout_Init( p_vout ) )
+ if( Init( p_vout ) )
{
msg_Err( p_vout, "cannot reinit framebuffer screen" );
return( 1 );
}
/*****************************************************************************
- * vout_Render: renders previously calculated output
- *****************************************************************************/
-static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
-}
-
-/*****************************************************************************
- * vout_Display: displays previously rendered output
+ * Display: displays previously rendered output
*****************************************************************************
* This function send the currently rendered image to FB image, waits until
* it is displayed and switch the two rendering buffers, preparing next frame.
*****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+static void Display( vout_thread_t *p_vout, picture_t *p_pic )
{
/* swap the two Y offsets if the drivers supports panning */
if( p_vout->p_sys->b_pan )
}
#if 0
-static void vout_SetPalette( vout_thread_t *p_vout,
+static void SetPalette( vout_thread_t *p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp )
{
struct fb_cmap cmap = { 0, 256, red, green, blue, transp };
* ffmpeg.c: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: ffmpeg.c,v 1.20 2002/07/23 17:19:02 fenrir Exp $
+ * $Id: ffmpeg.c,v 1.21 2002/07/31 20:56:51 sam Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
/*
* Local prototypes
*/
-static int decoder_Probe ( vlc_fourcc_t * );
-static int decoder_Run ( decoder_fifo_t * );
+static int OpenDecoder ( vlc_object_t * );
+static int RunDecoder ( decoder_fifo_t * );
static int InitThread ( videodec_thread_t * );
static void EndThread ( videodec_thread_t * );
static void DecodeThread ( videodec_thread_t * );
static int b_ffmpeginit = 0;
/*****************************************************************************
- * Capabilities
- *****************************************************************************/
-void _M( vdec_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.dec.pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
-}
-
-/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
#define ERROR_RESILIENCE_LONGTEXT \
"when there not enough time.\n It's usefull with low CPU power " \
"but it could produce broken pictures."
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
#if LIBAVCODEC_BUILD >= 4611
- ADD_INTEGER ( "ffmpeg-error-resilience", 0, NULL,
- "error resilience", ERROR_RESILIENCE_LONGTEXT )
- ADD_INTEGER ( "ffmpeg-workaround-bugs", 0, NULL,
- "workaround bugs", "0-99, seems to be for msmpeg v3\n" )
+ add_integer ( "ffmpeg-error-resilience", 0, NULL,
+ "error resilience", ERROR_RESILIENCE_LONGTEXT );
+ add_integer ( "ffmpeg-workaround-bugs", 0, NULL,
+ "workaround bugs", "0-99, seems to be for msmpeg v3\n" );
#endif
- ADD_BOOL( "ffmpeg-hurry-up", 0, NULL, "hurry up", HURRY_UP_LONGTEXT )
-
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( "ffmpeg video decoder((MS)MPEG4,SVQ1,H263)" )
- ADD_CAPABILITY( DECODER, 70 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( vdec_getfunctions )( &p_module->p_functions->dec );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
+ add_bool( "ffmpeg-hurry-up", 0, NULL, "hurry up", HURRY_UP_LONGTEXT );
+ set_description( _("ffmpeg video decoder((MS)MPEG4,SVQ1,H263)") );
+ set_capability( "decoder", 70 );
+ set_callbacks( OpenDecoder, NULL );
+vlc_module_end();
/*****************************************************************************
- * decoder_Probe: probe the decoder and return score
+ * OpenDecoder: probe the decoder and return score
*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
-static int decoder_Probe( vlc_fourcc_t *pi_type )
+static int OpenDecoder( vlc_object_t *p_this )
{
- return( ffmpeg_GetFfmpegCodec( *pi_type, NULL, NULL ) ? 0 : -1 );
+ decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
+
+ if( ffmpeg_GetFfmpegCodec( p_fifo->i_fourcc, NULL, NULL ) )
+ {
+ p_fifo->pf_run = RunDecoder;
+ return VLC_SUCCESS;
+ }
+
+ return VLC_EGENERIC;
}
/*****************************************************************************
- * decoder_Run: this function is called just after the thread is created
+ * RunDecoder: this function is called just after the thread is created
*****************************************************************************/
-static int decoder_Run ( decoder_fifo_t * p_fifo )
+static int RunDecoder( decoder_fifo_t *p_fifo )
{
videodec_thread_t *p_vdec;
int b_error;
-
+
if ( !(p_vdec = (videodec_thread_t*)malloc( sizeof(videodec_thread_t))) )
{
msg_Err( p_fifo, "out of memory" );
/*****************************************************************************
* InitThread: initialize vdec output thread
*****************************************************************************
- * This function is called from decoder_Run and performs the second step
+ * This function is called from RunDecoderoder and performs the second step
* of the initialization. It returns 0 on success. Note that the thread's
* flag are not modified inside this function.
*****************************************************************************/
* clone.c : Clone video plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: clone.c,v 1.8 2002/07/20 18:01:42 sam Exp $
+ * $Id: clone.c,v 1.9 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include "filter_common.h"
/*****************************************************************************
- * Capabilities defined in the other files.
+ * Local prototypes
*****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list );
+static int Create ( vlc_object_t * );
+static void Destroy ( vlc_object_t * );
+
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static void Render ( vout_thread_t *, picture_t * );
+
+static void RemoveAllVout ( vout_thread_t *p_vout );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
#define COUNT_TEXT N_("Number of clones")
#define COUNT_LONGTEXT N_("Select the number of video windows in which to "\
"clone the video")
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_INTEGER ( "clone-count", 2, NULL, COUNT_TEXT, COUNT_LONGTEXT )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("image clone video module") )
- /* Capability score set to 0 because we don't want to be spawned
- * as a video output unless explicitly requested to */
- ADD_CAPABILITY( VOUT_FILTER, 0 )
- ADD_SHORTCUT( "clone" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- vout_getfunctions( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_integer( "clone-count", 2, NULL, COUNT_TEXT, COUNT_LONGTEXT );
+ set_description( _("image clone video module") );
+ set_capability( "video filter", 0 );
+ add_shortcut( "clone" );
+ set_callbacks( Create, Destroy );
+vlc_module_end();
/*****************************************************************************
* vout_sys_t: Clone video output method descriptor
};
/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static int vout_Create ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static int vout_Manage ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
-
-static void RemoveAllVout ( vout_thread_t *p_vout );
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocates Clone video thread output method
+ * Create: allocates Clone video thread output method
*****************************************************************************
* This function allocates and initializes a Clone vout method.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
+static int Create( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
/* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
return( 1 );
}
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = NULL;
+ p_vout->pf_render = Render;
+ p_vout->pf_display = NULL;
+
/* Look what method was requested */
p_vout->p_sys->i_clones = config_GetInt( p_vout, "clone-count" );
}
/*****************************************************************************
- * vout_Init: initialize Clone video thread output method
+ * Init: initialize Clone video thread output method
*****************************************************************************/
-static int vout_Init( vout_thread_t *p_vout )
+static int Init( vout_thread_t *p_vout )
{
int i_index, i_vout;
picture_t *p_pic;
}
/*****************************************************************************
- * vout_End: terminate Clone video thread output method
+ * End: terminate Clone video thread output method
*****************************************************************************/
-static void vout_End( vout_thread_t *p_vout )
+static void End( vout_thread_t *p_vout )
{
int i_index;
}
/*****************************************************************************
- * vout_Destroy: destroy Clone video thread output method
+ * Destroy: destroy Clone video thread output method
*****************************************************************************
* Terminate an output method created by CloneCreateOutputMethod
*****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
+static void Destroy( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
RemoveAllVout( p_vout );
free( p_vout->p_sys->pp_vout );
}
/*****************************************************************************
- * vout_Manage: handle Clone events
- *****************************************************************************
- * This function should be called regularly by video output thread. It manages
- * console events. It returns a non null value on error.
- *****************************************************************************/
-static int vout_Manage( vout_thread_t *p_vout )
-{
- return( 0 );
-}
-
-/*****************************************************************************
- * vout_Render: displays previously rendered output
+ * Render: displays previously rendered output
*****************************************************************************
* This function send the currently rendered image to Clone image, waits
* until it is displayed and switch the two rendering buffers, preparing next
* frame.
*****************************************************************************/
-static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
+static void Render( vout_thread_t *p_vout, picture_t *p_pic )
{
picture_t *p_outpic = NULL;
int i_vout, i_plane;
}
}
-/*****************************************************************************
- * vout_Display: displays previously rendered output
- *****************************************************************************
- * This function send the currently rendered image to Invert image, waits
- * until it is displayed and switch the two rendering buffers, preparing next
- * frame.
- *****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
-}
-
/*****************************************************************************
* RemoveAllVout: destroy all the child video output threads
*****************************************************************************/
* crop.c : Crop video plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: crop.c,v 1.5 2002/07/23 00:39:17 sam Exp $
+ * $Id: crop.c,v 1.6 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include "filter_common.h"
/*****************************************************************************
- * Capabilities defined in the other files.
+ * Local prototypes
*****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list );
+static int Create ( vlc_object_t * );
+static void Destroy ( vlc_object_t * );
+
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static int Manage ( vout_thread_t * );
+static void Render ( vout_thread_t *, picture_t * );
+
+static void UpdateStats ( vout_thread_t *, picture_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
#define GEOMETRY_TEXT N_("Crop geometry")
#define GEOMETRY_LONGTEXT N_("Set the geometry of the zone to crop")
#define AUTOCROP_TEXT N_("Automatic cropping")
#define AUTOCROP_LONGTEXT N_("Activate automatic black border cropping")
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_STRING ( "crop-geometry", NULL, NULL, GEOMETRY_TEXT, GEOMETRY_LONGTEXT )
-ADD_BOOL ( "autocrop", 0, NULL, AUTOCROP_TEXT, AUTOCROP_LONGTEXT )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("image crop video module") )
- /* Capability score set to 0 because we don't want to be spawned
- * as a video output unless explicitly requested to */
- ADD_CAPABILITY( VOUT_FILTER, 0 )
- ADD_SHORTCUT( "crop" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- vout_getfunctions( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_string( "crop-geometry", NULL, NULL, GEOMETRY_TEXT, GEOMETRY_LONGTEXT );
+ add_bool( "autocrop", 0, NULL, AUTOCROP_TEXT, AUTOCROP_LONGTEXT );
+ set_description( _("image crop video module") );
+ set_capability( "video filter", 0 );
+ add_shortcut( "crop" );
+ set_callbacks( Create, Destroy );
+vlc_module_end();
/*****************************************************************************
* vout_sys_t: Crop video output method descriptor
};
/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static int vout_Create ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static int vout_Manage ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
-
-static void UpdateStats ( vout_thread_t *, picture_t * );
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocates Crop video thread output method
+ * Create: allocates Crop video thread output method
*****************************************************************************
* This function allocates and initializes a Crop vout method.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
+static int Create( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
/* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
return 1;
}
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = Manage;
+ p_vout->pf_render = Render;
+ p_vout->pf_display = NULL;
+
return 0;
}
/*****************************************************************************
- * vout_Init: initialize Crop video thread output method
+ * Init: initialize Crop video thread output method
*****************************************************************************/
-static int vout_Init( vout_thread_t *p_vout )
+static int Init( vout_thread_t *p_vout )
{
int i_index;
char *psz_var;
}
/*****************************************************************************
- * vout_End: terminate Crop video thread output method
+ * End: terminate Crop video thread output method
*****************************************************************************/
-static void vout_End( vout_thread_t *p_vout )
+static void End( vout_thread_t *p_vout )
{
int i_index;
}
/*****************************************************************************
- * vout_Destroy: destroy Crop video thread output method
+ * Destroy: destroy Crop video thread output method
*****************************************************************************
* Terminate an output method created by CropCreateOutputMethod
*****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
+static void Destroy( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
vout_DestroyThread( p_vout->p_sys->p_vout );
free( p_vout->p_sys );
}
/*****************************************************************************
- * vout_Manage: handle Crop events
+ * Manage: handle Crop events
*****************************************************************************
* This function should be called regularly by video output thread. It manages
* console events. It returns a non null value on error.
*****************************************************************************/
-static int vout_Manage( vout_thread_t *p_vout )
+static int Manage( vout_thread_t *p_vout )
{
if( !p_vout->p_sys->b_changed )
{
}
/*****************************************************************************
- * vout_Render: display previously rendered output
+ * Render: display previously rendered output
*****************************************************************************
* This function sends the currently rendered image to Crop image, waits
* until it is displayed and switches the two rendering buffers, preparing next
* frame.
*****************************************************************************/
-static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
+static void Render( vout_thread_t *p_vout, picture_t *p_pic )
{
picture_t *p_outpic = NULL;
int i_plane;
UpdateStats( p_vout, p_pic );
}
-/*****************************************************************************
- * vout_Display: displays previously rendered output
- *****************************************************************************
- * This function send the currently rendered image to Invert image, waits
- * until it is displayed and switch the two rendering buffers, preparing next
- * frame.
- *****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
-}
-
static void UpdateStats( vout_thread_t *p_vout, picture_t *p_pic )
{
u8 *p_in = p_pic->p[0].p_pixels;
* deinterlace.c : deinterlacer plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: deinterlace.c,v 1.19 2002/07/23 00:39:17 sam Exp $
+ * $Id: deinterlace.c,v 1.20 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#define DEINTERLACE_LINEAR 5
/*****************************************************************************
- * Capabilities defined in the other files.
+ * Local protypes
*****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list );
+static int Create ( vlc_object_t * );
+static void Destroy ( vlc_object_t * );
+
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static void Render ( vout_thread_t *, picture_t * );
static void RenderBob ( vout_thread_t *, picture_t *, picture_t *, int );
static void RenderMean ( vout_thread_t *, picture_t *, picture_t * );
static void Merge ( void *, const void *, const void *, size_t );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
#define MODE_TEXT N_("Deinterlace mode")
#define MODE_LONGTEXT N_("one of \"discard\", \"blend\", \"mean\", \"bob\" or \"linear\"")
static char *mode_list[] = { "discard", "blend", "mean", "bob", "linear", NULL };
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_STRING_FROM_LIST ( "deinterlace-mode", "discard", mode_list, NULL, \
- MODE_TEXT, MODE_LONGTEXT )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("deinterlacing module") )
- /* Capability score set to 0 because we don't want to be spawned
- * as a video output unless explicitly requested to */
- ADD_CAPABILITY( VOUT_FILTER, 0 )
- ADD_SHORTCUT( "deinterlace" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- vout_getfunctions( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_string_from_list( "deinterlace-mode", "discard", mode_list, NULL,
+ MODE_TEXT, MODE_LONGTEXT );
+ set_description( _("deinterlacing module") );
+ set_capability( "video filter", 0 );
+ add_shortcut( "deinterlace" );
+ set_callbacks( Create, Destroy );
+vlc_module_end();
/*****************************************************************************
* vout_sys_t: Deinterlace video output method descriptor
};
/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static int vout_Create ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static int vout_Manage ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocates Deinterlace video thread output method
+ * Create: allocates Deinterlace video thread output method
*****************************************************************************
* This function allocates and initializes a Deinterlace vout method.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
-{
+static int Create( vlc_object_t *p_this )
+{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
char *psz_method;
/* Allocate structure */
return 1;
}
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = NULL;
+ p_vout->pf_render = Render;
+ p_vout->pf_display = NULL;
+
p_vout->p_sys->i_mode = DEINTERLACE_DISCARD;
p_vout->p_sys->b_double_rate = 0;
p_vout->p_sys->last_date = 0;
}
/*****************************************************************************
- * vout_Init: initialize Deinterlace video thread output method
+ * Init: initialize Deinterlace video thread output method
*****************************************************************************/
-static int vout_Init( vout_thread_t *p_vout )
+static int Init( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic;
}
/*****************************************************************************
- * vout_End: terminate Deinterlace video thread output method
+ * End: terminate Deinterlace video thread output method
*****************************************************************************/
-static void vout_End( vout_thread_t *p_vout )
+static void End( vout_thread_t *p_vout )
{
int i_index;
}
/*****************************************************************************
- * vout_Destroy: destroy Deinterlace video thread output method
+ * Destroy: destroy Deinterlace video thread output method
*****************************************************************************
* Terminate an output method created by DeinterlaceCreateOutputMethod
*****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
+static void Destroy( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
vout_DestroyThread( p_vout->p_sys->p_vout );
free( p_vout->p_sys );
}
/*****************************************************************************
- * vout_Manage: handle Deinterlace events
- *****************************************************************************
- * This function should be called regularly by video output thread. It manages
- * console events. It returns a non null value on error.
- *****************************************************************************/
-static int vout_Manage( vout_thread_t *p_vout )
-{
- return 0;
-}
-
-/*****************************************************************************
- * vout_Render: displays previously rendered output
+ * Render: displays previously rendered output
*****************************************************************************
* This function send the currently rendered image to Deinterlace image,
* waits until it is displayed and switch the two rendering buffers, preparing
* next frame.
*****************************************************************************/
-static void vout_Render ( vout_thread_t *p_vout, picture_t *p_pic )
+static void Render ( vout_thread_t *p_vout, picture_t *p_pic )
{
picture_t *pp_outpic[2];
}
}
-/*****************************************************************************
- * vout_Display: displays previously rendered output
- *****************************************************************************
- * This function does nothing, since all the rendering was already done.
- *****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
-}
-
/*****************************************************************************
* RenderBob: renders a bob picture
*****************************************************************************/
* distort.c : Misc video effects plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: distort.c,v 1.18 2002/07/23 20:16:36 sam Exp $
+ * $Id: distort.c,v 1.19 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#define DISTORT_MODE_RIPPLE 2
/*****************************************************************************
- * Capabilities defined in the other files.
+ * Local prototypes
*****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list );
+static int Create ( vlc_object_t * );
+static void Destroy ( vlc_object_t * );
+
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static void Render ( vout_thread_t *, picture_t * );
+
+static void DistortWave ( vout_thread_t *, picture_t *, picture_t * );
+static void DistortRipple ( vout_thread_t *, picture_t *, picture_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
#define MODE_TEXT N_("Distort mode")
#define MODE_LONGTEXT N_("one of \"wave\" and \"ripple\"")
static char *mode_list[] = { "wave", "ripple", NULL };
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_STRING_FROM_LIST( "distort-mode", "wave", mode_list, NULL, MODE_TEXT, MODE_LONGTEXT )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("miscellaneous video effects module") )
- /* Capability score set to 0 because we don't want to be spawned
- * as a video output unless explicitly requested to */
- ADD_CAPABILITY( VOUT_FILTER, 0 )
- ADD_SHORTCUT( "distort" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- vout_getfunctions( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_string_from_list( "distort-mode", "wave", mode_list, NULL,
+ MODE_TEXT, MODE_LONGTEXT );
+ set_description( _("miscellaneous video effects module") );
+ set_capability( "video filter", 0 );
+ add_shortcut( "distort" );
+ set_callbacks( Create, Destroy );
+vlc_module_end();
/*****************************************************************************
* vout_sys_t: Distort video output method descriptor
};
/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static int vout_Create ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static int vout_Manage ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
-
-static void DistortWave ( vout_thread_t *, picture_t *, picture_t * );
-static void DistortRipple ( vout_thread_t *, picture_t *, picture_t * );
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocates Distort video thread output method
+ * Create: allocates Distort video thread output method
*****************************************************************************
* This function allocates and initializes a Distort vout method.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
+static int Create( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
char *psz_method, *psz_method_tmp;
/* Allocate structure */
msg_Err( p_vout, "out of memory" );
return( 1 );
}
+
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = NULL;
+ p_vout->pf_render = Render;
+ p_vout->pf_display = NULL;
+
p_vout->p_sys->i_mode = 0;
/* Look what method was requested from command line*/
if( !(psz_method = psz_method_tmp = config_GetPsz( p_vout, "filter" )) )
}
/*****************************************************************************
- * vout_Init: initialize Distort video thread output method
+ * Init: initialize Distort video thread output method
*****************************************************************************/
-static int vout_Init( vout_thread_t *p_vout )
+static int Init( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic;
}
/*****************************************************************************
- * vout_End: terminate Distort video thread output method
+ * End: terminate Distort video thread output method
*****************************************************************************/
-static void vout_End( vout_thread_t *p_vout )
+static void End( vout_thread_t *p_vout )
{
int i_index;
}
/*****************************************************************************
- * vout_Destroy: destroy Distort video thread output method
+ * Destroy: destroy Distort video thread output method
*****************************************************************************
* Terminate an output method created by DistortCreateOutputMethod
*****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
+static void Destroy( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
vout_DestroyThread( p_vout->p_sys->p_vout );
free( p_vout->p_sys );
}
/*****************************************************************************
- * vout_Manage: handle Distort events
- *****************************************************************************
- * This function should be called regularly by video output thread. It manages
- * console events. It returns a non null value on error.
- *****************************************************************************/
-static int vout_Manage( vout_thread_t *p_vout )
-{
- return( 0 );
-}
-
-/*****************************************************************************
- * vout_Render: displays previously rendered output
+ * Render: displays previously rendered output
*****************************************************************************
* This function send the currently rendered image to Distort image, waits
* until it is displayed and switch the two rendering buffers, preparing next
* frame.
*****************************************************************************/
-static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
+static void Render( vout_thread_t *p_vout, picture_t *p_pic )
{
picture_t *p_outpic;
vout_DisplayPicture( p_vout->p_sys->p_vout, p_outpic );
}
-/*****************************************************************************
- * vout_Display: displays previously rendered output
- *****************************************************************************
- * This function send the currently rendered image to Invert image, waits
- * until it is displayed and switch the two rendering buffers, preparing next
- * frame.
- *****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
-}
-
/*****************************************************************************
* DistortWave: draw a wave effect on the picture
*****************************************************************************/
* invert.c : Invert video plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: invert.c,v 1.15 2002/07/20 18:01:42 sam Exp $
+ * $Id: invert.c,v 1.16 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include "filter_common.h"
/*****************************************************************************
- * Capabilities defined in the other files.
+ * Local prototypes
*****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list );
+static int Create ( vlc_object_t * );
+static void Destroy ( vlc_object_t * );
+
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static void Render ( vout_thread_t *, picture_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("invert video module") )
- /* Capability score set to 0 because we don't want to be spawned
- * as a video output unless explicitly requested to */
- ADD_CAPABILITY( VOUT_FILTER, 0 )
- ADD_SHORTCUT( "invert" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- vout_getfunctions( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("invert video module") );
+ set_capability( "video filter", 0 );
+ add_shortcut( "invert" );
+ set_callbacks( Create, Destroy );
+vlc_module_end();
/*****************************************************************************
* vout_sys_t: Invert video output method descriptor
};
/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static int vout_Create ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static int vout_Manage ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocates Invert video thread output method
+ * Create: allocates Invert video thread output method
*****************************************************************************
* This function allocates and initializes a Invert vout method.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
+static int Create( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
/* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
return( 1 );
}
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = NULL;
+ p_vout->pf_render = Render;
+ p_vout->pf_display = NULL;
+
return( 0 );
}
/*****************************************************************************
- * vout_Init: initialize Invert video thread output method
+ * Init: initialize Invert video thread output method
*****************************************************************************/
-static int vout_Init( vout_thread_t *p_vout )
+static int Init( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic;
}
/*****************************************************************************
- * vout_End: terminate Invert video thread output method
+ * End: terminate Invert video thread output method
*****************************************************************************/
-static void vout_End( vout_thread_t *p_vout )
+static void End( vout_thread_t *p_vout )
{
int i_index;
}
/*****************************************************************************
- * vout_Destroy: destroy Invert video thread output method
+ * Destroy: destroy Invert video thread output method
*****************************************************************************
* Terminate an output method created by InvertCreateOutputMethod
*****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
-{
+static void Destroy( vlc_object_t *p_this )
+{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
vout_DestroyThread( p_vout->p_sys->p_vout );
free( p_vout->p_sys );
}
/*****************************************************************************
- * vout_Manage: handle Invert events
- *****************************************************************************
- * This function should be called regularly by video output thread. It manages
- * console events. It returns a non null value on error.
- *****************************************************************************/
-static int vout_Manage( vout_thread_t *p_vout )
-{
- return( 0 );
-}
-
-/*****************************************************************************
- * vout_Render: displays previously rendered output
+ * Render: displays previously rendered output
*****************************************************************************
* This function send the currently rendered image to Invert image, waits
* until it is displayed and switch the two rendering buffers, preparing next
* frame.
*****************************************************************************/
-static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
+static void Render( vout_thread_t *p_vout, picture_t *p_pic )
{
picture_t *p_outpic;
int i_index;
vout_DisplayPicture( p_vout->p_sys->p_vout, p_outpic );
}
-/*****************************************************************************
- * vout_Display: displays previously rendered output
- *****************************************************************************
- * This function send the currently rendered image to Invert image, waits
- * until it is displayed and switch the two rendering buffers, preparing next
- * frame.
- *****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
-}
-
* transform.c : transform image plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: transform.c,v 1.16 2002/07/20 18:01:42 sam Exp $
+ * $Id: transform.c,v 1.17 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#define TRANSFORM_MODE_270 5
/*****************************************************************************
- * Capabilities defined in the other files.
+ * Local prototypes
*****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list );
+static int Create ( vlc_object_t * );
+static void Destroy ( vlc_object_t * );
+
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static void Render ( vout_thread_t *, picture_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
#define TYPE_TEXT N_("Transform type")
#define TYPE_LONGTEXT N_("One of '90', '180', '270', 'hflip' and 'vflip'")
static char *type_list[] = { "90", "180", "270", "hflip", "vflip", NULL };
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_STRING_FROM_LIST("transform-type", "90", type_list, NULL, TYPE_TEXT, TYPE_LONGTEXT)
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("image transformation module") )
- /* Capability score set to 0 because we don't want to be spawned
- * as a video output unless explicitly requested to */
- ADD_CAPABILITY( VOUT_FILTER, 0 )
- ADD_SHORTCUT( "transform" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- vout_getfunctions( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_string_from_list( "transform-type", "90", type_list, NULL,
+ TYPE_TEXT, TYPE_LONGTEXT);
+ set_description( _("image transformation module") );
+ set_capability( "video filter", 0 );
+ add_shortcut( "transform" );
+ set_callbacks( Create, Destroy );
+vlc_module_end();
/*****************************************************************************
* vout_sys_t: Transform video output method descriptor
};
/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static int vout_Create ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static int vout_Manage ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocates Transform video thread output method
+ * Create: allocates Transform video thread output method
*****************************************************************************
* This function allocates and initializes a Transform vout method.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
+static int Create( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
char *psz_method;
/* Allocate structure */
return( 1 );
}
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = NULL;
+ p_vout->pf_render = Render;
+ p_vout->pf_display = NULL;
+
/* Look what method was requested */
psz_method = config_GetPsz( p_vout, "transform-type" );
}
/*****************************************************************************
- * vout_Init: initialize Transform video thread output method
+ * Init: initialize Transform video thread output method
*****************************************************************************/
-static int vout_Init( vout_thread_t *p_vout )
+static int Init( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic;
}
/*****************************************************************************
- * vout_End: terminate Transform video thread output method
+ * End: terminate Transform video thread output method
*****************************************************************************/
-static void vout_End( vout_thread_t *p_vout )
+static void End( vout_thread_t *p_vout )
{
int i_index;
}
/*****************************************************************************
- * vout_Destroy: destroy Transform video thread output method
+ * Destroy: destroy Transform video thread output method
*****************************************************************************
* Terminate an output method created by TransformCreateOutputMethod
*****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
+static void Destroy( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
vout_DestroyThread( p_vout->p_sys->p_vout );
free( p_vout->p_sys );
}
/*****************************************************************************
- * vout_Manage: handle Transform events
- *****************************************************************************
- * This function should be called regularly by video output thread. It manages
- * console events. It returns a non null value on error.
- *****************************************************************************/
-static int vout_Manage( vout_thread_t *p_vout )
-{
- return( 0 );
-}
-
-/*****************************************************************************
- * vout_Render: displays previously rendered output
+ * Render: displays previously rendered output
*****************************************************************************
* This function send the currently rendered image to Transform image, waits
* until it is displayed and switch the two rendering buffers, preparing next
* frame.
*****************************************************************************/
-static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
+static void Render( vout_thread_t *p_vout, picture_t *p_pic )
{
picture_t *p_outpic;
int i_index;
vout_DisplayPicture( p_vout->p_sys->p_vout, p_outpic );
}
-/*****************************************************************************
- * vout_Display: displays previously rendered output
- *****************************************************************************
- * This function send the currently rendered image to Invert image, waits
- * until it is displayed and switch the two rendering buffers, preparing next
- * frame.
- *****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
-}
* wall.c : Wall video plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: wall.c,v 1.24 2002/07/20 18:01:42 sam Exp $
+ * $Id: wall.c,v 1.25 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include "filter_common.h"
/*****************************************************************************
- * Capabilities defined in the other files.
+ * Local prototypes
*****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list );
+static int Create ( vlc_object_t * );
+static void Destroy ( vlc_object_t * );
+
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static void Render ( vout_thread_t *, picture_t * );
+
+static void RemoveAllVout ( vout_thread_t *p_vout );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
#define COLS_TEXT N_("Number of columns")
#define COLS_LONGTEXT N_("Select the number of horizontal videowindows in " \
#define ACTIVE_LONGTEXT N_("comma separated list of active windows, " \
"defaults to all")
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_INTEGER ( "wall-cols", 3, NULL, COLS_TEXT, COLS_LONGTEXT )
-ADD_INTEGER ( "wall-rows", 3, NULL, ROWS_TEXT, ROWS_LONGTEXT )
-ADD_STRING ( "wall-active", NULL, NULL, ACTIVE_TEXT, ACTIVE_LONGTEXT )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("image wall video module") )
- /* Capability score set to 0 because we don't want to be spawned
- * as a video output unless explicitly requested to */
- ADD_CAPABILITY( VOUT_FILTER, 0 )
- ADD_SHORTCUT( "wall" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- vout_getfunctions( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_integer( "wall-cols", 3, NULL, COLS_TEXT, COLS_LONGTEXT );
+ add_integer( "wall-rows", 3, NULL, ROWS_TEXT, ROWS_LONGTEXT );
+ add_string( "wall-active", NULL, NULL, ACTIVE_TEXT, ACTIVE_LONGTEXT );
+ set_description( _("image wall video module") );
+ set_capability( "video filter", 0 );
+ add_shortcut( "wall" );
+ set_callbacks( Create, Destroy );
+vlc_module_end();
/*****************************************************************************
* vout_sys_t: Wall video output method descriptor
};
/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static int vout_Create ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static int vout_Manage ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
-
-static void RemoveAllVout ( vout_thread_t *p_vout );
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocates Wall video thread output method
+ * Create: allocates Wall video thread output method
*****************************************************************************
* This function allocates and initializes a Wall vout method.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
+static int Create( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
char *psz_method, *psz_tmp, *psz_method_tmp;
int i_vout;
return( 1 );
}
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = NULL;
+ p_vout->pf_render = Render;
+ p_vout->pf_display = NULL;
+
/* Look what method was requested */
p_vout->p_sys->i_col = config_GetInt( p_vout, "wall-cols" );
p_vout->p_sys->i_row = config_GetInt( p_vout, "wall-rows" );
}
/*****************************************************************************
- * vout_Init: initialize Wall video thread output method
+ * Init: initialize Wall video thread output method
*****************************************************************************/
-static int vout_Init( vout_thread_t *p_vout )
+static int Init( vout_thread_t *p_vout )
{
int i_index, i_row, i_col, i_width, i_height;
picture_t *p_pic;
}
/*****************************************************************************
- * vout_End: terminate Wall video thread output method
+ * End: terminate Wall video thread output method
*****************************************************************************/
-static void vout_End( vout_thread_t *p_vout )
+static void End( vout_thread_t *p_vout )
{
int i_index;
}
/*****************************************************************************
- * vout_Destroy: destroy Wall video thread output method
+ * Destroy: destroy Wall video thread output method
*****************************************************************************
* Terminate an output method created by WallCreateOutputMethod
*****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
+static void Destroy( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
RemoveAllVout( p_vout );
free( p_vout->p_sys->pp_vout );
}
/*****************************************************************************
- * vout_Manage: handle Wall events
- *****************************************************************************
- * This function should be called regularly by video output thread. It manages
- * console events. It returns a non null value on error.
- *****************************************************************************/
-static int vout_Manage( vout_thread_t *p_vout )
-{
- return( 0 );
-}
-
-/*****************************************************************************
- * vout_Render: displays previously rendered output
+ * Render: displays previously rendered output
*****************************************************************************
* This function send the currently rendered image to Wall image, waits
* until it is displayed and switch the two rendering buffers, preparing next
* frame.
*****************************************************************************/
-static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
+static void Render( vout_thread_t *p_vout, picture_t *p_pic )
{
picture_t *p_outpic = NULL;
int i_col, i_row, i_vout, i_plane;
}
}
-/*****************************************************************************
- * vout_Display: displays previously rendered output
- *****************************************************************************
- * This function send the currently rendered image to Invert image, waits
- * until it is displayed and switch the two rendering buffers, preparing next
- * frame.
- *****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
-}
-
/*****************************************************************************
* RemoveAllVout: destroy all the child video output threads
*****************************************************************************/
* scope.c : Scope effect module
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: scope.c,v 1.10 2002/07/23 00:39:17 sam Exp $
+ * $Id: scope.c,v 1.11 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*****************************************************************************/
struct aout_sys_t
{
- aout_thread_t aout;
aout_fifo_t *p_aout_fifo;
+ aout_thread_t *p_aout;
vout_thread_t *p_vout;
};
/*****************************************************************************
- * Local prototypes.
+ * Local prototypes
*****************************************************************************/
-static void aout_getfunctions( function_list_t * p_function_list );
+static int Open ( vlc_object_t * );
+static void Close ( vlc_object_t * );
-static int aout_Open ( aout_thread_t *p_aout );
-static int aout_SetFormat ( aout_thread_t *p_aout );
-static int aout_GetBufInfo ( aout_thread_t *p_aout, int i_buffer_info );
-static void aout_Play ( aout_thread_t *p_aout,
- byte_t *buffer, int i_size );
-static void aout_Close ( aout_thread_t *p_aout );
+static int SetFormat ( aout_thread_t * );
+static int GetBufInfo ( aout_thread_t *, int );
+static void Play ( aout_thread_t *, byte_t *, int );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("scope effect module") )
- ADD_CAPABILITY( AOUT, 0 )
- ADD_SHORTCUT( "scope" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- aout_getfunctions( &p_module->p_functions->aout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void aout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.aout.pf_open = aout_Open;
- p_function_list->functions.aout.pf_setformat = aout_SetFormat;
- p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
- p_function_list->functions.aout.pf_play = aout_Play;
- p_function_list->functions.aout.pf_close = aout_Close;
-}
+vlc_module_begin();
+ set_description( _("scope effect") );
+ set_capability( "audio output", 0 );
+ set_callbacks( Open, Close );
+ add_shortcut( "scope" );
+vlc_module_end();
/*****************************************************************************
- * aout_Open: open a scope effect plugin
+ * Open: open a scope effect plugin
*****************************************************************************/
-static int aout_Open( aout_thread_t *p_aout )
+static int Open( vlc_object_t *p_this )
{
+ aout_thread_t *p_aout = (aout_thread_t *)p_this;
char *psz_method;
/* Allocate structure */
}
/* Open audio output */
- p_aout->p_sys->aout.i_format = p_aout->i_format;
- p_aout->p_sys->aout.i_rate = p_aout->i_rate;
- p_aout->p_sys->aout.i_channels = p_aout->i_channels;
-
- p_aout->p_sys->aout.p_module =
- module_Need( p_aout, MODULE_CAPABILITY_AOUT,
- "", (void *)&p_aout->p_sys->aout );
- if( p_aout->p_sys->aout.p_module == NULL )
+ p_aout->p_sys->p_aout = vlc_object_create( p_aout, VLC_OBJECT_AOUT );
+
+ p_aout->p_sys->p_aout->i_format = p_aout->i_format;
+ p_aout->p_sys->p_aout->i_rate = p_aout->i_rate;
+ p_aout->p_sys->p_aout->i_channels = p_aout->i_channels;
+
+ p_aout->p_sys->p_aout->p_module =
+ module_Need( p_aout->p_sys->p_aout, "audio output", "" );
+ if( p_aout->p_sys->p_aout->p_module == NULL )
{
msg_Err( p_aout, "no suitable aout module" );
+ vlc_object_destroy( p_aout->p_sys->p_aout );
vout_DestroyThread( p_aout->p_sys->p_vout );
free( p_aout->p_sys );
return -1;
}
-#define aout_functions p_aout->p_sys->aout.p_module->p_functions->aout.functions.aout
- p_aout->p_sys->aout.pf_open = aout_functions.pf_open;
- p_aout->p_sys->aout.pf_setformat = aout_functions.pf_setformat;
- p_aout->p_sys->aout.pf_getbufinfo = aout_functions.pf_getbufinfo;
- p_aout->p_sys->aout.pf_play = aout_functions.pf_play;
- p_aout->p_sys->aout.pf_close = aout_functions.pf_close;
-#undef aout_functions
-
+ vlc_object_attach( p_aout->p_sys->p_aout, p_aout );
+
+ p_aout->pf_setformat = SetFormat;
+ p_aout->pf_getbufinfo = GetBufInfo;
+ p_aout->pf_play = Play;
+
return( 0 );
}
/*****************************************************************************
- * aout_SetFormat: set the output format
+ * SetFormat: set the output format
*****************************************************************************/
-static int aout_SetFormat( aout_thread_t *p_aout )
+static int SetFormat( aout_thread_t *p_aout )
{
int i_ret;
/* Force the output method */
- p_aout->p_sys->aout.i_format = p_aout->i_format;
- p_aout->p_sys->aout.i_channels = p_aout->i_channels;
- p_aout->p_sys->aout.i_rate = p_aout->i_rate;
+ p_aout->p_sys->p_aout->i_format = p_aout->i_format;
+ p_aout->p_sys->p_aout->i_channels = p_aout->i_channels;
+ p_aout->p_sys->p_aout->i_rate = p_aout->i_rate;
/*
* Initialize audio device
*/
- i_ret = p_aout->p_sys->aout.pf_setformat( &p_aout->p_sys->aout );
+ i_ret = p_aout->p_sys->p_aout->pf_setformat( p_aout->p_sys->p_aout );
if( i_ret )
{
return i_ret;
}
- if( p_aout->p_sys->aout.i_format != p_aout->i_format
- || p_aout->p_sys->aout.i_channels != p_aout->i_channels )
+ if( p_aout->p_sys->p_aout->i_format != p_aout->i_format
+ || p_aout->p_sys->p_aout->i_channels != p_aout->i_channels )
{
msg_Err( p_aout, "plugin is not very cooperative" );
return 0;
}
- p_aout->i_channels = p_aout->p_sys->aout.i_channels;
- p_aout->i_format = p_aout->p_sys->aout.i_format;
- p_aout->i_rate = p_aout->p_sys->aout.i_rate;
+ p_aout->i_channels = p_aout->p_sys->p_aout->i_channels;
+ p_aout->i_format = p_aout->p_sys->p_aout->i_format;
+ p_aout->i_rate = p_aout->p_sys->p_aout->i_rate;
return 0;
}
/*****************************************************************************
- * aout_GetBufInfo: buffer status query
+ * GetBufInfo: buffer status query
*****************************************************************************/
-static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
+static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
{
- return p_aout->p_sys->aout.pf_getbufinfo( &p_aout->p_sys->aout,
- i_buffer_limit );
+ return p_aout->p_sys->p_aout->pf_getbufinfo( p_aout->p_sys->p_aout,
+ i_buffer_limit );
}
/*****************************************************************************
- * aout_Play: play a sound samples buffer
+ * Play: play a sound samples buffer
*****************************************************************************
* This function writes a buffer of i_length bytes in the socket
*****************************************************************************/
-static void aout_Play( aout_thread_t *p_aout, byte_t *p_buffer, int i_size )
+static void Play( aout_thread_t *p_aout, byte_t *p_buffer, int i_size )
{
picture_t *p_outpic;
int i_index, i_image;
u16 *p_sample;
/* Play the real sound */
- p_aout->p_sys->aout.pf_play( &p_aout->p_sys->aout, p_buffer, i_size );
+ p_aout->p_sys->p_aout->pf_play( p_aout->p_sys->p_aout, p_buffer, i_size );
for( i_image = 0; (i_image + 1) * SCOPE_WIDTH * 8 < i_size ; i_image++ )
{
}
/*****************************************************************************
- * aout_Close: close the Esound socket
+ * Close: close the plugin
*****************************************************************************/
-static void aout_Close( aout_thread_t *p_aout )
+static void Close( vlc_object_t *p_this )
{
- p_aout->p_sys->aout.pf_close( &p_aout->p_sys->aout );
- module_Unneed( p_aout->p_sys->aout.p_module );
+ aout_thread_t *p_aout = (aout_thread_t *)p_this;
+
+ /* Kill audio output */
+ module_Unneed( p_aout->p_sys->p_aout, p_aout->p_sys->p_aout->p_module );
+ vlc_object_detach_all( p_aout->p_sys->p_aout );
+ vlc_object_destroy( p_aout->p_sys->p_aout );
+
+ /* Kill video output */
vout_DestroyThread( p_aout->p_sys->p_vout );
+
free( p_aout->p_sys );
}
* ggi.c : GGI plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: ggi.c,v 1.24 2002/07/23 00:39:17 sam Exp $
+ * $Id: ggi.c,v 1.25 2002/07/31 20:56:51 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#include <vlc/vout.h>
/*****************************************************************************
- * Local prototypes.
+ * Local prototypes
*****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list );
+static int Create ( vlc_object_t * );
+static void Destroy ( vlc_object_t * );
-static int vout_Create ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static int vout_Manage ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static int Manage ( vout_thread_t * );
+static void Display ( vout_thread_t *, picture_t * );
static int OpenDisplay ( vout_thread_t * );
static void CloseDisplay ( vout_thread_t * );
static void SetPalette ( vout_thread_t *, u16 *, u16 *, u16 * );
/*****************************************************************************
- * Building configuration tree
+ * Module descriptor
*****************************************************************************/
#define DISPLAY_TEXT N_("X11 display name")
#define DISPLAY_LONGTEXT N_("Specify the X11 hardware display you want to use."\
"\nBy default vlc will use the value of the DISPLAY"\
" environment variable.")
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_STRING ( "ggi_display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( "General Graphics Interface video output" )
- ADD_CAPABILITY( VOUT, 30 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- vout_getfunctions( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_string( "ggi-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT );
+ set_description( "General Graphics Interface video output" );
+ set_capability( "video output", 30 );
+ set_callbacks( Create, Destroy );
+vlc_module_end();
/*****************************************************************************
* vout_sys_t: video output GGI method descriptor
};
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocate GGI video thread output method
+ * Create: allocate GGI video thread output method
*****************************************************************************
* This function allocate and initialize a GGI vout method. It uses some of the
* vout properties to choose the correct mode, and change them according to the
* mode actually used.
*****************************************************************************/
-int vout_Create( vout_thread_t *p_vout )
+static int Create( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
/* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
return( 1 );
}
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = Manage;
+ p_vout->pf_render = NULL;
+ p_vout->pf_display = Display;
+
return( 0 );
}
/*****************************************************************************
- * vout_Init: initialize GGI video thread output method
+ * Init: initialize GGI video thread output method
*****************************************************************************
* This function initialize the GGI display device.
*****************************************************************************/
-int vout_Init( vout_thread_t *p_vout )
+static int Init( vout_thread_t *p_vout )
{
#define p_b p_vout->p_sys->pp_buffer
int i_index;
}
/*****************************************************************************
- * vout_End: terminate GGI video thread output method
+ * End: terminate GGI video thread output method
*****************************************************************************
- * Terminate an output method created by vout_Create
+ * Terminate an output method created by Create
*****************************************************************************/
-void vout_End( vout_thread_t *p_vout )
+static void End( vout_thread_t *p_vout )
{
#define p_b p_vout->p_sys->pp_buffer
/* Release buffer */
}
/*****************************************************************************
- * vout_Destroy: destroy GGI video thread output method
+ * Destroy: destroy GGI video thread output method
*****************************************************************************
- * Terminate an output method created by vout_Create
+ * Terminate an output method created by Create
*****************************************************************************/
-void vout_Destroy( vout_thread_t *p_vout )
-{
+static void Destroy( vlc_object_t *p_this )
+{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
CloseDisplay( p_vout );
free( p_vout->p_sys );
}
/*****************************************************************************
- * vout_Manage: handle GGI events
+ * Manage: handle GGI events
*****************************************************************************
* This function should be called regularly by video output thread. It returns
* a non null value if an error occured.
*****************************************************************************/
-int vout_Manage( vout_thread_t *p_vout )
+static int Manage( vout_thread_t *p_vout )
{
struct timeval tv = { 0, 1000 }; /* 1 millisecond */
gii_event_mask mask;
}
/*****************************************************************************
- * vout_Render: displays previously rendered output
- *****************************************************************************/
-void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
-}
-
-/*****************************************************************************
- * vout_Display: displays previously rendered output
+ * Display: displays previously rendered output
*****************************************************************************/
-void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+static void Display( vout_thread_t *p_vout, picture_t *p_pic )
{
#define p_b p_vout->p_sys->pp_buffer
p_pic->p->p_pixels = p_b[ p_vout->p_sys->i_index ]->write;
* glide.c : 3dfx Glide plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: glide.c,v 1.17 2002/07/23 00:39:17 sam Exp $
+ * $Id: glide.c,v 1.18 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#define GLIDE_BYTES_PER_PIXEL 2
/*****************************************************************************
- * Local prototypes.
+ * Local prototypes
*****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list );
+static int Create ( vlc_object_t * );
+static void Destroy ( vlc_object_t * );
-static int vout_Create ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static int vout_Manage ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static int Manage ( vout_thread_t * );
+static void Display ( vout_thread_t *, picture_t * );
static int OpenDisplay ( vout_thread_t * );
static void CloseDisplay ( vout_thread_t * );
/*****************************************************************************
- * Building configuration tree
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("3dfx Glide module") )
- ADD_CAPABILITY( VOUT, 20 )
- ADD_SHORTCUT( "3dfx" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- vout_getfunctions( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("3dfx Glide module") );
+ set_capability( "video output", 20 );
+ add_shortcut( "3dfx" );
+ set_callbacks( Create, Destroy );
+vlc_module_end();
/*****************************************************************************
* vout_sys_t: Glide video output method descriptor
};
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( vout_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocates Glide video thread output method
+ * Create: allocates Glide video thread output method
*****************************************************************************
* This function allocates and initializes a Glide vout method.
*****************************************************************************/
-int vout_Create( vout_thread_t *p_vout )
+static int Create( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
/* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
return( 1 );
}
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = Manage;
+ p_vout->pf_render = NULL;
+ p_vout->pf_display = Display;
+
return( 0 );
}
/*****************************************************************************
- * vout_Init: initialize Glide video thread output method
+ * Init: initialize Glide video thread output method
*****************************************************************************/
-int vout_Init( vout_thread_t *p_vout )
+static int Init( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic;
}
/*****************************************************************************
- * vout_End: terminate Glide video thread output method
+ * End: terminate Glide video thread output method
*****************************************************************************/
-void vout_End( vout_thread_t *p_vout )
+static void End( vout_thread_t *p_vout )
{
;
}
/*****************************************************************************
- * vout_Destroy: destroy Glide video thread output method
+ * Destroy: destroy Glide video thread output method
*****************************************************************************
- * Terminate an output method created by vout_CreateOutputMethod
+ * Terminate an output method created by Create
*****************************************************************************/
-void vout_Destroy( vout_thread_t *p_vout )
+static void Destroy( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
CloseDisplay( p_vout );
free( p_vout->p_sys );
}
/*****************************************************************************
- * vout_Manage: handle Glide events
+ * Manage: handle Glide events
*****************************************************************************
* This function should be called regularly by video output thread. It manages
* console events. It returns a non null value on error.
*****************************************************************************/
-int vout_Manage( vout_thread_t *p_vout )
+static int Manage( vout_thread_t *p_vout )
{
int buf;
}
/*****************************************************************************
- * vout_Render: renders previously calculated output
- *****************************************************************************/
-void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
-}
-
-/*****************************************************************************
- * vout_Display: displays previously rendered output
+ * Display: displays previously rendered output
*****************************************************************************/
-void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+static void Display( vout_thread_t *p_vout, picture_t *p_pic )
{
grLfbUnlock( GR_LFB_WRITE_ONLY, GR_BUFFER_BACKBUFFER );
* gnome.c : Gnome plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: gnome.c,v 1.31 2002/07/23 19:28:25 stef Exp $
+ * $Id: gnome.c,v 1.32 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static void intf_getfunctions( function_list_t * p_function_list );
-static int intf_Open ( intf_thread_t *p_intf );
-static void intf_Close ( intf_thread_t *p_intf );
-static void intf_Run ( intf_thread_t *p_intf );
+static int Open ( vlc_object_t * );
+static void Close ( vlc_object_t * );
-static gint GnomeManage ( gpointer p_data );
+static void Run ( intf_thread_t * );
+static gint Manage ( gpointer );
/*****************************************************************************
* Local variables (mutex-protected).
static void ** pp_global_data = NULL;
/*****************************************************************************
- * Building configuration tree
+ * Module descriptor
*****************************************************************************/
#define TOOLTIPS_TEXT N_("show tooltips")
#define TOOLTIPS_LONGTEXT N_("Show tooltips for configuration options.")
"You can set the maximum height that the configuration windows in the " \
"preferences menu will occupy.")
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_BOOL ( "gnome-tooltips", 1, GtkHideTooltips, TOOLTIPS_TEXT,
- TOOLTIPS_LONGTEXT )
-ADD_BOOL ( "gnome-toolbartext", 1, GtkHideToolbarText, TOOLBAR_TEXT,
- TOOLBAR_LONGTEXT )
-ADD_INTEGER( "gnome-prefs-maxh", 480, NULL, PREFS_MAXH_TEXT,
- PREFS_MAXH_LONGTEXT )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- pp_global_data = p_module->p_vlc->pp_global_data;
- SET_DESCRIPTION( _("Gnome interface module") )
-#ifndef WIN32
- if( getenv( "DISPLAY" ) == NULL )
- {
- ADD_CAPABILITY( INTF, 15 )
- }
- else
+vlc_module_begin();
+#ifdef WIN32
+ int i = 90;
+#else
+ int i = getenv( "DISPLAY" ) == NULL ? 15 : 100;
#endif
- {
- ADD_CAPABILITY( INTF, 100 )
- }
- ADD_PROGRAM( "gnome-vlc" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- intf_getfunctions( &p_module->p_functions->intf );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+ pp_global_data = p_module->p_vlc->pp_global_data;
+
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_bool( "gnome-tooltips", 1, GtkHideTooltips,
+ TOOLTIPS_TEXT, TOOLTIPS_LONGTEXT );
+ add_bool( "gnome-toolbartext", 1, GtkHideToolbarText, TOOLBAR_TEXT,
+ TOOLBAR_LONGTEXT );
+ add_integer( "gnome-prefs-maxh", 480, NULL,
+ PREFS_MAXH_TEXT, PREFS_MAXH_LONGTEXT );
+
+ set_description( _("GNOME interface module") );
+ set_capability( "interface", i );
+ set_callbacks( Open, Close );
+ set_program( "gnome-vlc" );
+vlc_module_end();
/*****************************************************************************
* g_atexit: kludge to avoid the Gnome thread to segfault at exit
}
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Open: initialize and create window
*****************************************************************************/
-static void intf_getfunctions( function_list_t * p_function_list )
+static int Open( vlc_object_t *p_this )
{
- p_function_list->functions.intf.pf_open = intf_Open;
- p_function_list->functions.intf.pf_close = intf_Close;
- p_function_list->functions.intf.pf_run = intf_Run;
-}
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
-/*****************************************************************************
- * intf_Open: initialize and create window
- *****************************************************************************/
-static int intf_Open( intf_thread_t *p_intf )
-{
/* Allocate instance and initialize some members */
p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
return( 1 );
}
+ p_intf->pf_run = Run;
+
p_intf->p_sys->p_sub = msg_Subscribe( p_intf );
/* Initialize Gnome thread */
}
/*****************************************************************************
- * intf_Close: destroy interface window
+ * Close: destroy interface window
*****************************************************************************/
-static void intf_Close( intf_thread_t *p_intf )
+static void Close( vlc_object_t *p_this )
{
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
+
if( p_intf->p_sys->p_input )
{
vlc_object_release( p_intf->p_sys->p_input );
}
/*****************************************************************************
- * intf_Run: Gnome thread
+ * Run: Gnome thread
*****************************************************************************
* this part of the interface is in a separate thread so that we can call
* gtk_main() from within it without annoying the rest of the program.
* XXX: the approach may look kludgy, and probably is, but I could not find
* a better way to dynamically load a Gnome interface at runtime.
*****************************************************************************/
-static void intf_Run( intf_thread_t *p_intf )
+static void Run( intf_thread_t *p_intf )
{
/* gnome_init needs to know the command line. We don't care, so we
* give it an empty one */
/* Sleep to avoid using all CPU - since some interfaces needs to access
* keyboard events, a 100ms delay is a good compromise */
- i_dummy = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, GnomeManage, p_intf );
+ i_dummy = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, Manage, p_intf );
/* Enter gnome mode */
gtk_main();
/* following functions are local */
/*****************************************************************************
- * GnomeManage: manage main thread messages
+ * Manage: manage main thread messages
*****************************************************************************
* In this function, called approx. 10 times a second, we check what the
* main program wanted to tell us.
*****************************************************************************/
-static gint GnomeManage( gpointer p_data )
+static gint Manage( gpointer p_data )
{
#define p_intf ((intf_thread_t *)p_data)
int i_start, i_stop;
* gtk.c : Gtk+ plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: gtk.c,v 1.30 2002/07/15 20:09:31 sam Exp $
+ * $Id: gtk.c,v 1.31 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static void intf_getfunctions ( function_list_t * p_function_list );
-static int intf_Open ( intf_thread_t *p_intf );
-static void intf_Close ( intf_thread_t *p_intf );
-static void intf_Run ( intf_thread_t *p_intf );
+static int Open ( vlc_object_t * );
+static void Close ( vlc_object_t * );
-static gint GtkManage ( gpointer p_data );
+static void Run ( intf_thread_t * );
+static gint Manage ( gpointer );
/*****************************************************************************
* Local variables (mutex-protected).
static void ** pp_global_data = NULL;
/*****************************************************************************
- * Building configuration tree
+ * Module descriptor
*****************************************************************************/
#define TOOLTIPS_TEXT N_("show tooltips")
#define TOOLTIPS_LONGTEXT N_("Show tooltips for configuration options.")
"You can set the maximum height that the configuration windows in the " \
"preferences menu will occupy.")
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_BOOL( "gtk-tooltips", 1, GtkHideTooltips, TOOLTIPS_TEXT, TOOLTIPS_LONGTEXT)
-ADD_INTEGER( "gtk-prefs-maxh", 480, NULL, PREFS_MAXH_TEXT, PREFS_MAXH_LONGTEXT)
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- pp_global_data = p_module->p_vlc->pp_global_data;
- SET_DESCRIPTION( _("Gtk+ interface module") )
-#ifndef WIN32
- if( getenv( "DISPLAY" ) == NULL )
- {
- ADD_CAPABILITY( INTF, 10 )
- }
- else
+vlc_module_begin();
+#ifdef WIN32
+ int i = 90;
+#else
+ int i = getenv( "DISPLAY" ) == NULL ? 10 : 90;
#endif
- {
- ADD_CAPABILITY( INTF, 90 )
- }
- ADD_PROGRAM( "gvlc" )
-MODULE_INIT_STOP
+ pp_global_data = p_module->p_vlc->pp_global_data;
-MODULE_ACTIVATE_START
- intf_getfunctions( &p_module->p_functions->intf );
-MODULE_ACTIVATE_STOP
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_bool( "gtk-tooltips", 1, GtkHideTooltips,
+ TOOLTIPS_TEXT, TOOLTIPS_LONGTEXT );
+ add_integer( "gtk-prefs-maxh", 480, NULL,
+ PREFS_MAXH_TEXT, PREFS_MAXH_LONGTEXT );
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+ set_description( _("Gtk+ interface module") );
+ set_capability( "interface", i );
+ set_callbacks( Open, Close );
+ set_program( "gvlc" );
+vlc_module_end();
/*****************************************************************************
* g_atexit: kludge to avoid the Gtk+ thread to segfault at exit
}
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Open: initialize and create window
*****************************************************************************/
-static void intf_getfunctions( function_list_t * p_function_list )
+static int Open( vlc_object_t *p_this )
{
- p_function_list->functions.intf.pf_open = intf_Open;
- p_function_list->functions.intf.pf_close = intf_Close;
- p_function_list->functions.intf.pf_run = intf_Run;
-}
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
-/*****************************************************************************
- * intf_Open: initialize and create window
- *****************************************************************************/
-static int intf_Open( intf_thread_t *p_intf )
-{
/* Allocate instance and initialize some members */
p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
return( 1 );
}
+ p_intf->pf_run = Run;
+
p_intf->p_sys->p_sub = msg_Subscribe( p_intf );
/* Initialize Gtk+ thread */
}
/*****************************************************************************
- * intf_Close: destroy interface window
+ * Close: destroy interface window
*****************************************************************************/
-static void intf_Close( intf_thread_t *p_intf )
+static void Close( vlc_object_t *p_this )
{
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
+
if( p_intf->p_sys->p_input )
{
vlc_object_release( p_intf->p_sys->p_input );
}
/*****************************************************************************
- * intf_Run: Gtk+ thread
+ * Run: Gtk+ thread
*****************************************************************************
* this part of the interface is in a separate thread so that we can call
* gtk_main() from within it without annoying the rest of the program.
* XXX: the approach may look kludgy, and probably is, but I could not find
* a better way to dynamically load a Gtk+ interface at runtime.
*****************************************************************************/
-static void intf_Run( intf_thread_t *p_intf )
+static void Run( intf_thread_t *p_intf )
{
/* gtk_init needs to know the command line. We don't care, so we
* give it an empty one */
/* Sleep to avoid using all CPU - since some interfaces needs to access
* keyboard events, a 100ms delay is a good compromise */
- i_dummy = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, GtkManage, p_intf );
+ i_dummy = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, Manage, p_intf );
/* Enter Gtk mode */
gtk_main();
/* following functions are local */
/*****************************************************************************
- * GtkManage: manage main thread messages
+ * Manage: manage main thread messages
*****************************************************************************
* In this function, called approx. 10 times a second, we check what the
* main program wanted to tell us.
*****************************************************************************/
-static gint GtkManage( gpointer p_data )
+static gint Manage( gpointer p_data )
{
#define p_intf ((intf_thread_t *)p_data)
int i_start, i_stop;
* gtk_preferences.c: functions to handle the preferences dialog box.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_preferences.c,v 1.34 2002/07/11 19:28:13 sam Exp $
+ * $Id: gtk_preferences.c,v 1.35 2002/07/31 20:56:51 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Loïc Minier <lool@via.ecp.fr>
/* Look for the selected module */
- for( p_module = p_intf->p_vlc->module_bank.first ; p_module != NULL ;
+ for( p_module = p_intf->p_vlc->p_module_bank->first ; p_module != NULL ;
p_module = p_module->next )
{
/* build a list of available modules */
{
gchar * entry[2];
+ char * psz_capability;
- for( p_module_bis = p_intf->p_vlc->module_bank.first ;
+ for( p_module_bis = p_intf->p_vlc->p_module_bank->first ;
p_module_bis != NULL ;
p_module_bis = p_module_bis->next )
{
- if( p_module_bis->i_capabilities & (1 << p_item->i_value) )
+#if 0 /* FIXME */
+ for( psz_capability = p_module_bis->pp_capabilities[0] ;
+ *psz_capability ;
+ psz_capability++ )
{
- entry[0] = p_module_bis->psz_object_name;
- entry[1] = p_module_bis->psz_longname;
- gtk_clist_append( GTK_CLIST(module_clist), entry );
+ if( !strcmp( psz_capability, p_item->psz_type ) )
+ {
+ entry[0] = p_module_bis->psz_object_name;
+ entry[1] = p_module_bis->psz_longname;
+ gtk_clist_append( GTK_CLIST(module_clist), entry );
+ break;
+ }
}
+#endif
}
}
if( gtk_clist_get_text( GTK_CLIST(module_clist), row, 0, &psz_name ) )
{
/* look for module 'psz_name' */
- for( p_module = p_intf->p_vlc->module_bank.first ;
+ for( p_module = p_intf->p_vlc->p_module_bank->first ;
p_module != NULL ;
p_module = p_module->next )
{
* idct.c : C IDCT module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: idct.c,v 1.24 2002/06/01 12:31:59 sam Exp $
+ * $Id: idct.c,v 1.25 2002/07/31 20:56:51 sam Exp $
*
* Author: Gaël Hendryckx <jimmy@via.ecp.fr>
*
#include "idct.h"
#include "block_c.h"
-/*****************************************************************************
- * Local and extern prototypes.
- *****************************************************************************/
-static void idct_getfunctions( function_list_t * p_function_list );
+static int Open( vlc_object_t *p_this );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("IDCT module") )
- ADD_CAPABILITY( IDCT, 50 )
- ADD_SHORTCUT( "c" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- idct_getfunctions( &p_module->p_functions->idct );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("IDCT module") );
+ set_capability( "idct", 50 );
+ add_shortcut( "c" );
+ set_callbacks( Open, NULL );
+vlc_module_end();
/* Following functions are local */
* idct_decl.h : common declarations, must be included at the very end
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: idct_decl.h,v 1.2 2002/02/15 13:32:53 sam Exp $
+ * $Id: idct_decl.h,v 1.3 2002/07/31 20:56:51 sam Exp $
*
* Author: Christophe Massiot <massiot@via.ecp.fr>
*
AddBlock( p_block, p_dest, i_stride );
}
+static void * IDCTFunctions[] =
+ { InitIDCT, NormScan, SparseIDCTAdd, SparseIDCTCopy, IDCTAdd, IDCTCopy };
+
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
-static void idct_getfunctions( function_list_t * p_function_list )
+static int Open( vlc_object_t *p_this )
{
-#define F p_function_list->functions.idct
- F.pf_idct_init = InitIDCT;
- F.pf_norm_scan = NormScan;
- F.pf_sparse_idct_add = SparseIDCTAdd;
- F.pf_sparse_idct_copy = SparseIDCTCopy;
- F.pf_idct_add = IDCTAdd;
- F.pf_idct_copy = IDCTCopy;
-#undef F
+ p_this->p_private = IDCTFunctions;
+ return VLC_SUCCESS;
}
* idctaltivec.c : AltiVec IDCT module
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: idctaltivec.c,v 1.26 2002/06/01 16:45:34 sam Exp $
+ * $Id: idctaltivec.c,v 1.27 2002/07/31 20:56:51 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
#include "idct.h"
-/*****************************************************************************
- * Local prototypes.
- *****************************************************************************/
-static void idct_getfunctions( function_list_t * p_function_list );
+static int Open( vlc_object_t *p_this );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("AltiVec IDCT module") )
- ADD_CAPABILITY( IDCT, 200 )
- ADD_REQUIREMENT( ALTIVEC )
- ADD_SHORTCUT( "altivec" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- idct_getfunctions( &p_module->p_functions->idct );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/* Following functions are local */
+vlc_module_begin();
+ set_description( _("AltiVec IDCT module") );
+ set_capability( "idct", 200 );
+ add_shortcut( "altivec" );
+ add_requirement( ALTIVEC );
+ set_callbacks( Open, NULL );
+vlc_module_end();
/*****************************************************************************
* NormScan : This IDCT uses reordered coeffs, so we patch the scan table
* idctclassic.c : Classic IDCT module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: idctclassic.c,v 1.25 2002/06/01 12:31:59 sam Exp $
+ * $Id: idctclassic.c,v 1.26 2002/07/31 20:56:51 sam Exp $
*
* Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
*
#include "idct.h"
#include "block_c.h"
-/*****************************************************************************
- * Local and extern prototypes.
- *****************************************************************************/
-static void idct_getfunctions( function_list_t * p_function_list );
+static int Open( vlc_object_t *p_this );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("classic IDCT module") )
- ADD_CAPABILITY( IDCT, 100 )
- ADD_SHORTCUT( "classic" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- idct_getfunctions( &p_module->p_functions->idct );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/* Following functions are local */
+vlc_module_begin();
+ set_description( _("classic IDCT module") );
+ set_capability( "idct", 100 );
+ add_shortcut( "classic" );
+ set_callbacks( Open, NULL );
+vlc_module_end();
/*****************************************************************************
* NormScan : Unused in this IDCT
#include "idct_sparse.h"
#include "idct_decl.h"
-
* idctmmx.c : MMX IDCT module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: idctmmx.c,v 1.27 2002/06/01 12:31:59 sam Exp $
+ * $Id: idctmmx.c,v 1.28 2002/07/31 20:56:51 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org>
#include "idct.h"
#include "block_mmx.h"
-/*****************************************************************************
- * Local prototypes.
- *****************************************************************************/
-static void idct_getfunctions( function_list_t * p_function_list );
+static int Open( vlc_object_t *p_this );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("MMX IDCT module") )
- ADD_CAPABILITY( IDCT, 150 )
- ADD_REQUIREMENT( MMX )
- ADD_SHORTCUT( "mmx" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- idct_getfunctions( &p_module->p_functions->idct );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/* Following functions are local */
+vlc_module_begin();
+ set_description( _("MMX IDCT module") );
+ set_capability( "idct", 150 );
+ add_shortcut( "mmx" );
+ add_requirement( MMX );
+ set_callbacks( Open, NULL );
+vlc_module_end();
/*****************************************************************************
* NormScan : This IDCT uses reordered coeffs, so we patch the scan table
* idctmmxext.c : MMX EXT IDCT module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: idctmmxext.c,v 1.24 2002/06/01 12:31:59 sam Exp $
+ * $Id: idctmmxext.c,v 1.25 2002/07/31 20:56:51 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org>
#include "idct.h"
#include "block_mmx.h"
-/*****************************************************************************
- * Local prototypes.
- *****************************************************************************/
-static void idct_getfunctions( function_list_t * p_function_list );
+static int Open( vlc_object_t *p_this );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("MMX EXT IDCT module") )
- ADD_CAPABILITY( IDCT, 200 )
- ADD_REQUIREMENT( MMXEXT )
- ADD_SHORTCUT( "mmxext" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- idct_getfunctions( &p_module->p_functions->idct );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/* Following functions are local */
+vlc_module_begin();
+ set_description( _("MMX EXT IDCT module") );
+ set_capability( "idct", 200 );
+ add_shortcut( "mmxext" );
+ add_requirement( MMXEXT );
+ set_callbacks( Open, NULL );
+vlc_module_end();
/*****************************************************************************
* NormScan : This IDCT uses reordered coeffs, so we patch the scan table
COMMON_SOURCES = ac3_imdct_common.c
imdct_SOURCES = imdct.c ac3_imdct_c.c ac3_srfft_c.c $(COMMON_SOURCES)
-imdctsse_SOURCES = imdctsse.c ac3_imdct_sse.c ac3_srfft_sse.c $(COMMON_SOURCES)
-imdct3dn_SOURCES = imdct3dn.c ac3_imdct_3dn.c ac3_srfft_3dn.c $(COMMON_SOURCES)
+imdctsse_SOURCES = imdct.c ac3_imdct_sse.c ac3_srfft_sse.c $(COMMON_SOURCES)
+imdct3dn_SOURCES = imdct.c ac3_imdct_3dn.c ac3_srfft_3dn.c $(COMMON_SOURCES)
* ac3_imdct_3dn.c: accelerated 3D Now! ac3 DCT
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_imdct_3dn.c,v 1.11 2002/06/01 12:31:59 sam Exp $
+ * $Id: ac3_imdct_3dn.c,v 1.12 2002/07/31 20:56:51 sam Exp $
*
* Authors: Renaud Dartus <reno@videolan.org>
*
# define M_PI 3.14159265358979323846
#endif
-void _M( fft_64p ) ( complex_t *x );
-void _M( fft_128p ) ( complex_t *a );
+void E_( fft_64p ) ( complex_t *x );
+void E_( fft_128p ) ( complex_t *a );
static void imdct512_pre_ifft_twiddle_3dn (const int *pmt, complex_t *buf, float *data, float *xcos_sin_sse);
static void imdct512_post_ifft_twiddle_3dn (complex_t *buf, float *xcos_sin_sse);
static void imdct512_window_delay_nol_3dn (complex_t *buf, float *data_ptr, float *window_prt, float *delay_prt);
-void _M( imdct_init ) (imdct_t * p_imdct)
+void E_( imdct_init ) (imdct_t * p_imdct)
{
int i;
float scale = 181.019;
}
}
-void _M( imdct_do_512 ) (imdct_t * p_imdct, float data[], float delay[])
+void E_( imdct_do_512 ) (imdct_t * p_imdct, float data[], float delay[])
{
imdct512_pre_ifft_twiddle_3dn (pm128, p_imdct->buf, data, p_imdct->xcos_sin_sse);
- _M( fft_128p ) (p_imdct->buf);
+ E_( fft_128p ) (p_imdct->buf);
imdct512_post_ifft_twiddle_3dn (p_imdct->buf, p_imdct->xcos_sin_sse);
imdct512_window_delay_3dn (p_imdct->buf, data, window, delay);
}
-void _M( imdct_do_512_nol ) (imdct_t * p_imdct, float data[], float delay[])
+void E_( imdct_do_512_nol ) (imdct_t * p_imdct, float data[], float delay[])
{
imdct512_pre_ifft_twiddle_3dn (pm128, p_imdct->buf, data, p_imdct->xcos_sin_sse);
- _M( fft_128p ) (p_imdct->buf);
+ E_( fft_128p ) (p_imdct->buf);
imdct512_post_ifft_twiddle_3dn (p_imdct->buf, p_imdct->xcos_sin_sse);
imdct512_window_delay_nol_3dn (p_imdct->buf, data, window, delay);
}
* ac3_imdct_c.c: ac3 DCT in C
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: ac3_imdct_c.c,v 1.6 2002/06/01 12:31:59 sam Exp $
+ * $Id: ac3_imdct_c.c,v 1.7 2002/07/31 20:56:51 sam Exp $
*
* Authors: Renaud Dartus <reno@videolan.org>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
# define M_PI 3.14159265358979323846
#endif
-void _M( fft_64p ) ( complex_t *x );
-void _M( fft_128p ) ( complex_t *x );
+void E_( fft_64p ) ( complex_t *x );
+void E_( fft_128p ) ( complex_t *x );
-void _M( imdct_init ) (imdct_t * p_imdct)
+void E_( imdct_init ) (imdct_t * p_imdct)
{
int i;
float scale = 181.019;
}
}
-void _M( imdct_do_512 ) (imdct_t * p_imdct, float data[], float delay[])
+void E_( imdct_do_512 ) (imdct_t * p_imdct, float data[], float delay[])
{
int i, j;
float tmp_a_r, tmp_a_i;
p_imdct->buf[i].imag = -1.0 * (data[2*j] * p_imdct->xcos1[j] + data[256-2*j-1] * p_imdct->xsin1[j]);
}
- _M( fft_128p ) ( &p_imdct->buf[0] );
+ E_( fft_128p ) ( &p_imdct->buf[0] );
/* Post IFFT complex multiply plus IFFT complex conjugate */
for (i=0; i < 128; i++) {
}
-void _M( imdct_do_512_nol ) (imdct_t * p_imdct, float data[], float delay[])
+void E_( imdct_do_512_nol ) (imdct_t * p_imdct, float data[], float delay[])
{
int i, j;
p_imdct->buf[i].imag = -1.0 * (data[2*j] * p_imdct->xcos1[j] + data[256-2*j-1] * p_imdct->xsin1[j]);
}
- _M( fft_128p ) ( &p_imdct->buf[0] );
+ E_( fft_128p ) ( &p_imdct->buf[0] );
/* Post IFFT complex multiply plus IFFT complex conjugate*/
for (i=0; i < 128; i++) {
* ac3_imdct_common.c: common ac3 DCT functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_imdct_common.c,v 1.7 2002/06/01 12:31:59 sam Exp $
+ * $Id: ac3_imdct_common.c,v 1.8 2002/07/31 20:56:51 sam Exp $
*
* Authors: Renaud Dartus <reno@videolan.org>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
# define M_PI 3.14159265358979323846
#endif
-void _M( fft_64p ) ( complex_t *x );
+void E_( fft_64p ) ( complex_t *x );
-void _M( imdct_do_256 ) (imdct_t * p_imdct, float data[],float delay[])
+void E_( imdct_do_256 ) (imdct_t * p_imdct, float data[],float delay[])
{
int i, j, k;
int p, q;
buf2[k].imag = -1.0f*(data[q + 1] * p_imdct->xcos2[j] + data[p + 1] * p_imdct->xsin2[j]);
}
- _M( fft_64p ) ( &buf1[0] );
- _M( fft_64p ) ( &buf2[0] );
+ E_( fft_64p ) ( &buf1[0] );
+ E_( fft_64p ) ( &buf2[0] );
/* Post IFFT complex multiply */
for( i=0; i < 64; i++) {
}
-void _M( imdct_do_256_nol ) (imdct_t * p_imdct, float data[], float delay[])
+void E_( imdct_do_256_nol ) (imdct_t * p_imdct, float data[], float delay[])
{
int i, j, k;
int p, q;
buf2[k].imag = -1.0f*(data[q + 1] * p_imdct->xcos2[j] + data[p + 1] * p_imdct->xsin2[j]);
}
- _M( fft_64p ) ( &buf1[0] );
- _M( fft_64p ) ( &buf2[0] );
+ E_( fft_64p ) ( &buf1[0] );
+ E_( fft_64p ) ( &buf2[0] );
/* Post IFFT complex multiply */
for( i=0; i < 64; i++) {
* ac3_imdct_common.h: common ac3 DCT headers
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_imdct_common.h,v 1.2 2001/05/16 14:51:29 reno Exp $
+ * $Id: ac3_imdct_common.h,v 1.3 2002/07/31 20:56:51 sam Exp $
*
* Authors: Renaud Dartus <reno@videolan.org>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-void _M( imdct_init ) ( imdct_t * p_imdct );
-void _M( imdct_do_256 ) ( imdct_t * p_imdct, float data[], float delay[] );
-void _M( imdct_do_256_nol ) ( imdct_t * p_imdct, float data[], float delay[] );
-void _M( imdct_do_512 ) ( imdct_t * p_imdct, float data[], float delay[] );
-void _M( imdct_do_512_nol ) ( imdct_t * p_imdct, float data[], float delay[] );
+void E_( imdct_init ) ( imdct_t * p_imdct );
+void E_( imdct_do_256 ) ( imdct_t * p_imdct, float data[], float delay[] );
+void E_( imdct_do_256_nol ) ( imdct_t * p_imdct, float data[], float delay[] );
+void E_( imdct_do_512 ) ( imdct_t * p_imdct, float data[], float delay[] );
+void E_( imdct_do_512_nol ) ( imdct_t * p_imdct, float data[], float delay[] );
* ac3_imdct_sse.c: accelerated SSE ac3 DCT
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_imdct_sse.c,v 1.12 2002/06/01 12:31:59 sam Exp $
+ * $Id: ac3_imdct_sse.c,v 1.13 2002/07/31 20:56:51 sam Exp $
*
* Authors: Renaud Dartus <reno@videolan.org>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
# define M_PI 3.14159265358979323846
#endif
-void _M( fft_64p ) ( complex_t *x );
-void _M( fft_128p ) ( complex_t *a );
+void E_( fft_64p ) ( complex_t *x );
+void E_( fft_128p ) ( complex_t *a );
static void imdct512_pre_ifft_twiddle_sse ( const int *, complex_t *,
float *, float * );
static void imdct512_window_delay_nol_sse ( complex_t *, float *,
float *, float * );
-void _M( imdct_init ) (imdct_t * p_imdct)
+void E_( imdct_init ) (imdct_t * p_imdct)
{
int i;
float scale = 181.019;
}
}
-void _M( imdct_do_512 ) (imdct_t * p_imdct, float data[], float delay[])
+void E_( imdct_do_512 ) (imdct_t * p_imdct, float data[], float delay[])
{
imdct512_pre_ifft_twiddle_sse( pm128, p_imdct->buf, data,
p_imdct->xcos_sin_sse );
- _M( fft_128p ) ( p_imdct->buf );
+ E_( fft_128p ) ( p_imdct->buf );
imdct512_post_ifft_twiddle_sse( p_imdct->buf, p_imdct->xcos_sin_sse );
imdct512_window_delay_sse( p_imdct->buf, data, window, delay );
}
-void _M( imdct_do_512_nol ) (imdct_t * p_imdct, float data[], float delay[])
+void E_( imdct_do_512_nol ) (imdct_t * p_imdct, float data[], float delay[])
{
imdct512_pre_ifft_twiddle_sse( pm128, p_imdct->buf, data,
p_imdct->xcos_sin_sse );
- _M( fft_128p ) ( p_imdct->buf );
+ E_( fft_128p ) ( p_imdct->buf );
imdct512_post_ifft_twiddle_sse( p_imdct->buf, p_imdct->xcos_sin_sse );
imdct512_window_delay_nol_sse( p_imdct->buf, data, window, delay );
}
* ac3_srfft_3dn.c: accelerated 3D Now! ac3 fft functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: ac3_srfft_3dn.c,v 1.6 2002/06/01 12:31:59 sam Exp $
+ * $Id: ac3_srfft_3dn.c,v 1.7 2002/07/31 20:56:51 sam Exp $
*
* Authors: Renaud Dartus <reno@videolan.org>
*
static void fft_asmb_3dn (int k, complex_t *x, complex_t *wTB,
const complex_t *d, const complex_t *d_3);
-void _M( fft_64p ) ( complex_t *a )
+void E_( fft_64p ) ( complex_t *a )
{
fft_8_3dn(&a[0]); fft_4_3dn(&a[8]); fft_4_3dn(&a[12]);
fft_asmb_3dn(2, &a[0], &a[8], &delta16[0], &delta16_3[0]);
fft_asmb_3dn(8, &a[0], &a[32],&delta64[0], &delta64_3[0]);
}
-void _M( fft_128p ) ( complex_t *a )
+void E_( fft_128p ) ( complex_t *a )
{
fft_8_3dn(&a[0]); fft_4_3dn(&a[8]); fft_4_3dn(&a[12]);
fft_asmb_3dn(2, &a[0], &a[8], &delta16[0], &delta16_3[0]);
* ac3_srfft.c: ac3 FFT in C
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: ac3_srfft_c.c,v 1.5 2002/06/01 12:31:59 sam Exp $
+ * $Id: ac3_srfft_c.c,v 1.6 2002/07/31 20:56:51 sam Exp $
*
* Authors: Renaud Dartus <reno@videolan.org>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
}
-void _M( fft_64p ) ( complex_t *a )
+void E_( fft_64p ) ( complex_t *a )
{
fft_8(&a[0]); fft_4(&a[8]); fft_4(&a[12]);
fft_asmb16(&a[0], &a[8]);
}
-void _M( fft_128p ) ( complex_t *a )
+void E_( fft_128p ) ( complex_t *a )
{
fft_8(&a[0]); fft_4(&a[8]); fft_4(&a[12]);
fft_asmb16(&a[0], &a[8]);
* ac3_srfft_sse.c: accelerated SSE ac3 fft functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: ac3_srfft_sse.c,v 1.13 2002/06/01 12:31:59 sam Exp $
+ * $Id: ac3_srfft_sse.c,v 1.14 2002/07/31 20:56:51 sam Exp $
*
* Authors: Renaud Dartus <reno@videolan.org>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
static void fft_asmb_sse (ck_sse_t * ck, int k, complex_t *x, complex_t *wTB,
const complex_t *d, const complex_t *d_3);
-void _M( fft_64p ) ( complex_t *a )
+void E_( fft_64p ) ( complex_t *a )
{
ck_sse_t ck;
ck.C1 = C_1_sse;
fft_asmb_sse(&ck, 8, &a[0], &a[32],&delta64[0], &delta64_3[0]);
}
-void _M( fft_128p ) ( complex_t *a )
+void E_( fft_128p ) ( complex_t *a )
{
ck_sse_t ck;
ck.C1 = C_1_sse;
* imdct.c : IMDCT module
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: imdct.c,v 1.10 2002/06/01 12:31:59 sam Exp $
+ * $Id: imdct.c,v 1.11 2002/07/31 20:56:51 sam Exp $
*
* Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
*
#include "ac3_imdct_common.h"
/*****************************************************************************
- * Local and extern prototypes.
+ * Module initializer
*****************************************************************************/
-static void imdct_getfunctions( function_list_t * p_function_list );
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("AC3 IMDCT module") )
- ADD_CAPABILITY( IMDCT, 50 )
- ADD_SHORTCUT( "c" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- imdct_getfunctions( &p_module->p_functions->imdct );
-MODULE_ACTIVATE_STOP
+static int Open ( vlc_object_t *p_this )
+{
+ imdct_t *p_imdct = (imdct_t *)p_this;
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+ p_imdct->pf_imdct_init = E_( imdct_init );
+ p_imdct->pf_imdct_256 = E_( imdct_do_256 );
+ p_imdct->pf_imdct_256_nol = E_( imdct_do_256_nol );
+ p_imdct->pf_imdct_512 = E_( imdct_do_512 );
+ p_imdct->pf_imdct_512_nol = E_( imdct_do_512_nol );
-/* Following functions are local */
+ return VLC_SUCCESS;
+}
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Module descriptor
*****************************************************************************/
-static void imdct_getfunctions( function_list_t * p_function_list )
-{
-#define F p_function_list->functions.imdct
- F.pf_imdct_init = _M( imdct_init );
- F.pf_imdct_256 = _M( imdct_do_256 );
- F.pf_imdct_256_nol = _M( imdct_do_256_nol );
- F.pf_imdct_512 = _M( imdct_do_512 );
- F.pf_imdct_512_nol = _M( imdct_do_512_nol );
-#undef F
-}
+vlc_module_begin();
+#if defined( MODULE_NAME_IS_imdct )
+ set_description( _("AC3 IMDCT module") );
+ set_capability( "imdct", 50 );
+ add_shortcut( "c" );
+#elif defined( MODULE_NAME_IS_imdctsse )
+ set_description( _("SSE AC3 IMDCT module") );
+ set_capability( "imdct", 200 );
+ add_shortcut( "sse" );
+#elif defined( MODULE_NAME_IS_imdct3dn )
+ set_description( _("3D Now! AC3 IMDCT module") );
+ set_capability( "imdct", 200 );
+ add_shortcut( "3dn" );
+ add_shortcut( "3dnow" );
+#endif
+ set_callbacks( Open, NULL );
+vlc_module_end();
+++ /dev/null
-/*****************************************************************************
- * imdct3dn.c : accelerated 3D Now! IMDCT module
- *****************************************************************************
- * Copyright (C) 1999-2001 VideoLAN
- * $Id: imdct3dn.c,v 1.12 2002/06/01 12:31:59 sam Exp $
- *
- * Authors: Renaud Dartus <reno@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.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <stdlib.h>
-#include <string.h>
-
-#include <vlc/vlc.h>
-
-#include "ac3_imdct.h"
-#include "ac3_imdct_common.h"
-
-/*****************************************************************************
- * Local and extern prototypes.
- *****************************************************************************/
-static void imdct_getfunctions( function_list_t * p_function_list );
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("3D Now! AC3 IMDCT module") )
- ADD_CAPABILITY( IMDCT, 200 )
- ADD_REQUIREMENT( 3DNOW )
- ADD_SHORTCUT( "3dn" )
- ADD_SHORTCUT( "3dnow" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- imdct_getfunctions( &p_module->p_functions->imdct );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/* Following functions are local */
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void imdct_getfunctions( function_list_t * p_function_list )
-{
-#define F p_function_list->functions.imdct
- F.pf_imdct_init = _M( imdct_init );
- F.pf_imdct_256 = _M( imdct_do_256 );
- F.pf_imdct_256_nol = _M( imdct_do_256_nol );
- F.pf_imdct_512 = _M( imdct_do_512 );
- F.pf_imdct_512_nol = _M( imdct_do_512_nol );
-#undef F
-}
-
+++ /dev/null
-/*****************************************************************************
- * imdctsse.c : accelerated SSE IMDCT module
- *****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- * $Id: imdctsse.c,v 1.13 2002/06/01 12:31:59 sam Exp $
- *
- * Authors: Gaël Hendryckx <jimmy@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.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <stdlib.h>
-#include <string.h>
-
-#include <vlc/vlc.h>
-
-#include "ac3_imdct.h"
-#include "ac3_imdct_common.h"
-
-/*****************************************************************************
- * Local and extern prototypes.
- *****************************************************************************/
-static void imdct_getfunctions( function_list_t * p_function_list );
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("SSE AC3 IMDCT module") )
- ADD_CAPABILITY( IMDCT, 200 )
- ADD_REQUIREMENT( SSE )
- ADD_SHORTCUT( "sse" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- imdct_getfunctions( &p_module->p_functions->imdct );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/* Following functions are local */
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void imdct_getfunctions( function_list_t * p_function_list )
-{
-#define F p_function_list->functions.imdct
- F.pf_imdct_init = _M( imdct_init );
- F.pf_imdct_256 = _M( imdct_do_256 );
- F.pf_imdct_256_nol = _M( imdct_do_256_nol );
- F.pf_imdct_512 = _M( imdct_do_512 );
- F.pf_imdct_512_nol = _M( imdct_do_512_nol );
-#undef F
-}
-
* kde.cpp : KDE plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: kde.cpp,v 1.14 2002/07/01 17:39:27 sam Exp $
+ * $Id: kde.cpp,v 1.15 2002/07/31 20:56:51 sam Exp $
*
* Authors: Andres Krapf <dae@chez.com> Sun Mar 25 2001
*
#include <kstdaction.h>
#include <qwidget.h>
-/*****************************************************************************
- * Capabilities defined in the other files.
- *****************************************************************************/
-static void intf_getfunctions( function_list_t * p_function_list );
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-extern "C"
-{
-
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("KDE interface module") )
-#ifndef WIN32
- if( getenv( "DISPLAY" ) == NULL )
- {
- ADD_CAPABILITY( INTF, 8 )
- }
- else
-#endif
- {
- ADD_CAPABILITY( INTF, 85 )
- }
- ADD_PROGRAM( "kvlc" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- intf_getfunctions( &p_module->p_functions->intf );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-} // extern "C"
-
/*****************************************************************************
* The local class.
*****************************************************************************/
~KThread();
// These methods get exported to the core
- static int open ( intf_thread_t *p_intf );
- static void close ( intf_thread_t *p_intf );
- static void run ( intf_thread_t *p_intf );
+ static int open ( vlc_object_t * );
+ static void close ( vlc_object_t * );
+ static void run ( intf_thread_t * );
};
/*****************************************************************************
- * Functions exported as capabilities.
+ * Module descriptor
*****************************************************************************/
-static void intf_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.intf.pf_open = KThread::open;
- p_function_list->functions.intf.pf_close = KThread::close;
- p_function_list->functions.intf.pf_run = KThread::run;
-}
+vlc_module_begin();
+#ifdef WIN32
+ int i = 90;
+#else
+ int i = getenv( "DISPLAY" ) == NULL ? 8 : 85;
+#endif
+ set_description( _("KDE interface module") );
+ set_capability( "interface", i );
+ set_program( "kvlc" );
+ //set_callbacks( E_(Open), E_(Close) );
+ set_callbacks( KThread::open, KThread::close );
+vlc_module_end();
/*****************************************************************************
* KThread::KThread: KDE interface constructor
/*****************************************************************************
* KThread::open: initialize and create window
*****************************************************************************/
-int KThread::open(intf_thread_t *p_intf)
+int KThread::open(vlc_object_t *p_this)
{
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
+
/* Allocate instance and initialize some members */
p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
return( 1 );
}
+ p_intf->pf_run = KThread::run;
+
p_intf->p_sys->p_thread = new KThread(p_intf);
return ( 0 );
}
/*****************************************************************************
* KThread::close: destroy interface window
*****************************************************************************/
-void KThread::close(intf_thread_t *p_intf)
+void KThread::close(vlc_object_t *p_this)
{
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
+
delete p_intf->p_sys->p_thread;
free( p_intf->p_sys );
}
this->p_intf = p_intf;
/* Look for the selected module */
- for( p_module = p_intf->p_vlc->module_bank.first ; p_module != NULL ;
+ for( p_module = p_intf->p_vlc->p_module_bank->first ; p_module != NULL ;
p_module = p_module->next )
{
/* build a list of available plugins */
- for( p_module_bis = p_intf->p_vlc->module_bank.first ;
+#if 0 /* FIXME */
+ for( p_module_bis = p_intf->p_vlc->p_module_bank->first ;
p_module_bis != NULL ;
p_module_bis = p_module_bis->next ) {
if( p_module_bis->i_capabilities & (1 << p_item->i_value)){
p_module_bis->psz_longname);
}
}
+#endif
vlc_mutex_unlock( p_item->p_lock );
}
break;
bool KPreferences::isConfigureable(QString module)
{
module_t *p_module;
- for( p_module = p_intf->p_vlc->module_bank.first ;
+ for( p_module = p_intf->p_vlc->p_module_bank->first ;
p_module != NULL ;
p_module = p_module->next ) {
if( !module.compare( p_module->psz_object_name ) ) {
* lirc.c : lirc plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: lirc.c,v 1.14 2002/07/20 18:01:42 sam Exp $
+ * $Id: lirc.c,v 1.15 2002/07/31 20:56:51 sam Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
};
/*****************************************************************************
- * Local prototypes.
+ * Local prototypes
*****************************************************************************/
-static void intf_getfunctions( function_list_t * p_function_list );
-
-static int intf_Open ( intf_thread_t *p_intf );
-static void intf_Close ( intf_thread_t *p_intf );
-static void intf_Run ( intf_thread_t *p_intf );
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("infrared remote control module") )
- ADD_CAPABILITY( INTF, 8 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- intf_getfunctions( &p_module->p_functions->intf );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+static int Open ( vlc_object_t * );
+static void Close ( vlc_object_t * );
+static void Run ( intf_thread_t * );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Module descriptor
*****************************************************************************/
-static void intf_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.intf.pf_open = intf_Open;
- p_function_list->functions.intf.pf_close = intf_Close;
- p_function_list->functions.intf.pf_run = intf_Run;
-}
+vlc_module_begin();
+ set_description( _("infrared remote control module") );
+ set_capability( "interface", 0 );
+ set_callbacks( Open, Close );
+vlc_module_end();
/*****************************************************************************
- * intf_Open: initialize dummy interface
+ * Open: initialize interface
*****************************************************************************/
-static int intf_Open( intf_thread_t *p_intf )
+static int Open( vlc_object_t *p_this )
{
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
int i_fd;
/* Allocate instance and initialize some members */
return 1;
}
+ p_intf->pf_run = Run;
+
i_fd = lirc_init( "vlc", 1 );
if( i_fd == -1 )
{
}
/*****************************************************************************
- * intf_Close: destroy dummy interface
+ * Close: destroy interface
*****************************************************************************/
-static void intf_Close( intf_thread_t *p_intf )
+static void Close( vlc_object_t *p_this )
{
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
+
if( p_intf->p_sys->p_input )
{
vlc_object_release( p_intf->p_sys->p_input );
}
/*****************************************************************************
- * intf_Run: main loop
+ * Run: main loop
*****************************************************************************/
-static void intf_Run( intf_thread_t *p_intf )
+static void Run( intf_thread_t *p_intf )
{
char *code, *c;
playlist_t *p_playlist;
* lpcm_adec.c: lpcm decoder thread
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: lpcm_adec.c,v 1.19 2002/07/23 00:39:17 sam Exp $
+ * $Id: lpcm_adec.c,v 1.20 2002/07/31 20:56:51 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Henri Fallon <henri@videolan.org>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int decoder_Probe ( vlc_fourcc_t * );
-static int decoder_Run ( decoder_fifo_t * );
+static int OpenDecoder ( vlc_object_t * );
+static int RunDecoder ( decoder_fifo_t * );
+
void DecodeFrame ( lpcmdec_thread_t * );
static int InitThread ( lpcmdec_thread_t * );
static void EndThread ( lpcmdec_thread_t * );
-
/*****************************************************************************
- * Capabilities
+ * Module descriptor
*****************************************************************************/
-void _M( adec_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.dec.pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
-}
+vlc_module_begin();
+ set_description( _("linear PCM audio decoder") );
+ set_capability( "decoder", 100 );
+ set_callbacks( OpenDecoder, NULL );
+vlc_module_end();
/*****************************************************************************
- * Build configuration tree.
+ * OpenDecoder: probe the decoder and return score
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("linear PCM audio decoder") )
- ADD_CAPABILITY( DECODER, 100 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( adec_getfunctions )( &p_module->p_functions->dec );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/*****************************************************************************
- * decoder_Probe: probe the decoder and return score
- *****************************************************************************/
-static int decoder_Probe( vlc_fourcc_t *pi_type )
+static int OpenDecoder( vlc_object_t *p_this )
{
- return ( *pi_type == VLC_FOURCC('l','p','c','m') ) ? 0 : -1;
+ decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
+
+ if( p_fifo->i_fourcc != VLC_FOURCC('l','p','c','m') )
+ {
+ return VLC_EGENERIC;
+ }
+
+ p_fifo->pf_run = RunDecoder;
+ return VLC_SUCCESS;
}
/*****************************************************************************
- * decoder_Run: the lpcm decoder
+ * RunDecoder: the lpcm decoder
*****************************************************************************/
-static int decoder_Run( decoder_fifo_t * p_fifo )
+static int RunDecoder( decoder_fifo_t * p_fifo )
{
lpcmdec_thread_t * p_lpcmdec;
* aout_macosx.m: CoreAudio output plugin
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: aout_macosx.m,v 1.8 2002/07/20 18:01:42 sam Exp $
+ * $Id: aout_macosx.m,v 1.9 2002/07/31 20:56:52 sam Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
UInt32 ui_buffer_size; // audio device buffer size
vlc_bool_t b_buffer_data; // available buffer data?
vlc_mutex_t mutex_lock; // pthread locks for sync of
- vlc_cond_t cond_sync; // aout_Play and callback
+ vlc_cond_t cond_sync; // Play and callback
mtime_t clock_diff; // diff between system clock & audio
};
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int aout_Open ( aout_thread_t *p_aout );
-static int aout_SetFormat ( aout_thread_t *p_aout );
-static int aout_GetBufInfo ( aout_thread_t *p_aout, int i_buffer_info );
-static void aout_Play ( aout_thread_t *p_aout,
- byte_t *buffer, int i_size );
-static void aout_Close ( aout_thread_t *p_aout );
+static int SetFormat ( aout_thread_t * );
+static int GetBufInfo ( aout_thread_t *, int );
+static void Play ( aout_thread_t *, byte_t *, int );
-static int CABeginFormat ( aout_thread_t *p_aout );
-static int CAEndFormat ( aout_thread_t *p_aout );
+static int CABeginFormat ( aout_thread_t * );
+static int CAEndFormat ( aout_thread_t * );
static OSStatus CAIOCallback ( AudioDeviceID inDevice,
const AudioTimeStamp *inNow,
void *threadGlobals );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * OpenAudio: opens a CoreAudio HAL device
*****************************************************************************/
-void _M( aout_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.aout.pf_open = aout_Open;
- p_function_list->functions.aout.pf_setformat = aout_SetFormat;
- p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
- p_function_list->functions.aout.pf_play = aout_Play;
- p_function_list->functions.aout.pf_close = aout_Close;
-}
-
-/*****************************************************************************
- * aout_Open: opens a CoreAudio HAL device
- *****************************************************************************/
-static int aout_Open( aout_thread_t *p_aout )
+int E_(OpenAudio) ( vlc_object_t *p_this )
{
+ aout_thread_t * p_aout = (aout_thread_t *)p_this;
OSStatus err;
UInt32 ui_param_size;
return( -1 );
}
+ p_aout->pf_setformat = SetFormat;
+ p_aout->pf_getbufinfo = GetBufInfo;
+ p_aout->pf_play = Play;
+
return( 0 );
}
/*****************************************************************************
- * aout_SetFormat: pretends to set the dsp output format
+ * SetFormat: pretends to set the dsp output format
*****************************************************************************/
-static int aout_SetFormat( aout_thread_t *p_aout )
+static int SetFormat( aout_thread_t *p_aout )
{
if( CAEndFormat( p_aout ) )
{
}
/*****************************************************************************
- * aout_GetBufInfo: returns available bytes in buffer
+ * GetBufInfo: returns available bytes in buffer
*****************************************************************************/
-static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
+static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
{
return( 0 ); /* send data as soon as possible */
}
//X msg_Warn( p_aout, "audio output is starving, expect glitches" );
}
- /* see aout_Play below */
+ /* see Play below */
vlc_mutex_lock( &p_sys->mutex_lock );
p_sys->b_buffer_data = 0;
vlc_cond_signal( &p_sys->cond_sync );
}
/*****************************************************************************
- * aout_Play: play a sound
+ * Play: play a sound
*****************************************************************************/
-static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
OSStatus err;
UInt32 ui_buffer_size = p_aout->p_sys->ui_buffer_size;
/*
- * wait for a callback to occur (to flush the buffer), so aout_Play
+ * wait for a callback to occur (to flush the buffer), so Play
* can't be called twice, losing the data we just wrote.
*/
vlc_mutex_lock( &p_aout->p_sys->mutex_lock );
}
/*****************************************************************************
- * aout_Close: closes the CoreAudio HAL device
+ * CloseAudio: closes the CoreAudio HAL device
*****************************************************************************/
-static void aout_Close( aout_thread_t *p_aout )
+void E_(CloseAudio) ( vlc_object_t *p_this )
{
+ aout_thread_t * p_aout = (aout_thread_t *)p_this;
+
if( CAEndFormat( p_aout ) )
{
msg_Err( p_aout, "CAEndFormat failed" );
* intf_macosx.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: intf_macosx.m,v 1.9 2002/07/23 20:50:05 massiot Exp $
+ * $Id: intf_macosx.m,v 1.10 2002/07/31 20:56:52 sam Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static int intf_Open ( intf_thread_t *p_intf );
-static void intf_Close ( intf_thread_t *p_intf );
-static void intf_Run ( intf_thread_t *p_intf );
+static void Run ( intf_thread_t *p_intf );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * OpenIntf: initialize interface
*****************************************************************************/
-void _M( intf_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.intf.pf_open = intf_Open;
- p_function_list->functions.intf.pf_close = intf_Close;
- p_function_list->functions.intf.pf_run = intf_Run;
-}
+int E_(OpenIntf) ( vlc_object_t *p_this )
+{
+ intf_thread_t *p_intf = (intf_thread_t*) p_this;
-/*****************************************************************************
- * intf_Open: initialize interface
- *****************************************************************************/
-static int intf_Open( intf_thread_t *p_intf )
-{
p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
{
p_intf->p_sys->p_sub = msg_Subscribe( p_intf );
+ p_intf->pf_run = Run;
+
[[VLCApplication sharedApplication] autorelease];
[NSApp initIntlSupport];
[NSApp setIntf: p_intf];
}
/*****************************************************************************
- * intf_Close: destroy interface
+ * CloseIntf: destroy interface
*****************************************************************************/
-static void intf_Close( intf_thread_t *p_intf )
+void E_(CloseIntf) ( vlc_object_t *p_this )
{
+ intf_thread_t *p_intf = (intf_thread_t*) p_this;
+
msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
[p_intf->p_sys->o_sendport release];
}
/*****************************************************************************
- * intf_Run: main loop
+ * Run: main loop
*****************************************************************************/
-static void intf_Run( intf_thread_t *p_intf )
+static void Run( intf_thread_t *p_intf )
{
[NSApp run];
}
* macosx.m: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: macosx.m,v 1.3 2002/06/08 19:32:19 sam Exp $
+ * $Id: macosx.m,v 1.4 2002/07/31 20:56:52 sam Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu>
#include <vlc/vlc.h>
/*****************************************************************************
- * Capabilities defined in the other files.
+ * External prototypes
*****************************************************************************/
-void _M( aout_getfunctions )( function_list_t * p_function_list );
-void _M( vout_getfunctions )( function_list_t * p_function_list );
-void _M( intf_getfunctions )( function_list_t * p_function_list );
+int E_(OpenIntf) ( vlc_object_t * );
+void E_(CloseIntf) ( vlc_object_t * );
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("MacOS X interface, sound and video module") )
- ADD_CAPABILITY( INTF, 100 )
- ADD_CAPABILITY( AOUT, 100 )
- ADD_CAPABILITY( VOUT, 100 )
-MODULE_INIT_STOP
+int E_(OpenAudio) ( vlc_object_t * );
+void E_(CloseAudio) ( vlc_object_t * );
-MODULE_ACTIVATE_START
- _M( vout_getfunctions )( &p_module->p_functions->vout );
- _M( aout_getfunctions )( &p_module->p_functions->aout );
- _M( intf_getfunctions )( &p_module->p_functions->intf );
-MODULE_ACTIVATE_STOP
+int E_(OpenVideo) ( vlc_object_t * );
+void E_(CloseVideo) ( vlc_object_t * );
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+/*****************************************************************************
+ * Module descriptor
+ *****************************************************************************/
+vlc_module_begin();
+ set_description( _("MacOS X interface, sound and video module") );
+ add_submodule();
+ set_capability( "interface", 100 );
+ set_callbacks( E_(OpenIntf), E_(CloseIntf) );
+ add_submodule();
+ set_capability( "video output", 100 );
+ set_callbacks( E_(OpenVideo), E_(CloseVideo) );
+ add_submodule();
+ set_capability( "audio output", 100 );
+ set_callbacks( E_(OpenAudio), E_(CloseAudio) );
+vlc_module_end();
* vout_macosx.m: MacOS X video output plugin
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: vout_macosx.m,v 1.16 2002/07/25 22:48:56 massiot Exp $
+ * $Id: vout_macosx.m,v 1.17 2002/07/31 20:56:52 sam Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int vout_Create ( vout_thread_t * );
static int vout_Init ( vout_thread_t * );
static void vout_End ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
static int vout_Manage ( vout_thread_t * );
static void vout_Render ( vout_thread_t *, picture_t * );
static void vout_Display ( vout_thread_t *, picture_t * );
static void QTFreePicture ( vout_thread_t *, picture_t * );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( vout_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocates MacOS X video thread output method
+ * OpenVideo: allocates MacOS X video thread output method
*****************************************************************************
* This function allocates and initializes a MacOS X vout method.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
-{
+int E_(OpenVideo) ( vlc_object_t *p_this )
+{
+ vout_thread_t * p_vout = (vout_thread_t *)p_this;
OSErr err;
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
return( 1 );
}
+ p_vout->pf_init = vout_Init;
+ p_vout->pf_end = vout_End;
+ p_vout->pf_manage = vout_Manage;
+ p_vout->pf_render = NULL;
+ p_vout->pf_display = vout_Display;
+
return( 0 );
}
}
/*****************************************************************************
- * vout_Destroy: destroy video thread output method
+ * CloseVideo: destroy video thread output method
*****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
-{
+void E_(CloseVideo) ( vlc_object_t *p_this )
+{
+ vout_thread_t * p_vout = (vout_thread_t *)p_this;
+
if( CoDestroyWindow( p_vout ) )
{
msg_Err( p_vout, "unable to destroy window" );
return( 0 );
}
-/*****************************************************************************
- * vout_Render: render previously calculated output
- *****************************************************************************/
-static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
-}
-
/*****************************************************************************
* vout_Display: displays previously rendered output
*****************************************************************************
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int decoder_Probe ( vlc_fourcc_t * );
-static int decoder_Run ( decoder_fifo_t * );
+static int OpenDecoder ( vlc_object_t * );
+static int RunDecoder ( decoder_fifo_t * );
static int InitThread ( mad_adec_thread_t * p_mad_adec );
static void EndThread ( mad_adec_thread_t * p_mad_adec );
/*****************************************************************************
- * Capabilities
- *****************************************************************************/
-void _M( adec_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.dec.pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
-}
-
-/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
#define DOWNSCALE_TEXT N_("Mad audio downscale routine (fast,mp321)")
#define DOWNSCALE_LONGTEXT N_( \
"Specify the mad audio downscale routine you want to use. By default " \
"the mad plugin will use the fastest routine.")
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_STRING ( "downscale", "fast", NULL, DOWNSCALE_TEXT, DOWNSCALE_LONGTEXT )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("libmad MPEG 1/2/3 audio decoder library") )
- ADD_CAPABILITY( DECODER, 100 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( adec_getfunctions )( &p_module->p_functions->dec );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_string( "downscale", "fast", NULL, DOWNSCALE_TEXT, DOWNSCALE_LONGTEXT );
+ set_description( _("libmad MPEG 1/2/3 audio decoder") );
+ set_capability( "decoder", 100 );
+ set_callbacks( OpenDecoder, NULL );
+vlc_module_end();
/*****************************************************************************
- * decoder_Probe: probe the decoder and return score
+ * OpenDecoder: probe the decoder and return score
*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
- * to chose.
+ * to choose.
*****************************************************************************/
-static int decoder_Probe( vlc_fourcc_t *pi_type )
-{
- return *pi_type == VLC_FOURCC('m','p','g','a') ? 0 : -1;
+static int OpenDecoder( vlc_object_t *p_this )
+{
+ decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
+
+ if( p_fifo->i_fourcc != VLC_FOURCC('m','p','g','a') )
+ {
+ return VLC_EGENERIC;
+ }
+
+ p_fifo->pf_run = RunDecoder;
+ return VLC_SUCCESS;
}
/*****************************************************************************
- * decoder_Run: this function is called just after the thread is created
+ * RunDecoder: this function is called just after the thread is created
*****************************************************************************/
-static int decoder_Run ( decoder_fifo_t * p_fifo )
+static int RunDecoder( decoder_fifo_t *p_fifo )
{
mad_adec_thread_t * p_mad_adec;
/*****************************************************************************
* fastmemcpy.h : fast memcpy routines
*****************************************************************************
- * $Id: fastmemcpy.h,v 1.4 2002/07/21 23:40:23 sam Exp $
+ * $Id: fastmemcpy.h,v 1.5 2002/07/31 20:56:52 sam Exp $
*
* Authors: various Linux kernel hackers
* various MPlayer hackers
#define MIN_LEN 0x40 /* 64-byte blocks */
#endif
-void * _M( fast_memcpy )(void * to, const void * from, size_t len)
+void * fast_memcpy(void * to, const void * from, size_t len)
{
void *retval;
size_t i;
* memcpy.c : classic memcpy module
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: memcpy.c,v 1.9 2002/06/01 12:32:00 sam Exp $
+ * $Id: memcpy.c,v 1.10 2002/07/31 20:56:52 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#undef HAVE_ALTIVEC
#if defined( MODULE_NAME_IS_memcpy3dn )
+# define PRIORITY 100
# define HAVE_3DNOW
# include "fastmemcpy.h"
#elif defined( MODULE_NAME_IS_memcpymmx )
+# define PRIORITY 100
# define HAVE_MMX
# include "fastmemcpy.h"
#elif defined( MODULE_NAME_IS_memcpymmxext )
+# define PRIORITY 200
# define HAVE_MMX2
# include "fastmemcpy.h"
+#else
+# define PRIORITY 50
#endif
/*****************************************************************************
- * Local and extern prototypes.
+ * Extern prototype
*****************************************************************************/
-static void memcpy_getfunctions( function_list_t * p_function_list );
#ifndef MODULE_NAME_IS_memcpy
-void * _M( fast_memcpy ) ( void * to, const void * from, size_t len );
+# define fast_memcpy E_(fast_memcpy)
+ void *fast_memcpy( void * to, const void * from, size_t len );
#endif
/*****************************************************************************
- * Build configuration tree.
+ * Module initializer
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
+static int Activate ( vlc_object_t *p_this )
+{
#ifdef MODULE_NAME_IS_memcpy
- SET_DESCRIPTION( _("libc memcpy module") )
- ADD_CAPABILITY( MEMCPY, 50 )
- ADD_SHORTCUT( "c" )
- ADD_SHORTCUT( "libc" )
-#elif defined( MODULE_NAME_IS_memcpy3dn )
- SET_DESCRIPTION( _("3D Now! memcpy module") )
- ADD_CAPABILITY( MEMCPY, 100 )
- ADD_REQUIREMENT( 3DNOW )
- ADD_SHORTCUT( "3dn" )
- ADD_SHORTCUT( "3dnow" )
- ADD_SHORTCUT( "memcpy3dn" )
- ADD_SHORTCUT( "memcpy3dnow" )
-#elif defined( MODULE_NAME_IS_memcpymmx )
- SET_DESCRIPTION( _("MMX memcpy module") )
- ADD_CAPABILITY( MEMCPY, 100 )
- ADD_REQUIREMENT( MMX )
- ADD_SHORTCUT( "mmx" )
- ADD_SHORTCUT( "memcpymmx" )
-#elif defined( MODULE_NAME_IS_memcpymmxext )
- SET_DESCRIPTION( _("MMX EXT memcpy module") )
- ADD_CAPABILITY( MEMCPY, 200 )
- ADD_REQUIREMENT( MMXEXT )
- ADD_SHORTCUT( "mmxext" )
- ADD_SHORTCUT( "memcpymmxext" )
+ p_this->p_vlc->pf_memcpy = memcpy;
+#else
+ p_this->p_vlc->pf_memcpy = E_(fast_memcpy);
#endif
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- memcpy_getfunctions( &p_module->p_functions->memcpy );
-MODULE_ACTIVATE_STOP
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/* Following functions are local */
+ return VLC_SUCCESS;
+}
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Module descriptor
*****************************************************************************/
-static void memcpy_getfunctions( function_list_t * p_function_list )
-{
+vlc_module_begin();
#ifdef MODULE_NAME_IS_memcpy
- p_function_list->functions.memcpy.pf_memcpy = memcpy;
-#else
- p_function_list->functions.memcpy.pf_memcpy = _M( fast_memcpy );
+ set_description( _("libc memcpy module") );
+ add_shortcut( "c" );
+ add_shortcut( "libc" );
+#elif defined( MODULE_NAME_IS_memcpy3dn )
+ set_description( _("3D Now! memcpy module") );
+ add_requirement( 3DNOW );
+ add_shortcut( "3dn" );
+ add_shortcut( "3dnow" );
+ add_shortcut( "memcpy3dn" );
+ add_shortcut( "memcpy3dnow" );
+#elif defined( MODULE_NAME_IS_memcpymmx )
+ set_description( _("MMX memcpy module") );
+ add_requirement( MMX );
+ add_shortcut( "mmx" );
+ add_shortcut( "memcpymmx" );
+#elif defined( MODULE_NAME_IS_memcpymmxext )
+ set_description( _("MMX EXT memcpy module") );
+ add_requirement( MMXEXT );
+ add_shortcut( "mmxext" );
+ add_shortcut( "memcpymmxext" );
#endif
-}
+ set_capability( "memcpy", PRIORITY );
+ set_callbacks( Activate, NULL );
+vlc_module_end();
* memcpyaltivec.c : AltiVec memcpy module
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: memcpyaltivec.c,v 1.6 2002/06/01 12:32:00 sam Exp $
+ * $Id: memcpyaltivec.c,v 1.7 2002/07/31 20:56:52 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
#include <vlc/vlc.h>
/*****************************************************************************
- * Local and extern prototypes.
+ * Local prototypes.
*****************************************************************************/
-static void memcpy_getfunctions( function_list_t * p_function_list );
-void * _M( fast_memcpy ) ( void * to, const void * from, size_t len );
+static void * fast_memcpy ( void * to, const void * from, size_t len );
/*****************************************************************************
- * Build configuration tree.
+ * Module initializer.
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("AltiVec memcpy module") )
- ADD_CAPABILITY( MEMCPY, 100 )
- ADD_REQUIREMENT( ALTIVEC )
- ADD_SHORTCUT( "altivec" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- memcpy_getfunctions( &p_module->p_functions->memcpy );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/* Following functions are local */
+static int Activate ( vlc_object_t *p_this )
+{
+ p_this->p_vlc->pf_memcpy = fast_memcpy;
+ return VLC_SUCCESS;
+}
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Module descriptor.
*****************************************************************************/
-static void memcpy_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.memcpy.pf_memcpy = _M( fast_memcpy );
-}
+vlc_module_begin();
+ set_description( _("AltiVec memcpy module") );
+ set_capability( "memcpy", 100 );
+ set_callbacks( Activate, NULL );
+ add_shortcut( "altivec" );
+vlc_module_end();
#else
-# define _M( toto ) toto
typedef unsigned long size_t;
#endif /* __BUILD_ALTIVEC_ASM__ */
} \
}
-void * _M( fast_memcpy )(void * _to, const void * _from, size_t len)
+static void * fast_memcpy( void * _to, const void * _from, size_t len )
{
void * retval = _to;
unsigned char * to = (unsigned char *)_to;
* unexpand -a
*/
-void * _M( fast_memcpy )(void * _to, const void * _from, size_t len)
+static void * fast_memcpy( void * _to, const void * _from, size_t len )
{
asm (" \n"
" cmplwi %cr0, %r5, 16 \n"
* mga.c : Matrox Graphic Array plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: mga.c,v 1.20 2002/07/23 00:39:17 sam Exp $
+ * $Id: mga.c,v 1.21 2002/07/31 20:56:52 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Samuel Hocevar <sam@zoy.org>
#endif
/*****************************************************************************
- * Capabilities defined in the other files.
+ * Local prototypes
*****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list );
+static int Create ( vlc_object_t * );
+static void Destroy ( vlc_object_t * );
-static int vout_Create ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static int vout_Manage ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static void Display ( vout_thread_t *, picture_t * );
static int NewPicture ( vout_thread_t *, picture_t * );
/*****************************************************************************
- * Building configuration tree
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("Matrox Graphic Array video module") )
- ADD_CAPABILITY( VOUT, 10 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- vout_getfunctions( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("Matrox Graphic Array video module") );
+ set_capability( "video output", 10 );
+ set_callbacks( Create, Destroy );
+vlc_module_end();
/*****************************************************************************
* vout_sys_t: video output MGA method descriptor
#define CEIL32(x) (((x)+31)&~31)
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocates dummy video thread output method
+ * Create: allocates dummy video thread output method
*****************************************************************************
* This function allocates and initializes a dummy vout method.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
+static int Create( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
/* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
return( 1 );
}
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = NULL;
+ p_vout->pf_render = NULL;
+ p_vout->pf_display = Display;
+
return( 0 );
}
/*****************************************************************************
- * vout_Init: initialize dummy video thread output method
+ * Init: initialize dummy video thread output method
*****************************************************************************/
-static int vout_Init( vout_thread_t *p_vout )
+static int Init( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic;
}
/*****************************************************************************
- * vout_End: terminate dummy video thread output method
+ * End: terminate dummy video thread output method
*****************************************************************************/
-static void vout_End( vout_thread_t *p_vout )
+static void End( vout_thread_t *p_vout )
{
int i_index;
}
/*****************************************************************************
- * vout_Destroy: destroy dummy video thread output method
+ * Destroy: destroy dummy video thread output method
*****************************************************************************
* Terminate an output method created by DummyCreateOutputMethod
*****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
-{
+static void Destroy( vlc_object_t *p_this )
+{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
close( p_vout->p_sys->i_fd );
-
free( p_vout->p_sys );
}
/*****************************************************************************
- * vout_Manage: handle dummy events
- *****************************************************************************
- * This function should be called regularly by video output thread. It manages
- * console events. It returns a non null value on error.
- *****************************************************************************/
-static int vout_Manage( vout_thread_t *p_vout )
-{
- return( 0 );
-}
-
-/*****************************************************************************
- * vout_Render: displays previously calculated output
- *****************************************************************************/
-static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
-{
- /* Grmbl, if we have a G200 which mistakenly assumes 4:2:0 planar
- * has *packed* chroma information, we'll need to do some
- * vonversion... but vlc does this for us. */
-}
-
-/*****************************************************************************
- * vout_Display: displays previously rendered output
+ * Display: displays previously rendered output
*****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+static void Display( vout_thread_t *p_vout, picture_t *p_pic )
{
ioctl( p_vout->p_sys->i_fd, MGA_VID_FSEL, &p_pic->p_sys->i_frame );
}
* xmga.c : X11 MGA plugin for vlc
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: xmga.c,v 1.19 2002/07/23 00:39:17 sam Exp $
+ * $Id: xmga.c,v 1.20 2002/07/31 20:56:52 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static void vout_getfunctions( function_list_t * );
+static int Create ( vlc_object_t * );
+static void Destroy ( vlc_object_t * );
-static int vout_Create ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
-static int vout_Manage ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static int Manage ( vout_thread_t * );
+static void MGADisplay( vout_thread_t *, picture_t * );
static int CreateWindow ( vout_thread_t * );
static void DestroyWindow ( vout_thread_t * );
static void ToggleCursor ( vout_thread_t * );
/*****************************************************************************
- * Building configuration tree
+ * Module descriptor
*****************************************************************************/
#define ALT_FS_TEXT N_("alternate fullscreen method")
"Specify the X11 hardware display you want to use. By default vlc will " \
"use the value of the DISPLAY environment variable.")
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_STRING ( "xmga-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT )
-ADD_BOOL ( "xmga-altfullscreen", 0, NULL, ALT_FS_TEXT, ALT_FS_LONGTEXT )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("X11 MGA module") )
- ADD_CAPABILITY( VOUT, 60 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- vout_getfunctions( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_string( "xmga-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT );
+ add_bool( "xmga-altfullscreen", 0, NULL, ALT_FS_TEXT, ALT_FS_LONGTEXT );
+ set_description( _("X11 MGA module") );
+ set_capability( "video output", 60 );
+ set_callbacks( Create, Destroy );
+vlc_module_end();
/*****************************************************************************
* vout_sys_t: video output method descriptor
#endif
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void vout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocate X11 video thread output method
+ * Create: allocate X11 video thread output method
*****************************************************************************
* This function allocate and initialize a X11 vout method. It uses some of the
* vout properties to choose the window size, and change them according to the
* actual properties of the display.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
-{
+static int Create( vlc_object_t *p_this )
+{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
char *psz_display;
/* Allocate structure */
/* Misc init */
p_vout->p_sys->b_altfullscreen = 0;
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = Manage;
+ p_vout->pf_render = NULL;
+ p_vout->pf_display = MGADisplay;
+
return( 0 );
}
/*****************************************************************************
- * vout_Destroy: destroy X11 video thread output method
+ * Destroy: destroy X11 video thread output method
*****************************************************************************
- * Terminate an output method created by vout_CreateOutputMethod
+ * Terminate an output method created by Create
*****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
-{
+static void Destroy( vlc_object_t *p_this )
+{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
/* Restore cursor if it was blanked */
if( !p_vout->p_sys->b_mouse_pointer_visible )
{
}
/*****************************************************************************
- * vout_Init: initialize X11 video thread output method
+ * Init: initialize X11 video thread output method
*****************************************************************************
* This function create the XImages needed by the output thread. It is called
* at the beginning of the thread, but also each time the window is resized.
*****************************************************************************/
-static int vout_Init( vout_thread_t *p_vout )
+static int Init( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic;
}
/*****************************************************************************
- * vout_Render: render previously calculated output
- *****************************************************************************/
-static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
-}
-
- /*****************************************************************************
- * vout_Display: displays previously rendered output
+ * MGADisplay: displays previously rendered output
*****************************************************************************
* This function sends the currently rendered image to X11 server.
* (The Xv extension takes care of "double-buffering".)
*****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+static void MGADisplay( vout_thread_t *p_vout, picture_t *p_pic )
{
int i_width, i_height, i_x, i_y;
}
/*****************************************************************************
- * vout_Manage: handle X11 events
+ * Manage: handle X11 events
*****************************************************************************
* This function should be called regularly by video output thread. It manages
* X11 events and allows window resizing. It returns a non null value on
* error.
*****************************************************************************/
-static int vout_Manage( vout_thread_t *p_vout )
+static int Manage( vout_thread_t *p_vout )
{
XEvent xevent; /* X11 event */
vlc_bool_t b_resized; /* window has been resized */
}
/*****************************************************************************
- * vout_End: terminate X11 video thread output method
+ * End: terminate X11 video thread output method
*****************************************************************************
- * Destroy the X11 XImages created by vout_Init. It is called at the end of
+ * Destroy the X11 XImages created by Init. It is called at the end of
* the thread, but also each time the window is resized.
*****************************************************************************/
-static void vout_End( vout_thread_t *p_vout )
+static void End( vout_thread_t *p_vout )
{
int i_index;
* motion.c : C motion compensation module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: motion.c,v 1.17 2002/06/01 12:32:00 sam Exp $
+ * $Id: motion.c,v 1.18 2002/07/31 20:56:52 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org>
#include <vlc/vlc.h>
/*****************************************************************************
- * Local and extern prototypes.
+ * Local prototype
*****************************************************************************/
-static void motion_getfunctions( function_list_t * p_function_list );
+static int Open ( vlc_object_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("motion compensation module") )
- ADD_CAPABILITY( MOTION, 50 )
- ADD_SHORTCUT( "c" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- motion_getfunctions( &p_module->p_functions->motion );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("motion compensation module") );
+ set_capability( "motion compensation", 50 );
+ add_shortcut( "c" );
+ set_callbacks( Open, NULL );
+vlc_module_end();
/*****************************************************************************
* Simple motion compensation in C
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
-static void motion_getfunctions( function_list_t * p_function_list )
+static void (* ppppf_motion[2][2][4])( yuv_data_t *, yuv_data_t *, int, int ) =
{
- static void (* ppppf_motion[2][2][4])( yuv_data_t *, yuv_data_t *,
- int, int ) =
+ /* Copying functions */
{
- {
- /* Copying functions */
- {
- /* Width == 16 */
- MC_put_o16_c, MC_put_x16_c, MC_put_y16_c, MC_put_xy16_c
- },
- {
- /* Width == 8 */
- MC_put_o8_c, MC_put_x8_c, MC_put_y8_c, MC_put_xy8_c
- }
- },
- {
- /* Averaging functions */
- {
- /* Width == 16 */
- MC_avg_o16_c, MC_avg_x16_c, MC_avg_y16_c, MC_avg_xy16_c
- },
- {
- /* Width == 8 */
- MC_avg_o8_c, MC_avg_x8_c, MC_avg_y8_c, MC_avg_xy8_c
- }
- }
- };
-
-#define list p_function_list->functions.motion
- memcpy( list.ppppf_motion, ppppf_motion, sizeof( void * ) * 16 );
-#undef list
-
- return;
+ /* Width == 16 */
+ { MC_put_o16_c, MC_put_x16_c, MC_put_y16_c, MC_put_xy16_c },
+ /* Width == 8 */
+ { MC_put_o8_c, MC_put_x8_c, MC_put_y8_c, MC_put_xy8_c }
+ },
+ /* Averaging functions */
+ {
+ /* Width == 16 */
+ { MC_avg_o16_c, MC_avg_x16_c, MC_avg_y16_c, MC_avg_xy16_c },
+ /* Width == 8 */
+ { MC_avg_o8_c, MC_avg_x8_c, MC_avg_y8_c, MC_avg_xy8_c }
+ }
+};
+
+static int Open ( vlc_object_t *p_this )
+{
+ p_this->p_private = ppppf_motion;
+ return VLC_SUCCESS;
}
+
* motion3dnow.c : 3D Now! motion compensation module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: motion3dnow.c,v 1.11 2002/06/01 12:32:00 sam Exp $
+ * $Id: motion3dnow.c,v 1.12 2002/07/31 20:56:52 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org>
#include "mmx.h"
/*****************************************************************************
- * Local and extern prototypes.
+ * Local prototype.
*****************************************************************************/
-static void motion_getfunctions( function_list_t * p_function_list );
+static int Open ( vlc_object_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("3D Now! motion compensation module") )
- ADD_CAPABILITY( MOTION, 150 )
- ADD_REQUIREMENT( 3DNOW )
- ADD_SHORTCUT( "3dn" )
- ADD_SHORTCUT( "3dnow" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- motion_getfunctions( &p_module->p_functions->motion );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("3D Now! motion compensation module") );
+ set_capability( "motion compensation", 150 );
+ add_requirement( 3DNOW );
+ add_shortcut( "3dn" );
+ add_shortcut( "3dnow" );
+ set_callbacks( Open, NULL );
+vlc_module_end();
/*****************************************************************************
* Motion compensation in 3D Now! (OK I know this does MMXEXT too and it's ugly)
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
-static void motion_getfunctions( function_list_t * p_function_list )
+static void (* ppppf_motion[2][2][4])( yuv_data_t *, yuv_data_t *, int, int ) =
{
- static void (* ppppf_motion[2][2][4])( yuv_data_t *, yuv_data_t *,
- int, int ) =
+ /* Copying functions */
{
- {
- /* Copying functions */
- {
- /* Width == 16 */
- MC_put_16_3dnow, MC_put_x16_3dnow, MC_put_y16_3dnow, MC_put_xy16_3dnow
- },
- {
- /* Width == 8 */
- MC_put_8_3dnow, MC_put_x8_3dnow, MC_put_y8_3dnow, MC_put_xy8_3dnow
- }
- },
- {
- /* Averaging functions */
- {
- /* Width == 16 */
- MC_avg_16_3dnow, MC_avg_x16_3dnow, MC_avg_y16_3dnow, MC_avg_xy16_3dnow
- },
- {
- /* Width == 8 */
- MC_avg_8_3dnow, MC_avg_x8_3dnow, MC_avg_y8_3dnow, MC_avg_xy8_3dnow
- }
- }
- };
-
-#define list p_function_list->functions.motion
- memcpy( list.ppppf_motion, ppppf_motion, sizeof( void * ) * 16 );
-#undef list
-
- return;
+ /* Width == 16 */
+ { MC_put_16_3dnow, MC_put_x16_3dnow, MC_put_y16_3dnow, MC_put_xy16_3dnow },
+ /* Width == 8 */
+ { MC_put_8_3dnow, MC_put_x8_3dnow, MC_put_y8_3dnow, MC_put_xy8_3dnow }
+ },
+ /* Averaging functions */
+ {
+ /* Width == 16 */
+ { MC_avg_16_3dnow, MC_avg_x16_3dnow, MC_avg_y16_3dnow, MC_avg_xy16_3dnow },
+ /* Width == 8 */
+ { MC_avg_8_3dnow, MC_avg_x8_3dnow, MC_avg_y8_3dnow, MC_avg_xy8_3dnow }
+ }
+};
+
+static int Open ( vlc_object_t *p_this )
+{
+ p_this->p_private = ppppf_motion;
+ return VLC_SUCCESS;
}
* motionaltivec.c : AltiVec motion compensation module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: motionaltivec.c,v 1.14 2002/06/01 16:45:34 sam Exp $
+ * $Id: motionaltivec.c,v 1.15 2002/07/31 20:56:52 sam Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
* Paul Mackerras <paulus@linuxcare.com.au>
#endif
/*****************************************************************************
- * Local and extern prototypes.
+ * Local prototype
*****************************************************************************/
-static void motion_getfunctions( function_list_t * p_function_list );
+static int Open ( vlc_object_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("AltiVec motion compensation module") )
- ADD_CAPABILITY( MOTION, 150 )
- ADD_REQUIREMENT( ALTIVEC )
- ADD_SHORTCUT( "altivec" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- motion_getfunctions( &p_module->p_functions->motion );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("AltiVec motion compensation module") );
+ set_capability( "motion compensation", 150 );
+ add_requirement( ALTIVEC );
+ add_shortcut( "altivec" );
+ set_callbacks( Open, NULL );
+vlc_module_end();
/*****************************************************************************
* Motion compensation in AltiVec
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
-static void motion_getfunctions( function_list_t * p_function_list )
+static void (* ppppf_motion[2][2][4])( yuv_data_t *, yuv_data_t *, int, int ) =
{
- static void (* ppppf_motion[2][2][4])( yuv_data_t *, yuv_data_t *,
- int, int ) =
+ /* Copying functions */
{
- {
- /* Copying functions */
- {
- /* Width == 16 */
- MC_put_o_16_altivec, MC_put_x_16_altivec, MC_put_y_16_altivec, MC_put_xy_16_altivec
- },
- {
- /* Width == 8 */
- MC_put_o_8_altivec, MC_put_x_8_altivec, MC_put_y_8_altivec, MC_put_xy_8_altivec
- }
- },
- {
- /* Averaging functions */
- {
- /* Width == 16 */
- MC_avg_o_16_altivec, MC_avg_x_16_altivec, MC_avg_y_16_altivec, MC_avg_xy_16_altivec
- },
- {
- /* Width == 8 */
- MC_avg_o_8_altivec, MC_avg_x_8_altivec, MC_avg_y_8_altivec, MC_avg_xy_8_altivec
- }
- }
- };
-
-#define list p_function_list->functions.motion
- memcpy( list.ppppf_motion, ppppf_motion, sizeof( void * ) * 16 );
-#undef list
-
- return;
+ /* Width == 16 */
+ { MC_put_o_16_altivec, MC_put_x_16_altivec, MC_put_y_16_altivec, MC_put_xy_16_altivec },
+ /* Width == 8 */
+ { MC_put_o_8_altivec, MC_put_x_8_altivec, MC_put_y_8_altivec, MC_put_xy_8_altivec }
+ },
+ /* Averaging functions */
+ {
+ /* Width == 16 */
+ { MC_avg_o_16_altivec, MC_avg_x_16_altivec, MC_avg_y_16_altivec, MC_avg_xy_16_altivec },
+ /* Width == 8 */
+ { MC_avg_o_8_altivec, MC_avg_x_8_altivec, MC_avg_y_8_altivec, MC_avg_xy_8_altivec }
+ }
+};
+
+static int Open ( vlc_object_t *p_this )
+{
+ p_this->p_private = ppppf_motion;
+ return VLC_SUCCESS;
}
#endif /* __BUILD_ALTIVEC_ASM__ */
* motionmmx.c : MMX motion compensation module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: motionmmx.c,v 1.19 2002/06/02 23:29:29 sam Exp $
+ * $Id: motionmmx.c,v 1.20 2002/07/31 20:56:52 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org>
#include "mmx.h"
/*****************************************************************************
- * Local and extern prototypes.
+ * Local prototype.
*****************************************************************************/
-static void motion_getfunctions( function_list_t * p_function_list );
+static int Open ( vlc_object_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("MMX motion compensation module") )
- ADD_CAPABILITY( MOTION, 150 )
- ADD_REQUIREMENT( MMX )
- ADD_SHORTCUT( "mmx" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- motion_getfunctions( &p_module->p_functions->motion );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("MMX motion compensation module") );
+ set_capability( "motion compensation", 150 );
+ add_requirement( MMX );
+ add_shortcut( "mmx" );
+ set_callbacks( Open, NULL );
+vlc_module_end();
/*****************************************************************************
* Motion compensation in MMX
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
-static void motion_getfunctions( function_list_t * p_function_list )
+static void (* ppppf_motion[2][2][4])( yuv_data_t *, yuv_data_t *, int, int ) =
{
- static void (* ppppf_motion[2][2][4])( yuv_data_t *, yuv_data_t *,
- int, int ) =
+ /* Copying functions */
{
- {
- /* Copying functions */
- {
- /* Width == 16 */
- MC_put_16_mmx, MC_put_x16_mmx, MC_put_y16_mmx, MC_put_xy16_mmx
- },
- {
- /* Width == 8 */
- MC_put_8_mmx, MC_put_x8_mmx, MC_put_y8_mmx, MC_put_xy8_mmx
- }
- },
- {
- /* Averaging functions */
- {
- /* Width == 16 */
- MC_avg_16_mmx, MC_avg_x16_mmx, MC_avg_y16_mmx, MC_avg_xy16_mmx
- },
- {
- /* Width == 8 */
- MC_avg_8_mmx, MC_avg_x8_mmx, MC_avg_y8_mmx, MC_avg_xy8_mmx
- }
- }
- };
-
-#define list p_function_list->functions.motion
- memcpy( list.ppppf_motion, ppppf_motion, sizeof( void * ) * 16 );
-#undef list
-
- return;
+ /* Width == 16 */
+ { MC_put_16_mmx, MC_put_x16_mmx, MC_put_y16_mmx, MC_put_xy16_mmx },
+ /* Width == 8 */
+ { MC_put_8_mmx, MC_put_x8_mmx, MC_put_y8_mmx, MC_put_xy8_mmx }
+ },
+ /* Averaging functions */
+ {
+ /* Width == 16 */
+ { MC_avg_16_mmx, MC_avg_x16_mmx, MC_avg_y16_mmx, MC_avg_xy16_mmx },
+ /* Width == 8 */
+ { MC_avg_8_mmx, MC_avg_x8_mmx, MC_avg_y8_mmx, MC_avg_xy8_mmx }
+ }
+};
+
+static int Open ( vlc_object_t *p_this )
+{
+ p_this->p_private = ppppf_motion;
+ return VLC_SUCCESS;
}
* motionmmxext.c : MMX EXT motion compensation module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: motionmmxext.c,v 1.19 2002/06/01 12:32:00 sam Exp $
+ * $Id: motionmmxext.c,v 1.20 2002/07/31 20:56:52 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org>
#include "mmx.h"
/*****************************************************************************
- * Local and extern prototypes.
+ * Local prototype.
*****************************************************************************/
-static void motion_getfunctions( function_list_t * p_function_list );
+static int Open ( vlc_object_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("MMXEXT motion compensation module") )
- ADD_CAPABILITY( MOTION, 200 )
- ADD_REQUIREMENT( MMXEXT )
- ADD_SHORTCUT( "mmxext" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- motion_getfunctions( &p_module->p_functions->motion );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("MMX EXT motion compensation module") );
+ set_capability( "motion compensation", 200 );
+ add_requirement( MMXEXT );
+ add_shortcut( "mmxext" );
+ set_callbacks( Open, NULL );
+vlc_module_end();
/*****************************************************************************
* Motion compensation in MMXEXT (OK I know this does 3DNow too and it's ugly)
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
-static void motion_getfunctions( function_list_t * p_function_list )
+static void (* ppppf_motion[2][2][4])( yuv_data_t *, yuv_data_t *, int, int ) =
{
- static void (* ppppf_motion[2][2][4])( yuv_data_t *, yuv_data_t *,
- int, int ) =
+ /* Copying functions */
{
- {
- /* Copying functions */
- {
- /* Width == 16 */
- MC_put_16_mmxext, MC_put_x16_mmxext, MC_put_y16_mmxext, MC_put_xy16_mmxext
- },
- {
- /* Width == 8 */
- MC_put_8_mmxext, MC_put_x8_mmxext, MC_put_y8_mmxext, MC_put_xy8_mmxext
- }
- },
- {
- /* Averaging functions */
- {
- /* Width == 16 */
- MC_avg_16_mmxext, MC_avg_x16_mmxext, MC_avg_y16_mmxext, MC_avg_xy16_mmxext
- },
- {
- /* Width == 8 */
- MC_avg_8_mmxext, MC_avg_x8_mmxext, MC_avg_y8_mmxext, MC_avg_xy8_mmxext
- }
- }
- };
-
-#define list p_function_list->functions.motion
- memcpy( list.ppppf_motion, ppppf_motion, sizeof( void * ) * 16 );
-#undef list
-
- return;
+ /* Width == 16 */
+ { MC_put_16_mmxext, MC_put_x16_mmxext, MC_put_y16_mmxext, MC_put_xy16_mmxext },
+ /* Width == 8 */
+ { MC_put_8_mmxext, MC_put_x8_mmxext, MC_put_y8_mmxext, MC_put_xy8_mmxext }
+ },
+ /* Averaging functions */
+ {
+ /* Width == 16 */
+ { MC_avg_16_mmxext, MC_avg_x16_mmxext, MC_avg_y16_mmxext, MC_avg_xy16_mmxext },
+ /* Width == 8 */
+ { MC_avg_8_mmxext, MC_avg_x8_mmxext, MC_avg_y8_mmxext, MC_avg_xy8_mmxext }
+ }
+};
+
+static int Open ( vlc_object_t *p_this )
+{
+ p_this->p_private = ppppf_motion;
+ return VLC_SUCCESS;
}
* mp4.c : MP4 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: mp4.c,v 1.7 2002/07/23 22:42:20 fenrir Exp $
+ * $Id: mp4.c,v 1.8 2002/07/31 20:56:52 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static void input_getfunctions( function_list_t * );
-static int MP4Demux ( input_thread_t * );
-static int MP4Init ( input_thread_t * );
-static void MP4End ( input_thread_t * );
+static int MP4Init ( vlc_object_t * );
+static void __MP4End ( vlc_object_t * );
+static int MP4Demux ( input_thread_t * );
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( "MP4 file input" )
- ADD_CAPABILITY( DEMUX, 242 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- input_getfunctions( &p_module->p_functions->demux );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+#define MP4End(a) __MP4End(VLC_OBJECT(a))
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Module descriptor
*****************************************************************************/
-static void input_getfunctions( function_list_t * p_function_list )
-{
-#define input p_function_list->functions.demux
- input.pf_init = MP4Init;
- input.pf_end = MP4End;
- input.pf_demux = MP4Demux;
- input.pf_rewind = NULL;
-#undef input
-}
+vlc_module_begin();
+ set_description( "MP4 demuxer" );
+ set_capability( "demux", 242 );
+ set_callbacks( MP4Init, __MP4End );
+vlc_module_end();
/*****************************************************************************
* Declaration of local function
/*****************************************************************************
* MP4Init: check file and initializes MP4 structures
*****************************************************************************/
-static int MP4Init( input_thread_t *p_input )
-{
+static int MP4Init( vlc_object_t * p_this )
+{
+ input_thread_t *p_input = (input_thread_t *)p_this;
u8 *p_peek;
u32 i_type;
p_input->i_bufsize = INPUT_DEFAULT_BUFSIZE ;
}
+ p_input->pf_demux = MP4Demux;
+
/* a little test to see if it could be a mp4 */
if( input_Peek( p_input, &p_peek, 8 ) < 8 )
{
/*****************************************************************************
* MP4End: frees unused data
*****************************************************************************/
-static void MP4End( input_thread_t *p_input )
+static void __MP4End ( vlc_object_t * p_this )
{
#define FREE( p ) \
if( p ) { free( p ); }
int i_track;
+ input_thread_t * p_input = (input_thread_t *)p_this;
demux_data_mp4_t *p_demux = p_input->p_demux_data;
msg_Dbg( p_input, "Freeing all memory" );
* mpeg_adec.c: MPEG audio decoder thread
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: mpeg_adec.c,v 1.26 2002/07/23 00:39:17 sam Exp $
+ * $Id: mpeg_adec.c,v 1.27 2002/07/31 20:56:52 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
/*****************************************************************************
* Local Prototypes
*****************************************************************************/
-static int decoder_Probe ( vlc_fourcc_t * );
-static int decoder_Run ( decoder_fifo_t * );
-static void EndThread ( adec_thread_t * );
-static void DecodeThread ( adec_thread_t * );
+static int OpenDecoder ( vlc_object_t * );
+static int RunDecoder ( decoder_fifo_t * );
-/*****************************************************************************
- * Capabilities
- *****************************************************************************/
-void _M( adec_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.dec.pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
-}
+static void EndThread ( adec_thread_t * );
+static void DecodeThread ( adec_thread_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("MPEG I/II layer 1/2 audio decoder") )
- ADD_CAPABILITY( DECODER, 50 )
- ADD_REQUIREMENT( FPU )
- ADD_SHORTCUT( "builtin" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( adec_getfunctions )( &p_module->p_functions->dec );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("MPEG I/II layer 1/2 audio decoder") );
+ set_capability( "decoder", 50 );
+ add_requirement( FPU );
+ add_shortcut( "builtin" );
+ set_callbacks( OpenDecoder, NULL );
+vlc_module_end();
/*****************************************************************************
- * decoder_Probe: probe the decoder and return score
+ * OpenDecoder: probe the decoder and return score
+ *****************************************************************************
+ * Tries to launch a decoder and return score so that the interface is able
+ * to choose.
*****************************************************************************/
-static int decoder_Probe( vlc_fourcc_t *pi_type )
-{
- return *pi_type == VLC_FOURCC('m','p','g','a') ? 0 : -1;
+static int OpenDecoder( vlc_object_t *p_this )
+{
+ decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
+
+ if( p_fifo->i_fourcc != VLC_FOURCC('m','p','g','a') )
+ {
+ return VLC_EGENERIC;
+ }
+
+ p_fifo->pf_run = RunDecoder;
+ return VLC_SUCCESS;
}
/*****************************************************************************
- * decoder_Run: initialize, go inside main loop, detroy
+ * RunDecoder: initialize, go inside main loop, destroy
*****************************************************************************/
-static int decoder_Run ( decoder_fifo_t * p_fifo )
+static int RunDecoder( decoder_fifo_t *p_fifo )
{
adec_thread_t * p_adec;
* mpeg_audio.c : mpeg_audio Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: mpeg_audio.c,v 1.13 2002/07/23 00:39:17 sam Exp $
+ * $Id: mpeg_audio.c,v 1.14 2002/07/31 20:56:52 sam Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static void input_getfunctions ( function_list_t * p_function_list );
-static int MPEGAudioDemux ( input_thread_t * );
-static int MPEGAudioInit ( input_thread_t * );
-static void MPEGAudioEnd ( input_thread_t * );
+static int Activate ( vlc_object_t * );
+static int Demux ( input_thread_t * );
/* TODO: support MPEG-2.5, not difficult */
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( "MPEG I/II Audio stream demux" )
- ADD_CAPABILITY( DEMUX, 110 )
- ADD_SHORTCUT( "mpegaudio" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- input_getfunctions( &p_module->p_functions->demux );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void input_getfunctions( function_list_t * p_function_list )
-{
-#define input p_function_list->functions.demux
- input.pf_init = MPEGAudioInit;
- input.pf_end = MPEGAudioEnd;
- input.pf_demux = MPEGAudioDemux;
- input.pf_rewind = NULL;
-#undef input
-}
+vlc_module_begin();
+ set_description( _("ISO 13818-3 MPEG I/II audio stream demux" ) );
+ set_capability( "demux", 100 );
+ set_callbacks( Activate, NULL );
+ add_shortcut( "mpegaudio" );
+vlc_module_end();
/*****************************************************************************
* Definitions of structures and functions used by this plugins
/*****************************************************************************
- * MPEGaudioInit : initializes MPEGaudio structures
+ * Activate: initializes MPEGaudio structures
*****************************************************************************/
-static int MPEGAudioInit( input_thread_t * p_input )
+static int Activate( vlc_object_t * p_this )
{
- demux_data_mpegaudio_t *p_mpegaudio;
+ input_thread_t * p_input = (input_thread_t *)p_this;
+ demux_data_mpegaudio_t * p_mpegaudio;
mpegaudio_format_t mpeg;
es_descriptor_t * p_es;
int i_pos;
int b_forced;
input_info_category_t * p_category;
+ /* Set the demux function */
+ p_input->pf_demux = Demux;
+
/* XXX: i don't know what it's supposed to do, copied from ESInit */
/* Initialize access plug-in structures. */
if( p_input->i_mtu == 0 )
return( 0 );
}
-
-/*****************************************************************************
- * MPEGAudioEnd: frees unused data
- *****************************************************************************/
-static void MPEGAudioEnd( input_thread_t * p_input )
-{
-
-}
-
-
/*****************************************************************************
- * MPEGAudioDemux: reads and demuxes data packets
+ * Demux: reads and demuxes data packets
*****************************************************************************
* Returns -1 in case of error, 0 in case of EOF, 1 otherwise
*****************************************************************************/
-static int MPEGAudioDemux( input_thread_t * p_input )
+static int Demux( input_thread_t * p_input )
{
int i_pos;
int i_toread;
* mpeg_es.c : Elementary Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: mpeg_es.c,v 1.12 2002/07/24 16:21:46 sam Exp $
+ * $Id: mpeg_es.c,v 1.13 2002/07/31 20:56:52 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static void input_getfunctions( function_list_t * p_function_list );
-static int ESDemux ( input_thread_t * );
-static int ESInit ( input_thread_t * );
-static void ESEnd ( input_thread_t * );
+static int Activate ( vlc_object_t * );
+static int Demux ( input_thread_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("ISO 13818-2 MPEG Elementary Stream input") )
- ADD_CAPABILITY( DEMUX, 150 )
- ADD_SHORTCUT( "es" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- input_getfunctions( &p_module->p_functions->demux );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void input_getfunctions( function_list_t * p_function_list )
-{
-#define input p_function_list->functions.demux
- input.pf_init = ESInit;
- input.pf_end = ESEnd;
- input.pf_demux = ESDemux;
- input.pf_rewind = NULL;
-#undef input
-}
+vlc_module_begin();
+ set_description( _("ISO 13818-1 MPEG Elementary Stream input") );
+ set_capability( "demux", 150 );
+ set_callbacks( Activate, NULL );
+ add_shortcut( "es" );
+vlc_module_end();
/*
* Data reading functions
*/
/*****************************************************************************
- * ESInit: initializes ES structures
+ * Activate: initializes ES structures
*****************************************************************************/
-static int ESInit( input_thread_t * p_input )
+static int Activate( vlc_object_t * p_this )
{
+ input_thread_t * p_input = (input_thread_t *)p_this;
es_descriptor_t * p_es;
byte_t * p_peek;
+ /* Set the demux function */
+ p_input->pf_demux = Demux;
+
/* Initialize access plug-in structures. */
if( p_input->i_mtu == 0 )
{
}
/*****************************************************************************
- * ESEnd: frees unused data
- *****************************************************************************/
-static void ESEnd( input_thread_t * p_input )
-{
-}
-
-/*****************************************************************************
- * ESDemux: reads and demuxes data packets
+ * Demux: reads and demuxes data packets
*****************************************************************************
* Returns -1 in case of error, 0 in case of EOF, 1 otherwise
*****************************************************************************/
-static int ESDemux( input_thread_t * p_input )
+static int Demux( input_thread_t * p_input )
{
ssize_t i_read;
decoder_fifo_t * p_fifo =
* mpeg_ps.c : Program Stream input module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: mpeg_ps.c,v 1.16 2002/07/23 00:39:17 sam Exp $
+ * $Id: mpeg_ps.c,v 1.17 2002/07/31 20:56:52 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static void input_getfunctions( function_list_t * p_function_list );
-static int PSDemux ( input_thread_t * );
-static int PSInit ( input_thread_t * );
-static void PSEnd ( input_thread_t * );
+static int Activate ( vlc_object_t * );
+static int Demux ( input_thread_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("ISO 13818-1 MPEG Program Stream input") )
- ADD_CAPABILITY( DEMUX, 100 )
- ADD_SHORTCUT( "ps" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- input_getfunctions( &p_module->p_functions->demux );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void input_getfunctions( function_list_t * p_function_list )
-{
-#define input p_function_list->functions.demux
- input.pf_init = PSInit;
- input.pf_end = PSEnd;
- input.pf_demux = PSDemux;
- input.pf_rewind = NULL;
-#undef input
-}
+vlc_module_begin();
+ set_description( _("ISO 13818-1 MPEG Program Stream input") );
+ set_capability( "demux", 100 );
+ set_callbacks( Activate, NULL );
+ add_shortcut( "ps" );
+vlc_module_end();
/*****************************************************************************
- * PSInit: initializes PS structures
+ * Activate: initializes PS structures
*****************************************************************************/
-static int PSInit( input_thread_t * p_input )
+static int Activate( vlc_object_t * p_this )
{
+ input_thread_t * p_input = (input_thread_t *)p_this;
byte_t * p_peek;
+ /* Set the demux function */
+ p_input->pf_demux = Demux;
+
/* Initialize access plug-in structures. */
if( p_input->i_mtu == 0 )
{
}
/*****************************************************************************
- * PSEnd: frees unused data
- *****************************************************************************/
-static void PSEnd( input_thread_t * p_input )
-{
-}
-
-/*****************************************************************************
- * PSDemux: reads and demuxes data packets
+ * Demux: reads and demuxes data packets
*****************************************************************************
* Returns -1 in case of error, 0 in case of EOF, otherwise the number of
* packets.
*****************************************************************************/
-static int PSDemux( input_thread_t * p_input )
+static int Demux( input_thread_t * p_input )
{
int i;
* mpeg_ts.c : Transport Stream input module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: mpeg_ts.c,v 1.16 2002/07/23 00:39:17 sam Exp $
+ * $Id: mpeg_ts.c,v 1.17 2002/07/31 20:56:52 sam Exp $
*
* Authors: Henri Fallon <henri@via.ecp.fr>
* Johan Bilien <jobi@via.ecp.fr>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static void input_getfunctions( function_list_t * p_function_list );
-static int TSInit ( input_thread_t * );
-static void TSEnd ( input_thread_t * );
-static int TSDemux ( input_thread_t * );
+static int Activate ( vlc_object_t * );
+static int Demux ( input_thread_t * );
#if defined MODULE_NAME_IS_mpeg_ts
static void TSDemuxPSI ( input_thread_t *, data_packet_t *,
#endif
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
+vlc_module_begin();
#if defined MODULE_NAME_IS_mpeg_ts
- SET_DESCRIPTION( _("ISO 13818-1 MPEG Transport Stream input") )
- ADD_CAPABILITY( DEMUX, 160 )
- ADD_SHORTCUT( "ts" )
+ set_description( _("ISO 13818-1 MPEG Transport Stream input") );
+ set_capability( "demux", 160 );
+ add_shortcut( "ts" );
#elif defined MODULE_NAME_IS_mpeg_ts_dvbpsi
- SET_DESCRIPTION( _("ISO 13818-1 MPEG Transport Stream input (libdvbpsi)") )
- ADD_CAPABILITY( DEMUX, 170 )
- ADD_SHORTCUT( "ts_dvbpsi" )
+ set_description( _("ISO 13818-1 MPEG Transport Stream input (libdvbpsi)") );
+ set_capability( "demux", 170 );
+ add_shortcut( "ts_dvbpsi" );
#endif
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- input_getfunctions( &p_module->p_functions->demux );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void input_getfunctions( function_list_t * p_function_list )
-{
-#define input p_function_list->functions.demux
- input.pf_init = TSInit;
- input.pf_end = TSEnd;
- input.pf_demux = TSDemux;
- input.pf_rewind = NULL;
-#undef input
-}
+ set_callbacks( Activate, NULL );
+vlc_module_end();
/*****************************************************************************
- * TSInit: initializes TS structures
+ * Activate: initializes TS structures
*****************************************************************************/
-static int TSInit( input_thread_t * p_input )
+static int Activate( vlc_object_t * p_this )
{
+ input_thread_t * p_input = (input_thread_t *)p_this;
es_descriptor_t * p_pat_es;
es_ts_data_t * p_demux_data;
stream_ts_data_t * p_stream_data;
byte_t * p_peek;
+ /* Set the demux function */
+ p_input->pf_demux = Demux;
+
/* Initialize access plug-in structures. */
if( p_input->i_mtu == 0 )
{
}
/*****************************************************************************
- * TSEnd: frees unused data
- *****************************************************************************/
-static void TSEnd( input_thread_t * p_input )
-{
-}
-
-/*****************************************************************************
- * TSDemux: reads and demuxes data packets
+ * Demux: reads and demuxes data packets
*****************************************************************************
* Returns -1 in case of error, 0 in case of EOF, otherwise the number of
* packets.
*****************************************************************************/
-static int TSDemux( input_thread_t * p_input )
+static int Demux( input_thread_t * p_input )
{
int i_read_once = (p_input->i_mtu ?
p_input->i_bufsize / TS_PACKET_SIZE :
* video_parser.c : video parser thread
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: video_parser.c,v 1.26 2002/07/23 00:39:17 sam Exp $
+ * $Id: video_parser.c,v 1.27 2002/07/31 20:56:52 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
/*
* Local prototypes
*/
-static int decoder_Probe ( vlc_fourcc_t * );
-static int decoder_Run ( decoder_fifo_t * );
+static int OpenDecoder ( vlc_object_t * );
+static int RunDecoder ( decoder_fifo_t * );
static int InitThread ( vpar_thread_t * );
static void EndThread ( vpar_thread_t * );
static void BitstreamCallback ( bit_stream_t *, vlc_bool_t );
/*****************************************************************************
- * Capabilities
- *****************************************************************************/
-void _M( vdec_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.dec.pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
-}
-
-/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
#define VDEC_IDCT_TEXT N_("IDCT module")
#define VDEC_IDCT_LONGTEXT N_( \
"you select more pictures than what your CPU is capable to decode, " \
"you won't get anything.")
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL)
-ADD_MODULE ( "mpeg-idct", MODULE_CAPABILITY_IDCT, NULL, NULL,
- VDEC_IDCT_TEXT, VDEC_IDCT_LONGTEXT )
-ADD_MODULE ( "mpeg-motion", MODULE_CAPABILITY_MOTION, NULL, NULL,
- VDEC_MOTION_TEXT, VDEC_IDCT_LONGTEXT )
-ADD_INTEGER ( "vdec-smp", 0, NULL, VDEC_SMP_TEXT, VDEC_SMP_LONGTEXT )
-ADD_STRING ( "vpar-synchro", NULL, NULL, VPAR_SYNCHRO_TEXT,
- VPAR_SYNCHRO_LONGTEXT )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("MPEG I/II video decoder module") )
- ADD_CAPABILITY( DECODER, 50 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( vdec_getfunctions )( &p_module->p_functions->dec );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_module ( "mpeg-idct", "idct", NULL, NULL,
+ VDEC_IDCT_TEXT, VDEC_IDCT_LONGTEXT );
+ add_module ( "mpeg-motion", "motion", NULL, NULL,
+ VDEC_MOTION_TEXT, VDEC_IDCT_LONGTEXT );
+ add_integer ( "vdec-smp", 0, NULL, VDEC_SMP_TEXT, VDEC_SMP_LONGTEXT );
+ add_string ( "vpar-synchro", NULL, NULL, VPAR_SYNCHRO_TEXT,
+ VPAR_SYNCHRO_LONGTEXT );
+ set_description( _("MPEG I/II video decoder module") );
+ set_capability( "decoder", 50 );
+ set_callbacks( OpenDecoder, NULL );
+vlc_module_end();
/*****************************************************************************
- * decoder_Probe: probe the decoder and return score
+ * OpenDecoder: probe the decoder and return score
*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
-static int decoder_Probe( vlc_fourcc_t *pi_type )
+static int OpenDecoder( vlc_object_t *p_this )
{
- return *pi_type == VLC_FOURCC('m','p','g','v') ? 0 : -1;
+ decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
+
+ if( p_fifo->i_fourcc == VLC_FOURCC('m','p','g','v') )
+ {
+ p_fifo->pf_run = RunDecoder;
+ return VLC_SUCCESS;
+ }
+
+ return VLC_EGENERIC;
}
/*****************************************************************************
- * decoder_Run: this function is called just after the thread is created
+ * RunDecoder: this function is called just after the thread is created
*****************************************************************************/
-static int decoder_Run ( decoder_fifo_t * p_fifo )
+static int RunDecoder ( decoder_fifo_t * p_fifo )
{
vpar_thread_t * p_vpar;
vlc_bool_t b_error;
/*****************************************************************************
* InitThread: initialize vpar output thread
*****************************************************************************
- * This function is called from decoder_Run and performs the second step
+ * This function is called from Run and performs the second step
* of the initialization. It returns 0 on success. Note that the thread's
* flag are not modified inside this function.
*****************************************************************************/
* Choose the best motion compensation module
*/
psz_name = config_GetPsz( p_vpar->p_fifo, "mpeg-motion" );
- p_vpar->p_motion_module = module_Need( p_vpar->p_fifo,
- MODULE_CAPABILITY_MOTION, psz_name, NULL );
+ p_vpar->p_motion =
+ module_Need( p_vpar->p_fifo, "motion compensation", psz_name );
if( psz_name ) free( psz_name );
- if( p_vpar->p_motion_module == NULL )
+ if( p_vpar->p_motion == NULL )
{
msg_Err( p_vpar->p_fifo, "no suitable motion compensation module" );
free( p_vpar );
return( -1 );
}
-#define f ( p_vpar->p_motion_module->p_functions->motion.functions.motion )
- memcpy( p_vpar->pool.ppppf_motion, f.ppppf_motion, sizeof(void *) * 16 );
-#undef f
+ memcpy( p_vpar->pool.ppppf_motion,
+ p_vpar->p_fifo->p_private, sizeof(void *) * 16 );
/*
* Choose the best IDCT module
*/
psz_name = config_GetPsz( p_vpar->p_fifo, "mpeg-idct" );
- p_vpar->p_idct_module = module_Need( p_vpar->p_fifo,
- MODULE_CAPABILITY_IDCT, psz_name, NULL );
+ p_vpar->p_idct = module_Need( p_vpar->p_fifo, "idct", psz_name );
if( psz_name ) free( psz_name );
- if( p_vpar->p_idct_module == NULL )
+ if( p_vpar->p_idct == NULL )
{
msg_Err( p_vpar->p_fifo, "no suitable IDCT module" );
- module_Unneed( p_vpar->p_motion_module );
+ module_Unneed( p_vpar->p_fifo, p_vpar->p_motion );
free( p_vpar );
return( -1 );
}
-#define f p_vpar->p_idct_module->p_functions->idct.functions.idct
- p_vpar->pool.pf_idct_init = f.pf_idct_init;
- p_vpar->pf_sparse_idct_add = f.pf_sparse_idct_add;
- p_vpar->pf_idct_add = f.pf_idct_add;
- p_vpar->pf_sparse_idct_copy = f.pf_sparse_idct_copy;
- p_vpar->pf_idct_copy = f.pf_idct_copy;
- p_vpar->pf_norm_scan = f.pf_norm_scan;
-#undef f
+ p_vpar->pool.pf_idct_init = ((void**)p_vpar->p_fifo->p_private)[0];
+ p_vpar->pf_norm_scan = ((void**)p_vpar->p_fifo->p_private)[1];
+ p_vpar->pf_sparse_idct_add = ((void**)p_vpar->p_fifo->p_private)[2];
+ p_vpar->pf_sparse_idct_copy = ((void**)p_vpar->p_fifo->p_private)[3];
+ p_vpar->pf_idct_add = ((void**)p_vpar->p_fifo->p_private)[4];
+ p_vpar->pf_idct_copy = ((void**)p_vpar->p_fifo->p_private)[5];
/* Initialize input bitstream */
InitBitstream( &p_vpar->bit_stream, p_vpar->p_fifo,
vpar_EndPool( p_vpar );
- module_Unneed( p_vpar->p_idct_module );
- module_Unneed( p_vpar->p_motion_module );
+ module_Unneed( p_vpar->p_fifo, p_vpar->p_idct );
+ module_Unneed( p_vpar->p_fifo, p_vpar->p_motion );
free( p_vpar );
}
* video_parser.h : video parser thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_parser.h,v 1.6 2002/06/01 12:32:00 sam Exp $
+ * $Id: video_parser.h,v 1.7 2002/07/31 20:56:52 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Marc Dressler <polux@via.ecp.fr>
u8 pi_default_nonintra_quant[64];
/* Motion compensation plug-in used and shortcuts */
- module_t * p_motion_module;
+ module_t * p_motion;
/* IDCT plug-in used and shortcuts */
- module_t * p_idct_module;
+ module_t * p_idct;
void ( * pf_sparse_idct_add )( dctelem_t *, yuv_data_t *, int,
void *, int );
void ( * pf_idct_add ) ( dctelem_t *, yuv_data_t *, int,
* vpar_pool.c : management of the pool of decoder threads
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: vpar_pool.c,v 1.12 2002/06/08 14:08:46 sam Exp $
+ * $Id: vpar_pool.c,v 1.13 2002/07/31 20:56:52 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
p_control = p_vpar->p_fifo->p_stream_ctrl;
vlc_mutex_lock( &p_control->control_lock );
- i_new_smp = p_control->i_smp;
+ i_new_smp = config_GetInt( p_vpar->p_fifo, "vdec-smp" );
vlc_mutex_unlock( &p_control->control_lock );
/* FIXME: No error check because I'm tired. Come back later... */
* ipv4.c: IPv4 network abstraction layer
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: ipv4.c,v 1.14 2002/07/19 21:14:13 massiot Exp $
+ * $Id: ipv4.c,v 1.15 2002/07/31 20:56:52 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Mathias Kretschmer <mathias@research.att.com>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static void getfunctions( function_list_t * );
-static int NetworkOpen( vlc_object_t *, network_socket_t * );
+static int NetOpen( vlc_object_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("IPv4 network abstraction layer") )
- ADD_CAPABILITY( NETWORK, 50 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- getfunctions( &p_module->p_functions->network );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void getfunctions( function_list_t * p_function_list )
-{
-#define f p_function_list->functions.network
- f.pf_open = NetworkOpen;
-#undef f
-}
+vlc_module_begin();
+ set_description( _("IPv4 network abstraction layer") );
+ set_capability( "network", 50 );
+ set_callbacks( NetOpen, NULL );
+vlc_module_end();
/*****************************************************************************
* BuildAddr: utility function to build a struct sockaddr_in
}
/*****************************************************************************
- * NetworkOpen: wrapper around OpenUDP and OpenTCP
+ * NetOpen: wrapper around OpenUDP and OpenTCP
*****************************************************************************/
-static int NetworkOpen( vlc_object_t * p_this, network_socket_t * p_socket )
+static int NetOpen( vlc_object_t * p_this )
{
+ network_socket_t * p_socket = p_this->p_private;
+
if( p_socket->i_type == NETWORK_UDP )
{
return OpenUDP( p_this, p_socket );
* ipv6.c: IPv6 network abstraction layer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: ipv6.c,v 1.15 2002/07/29 19:01:27 gbazin Exp $
+ * $Id: ipv6.c,v 1.16 2002/07/31 20:56:52 sam Exp $
*
* Authors: Alexis Guillard <alexis.guillard@bt.com>
* Christophe Massiot <massiot@via.ecp.fr>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static void getfunctions( function_list_t * );
-static int NetworkOpen( vlc_object_t *, network_socket_t * );
+static int Open( vlc_object_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("IPv6 network abstraction layer") )
- ADD_CAPABILITY( NETWORK, 40 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- getfunctions( &p_module->p_functions->network );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void getfunctions( function_list_t * p_function_list )
-{
-#define f p_function_list->functions.network
- f.pf_open = NetworkOpen;
-#undef f
-}
+vlc_module_begin();
+ set_description( _("IPv6 network abstraction layer") );
+ set_capability( "network", 40 );
+ set_callbacks( Open, NULL );
+vlc_module_end();
/*****************************************************************************
* BuildAddr: utility function to build a struct sockaddr_in6
}
/*****************************************************************************
- * NetworkOpen: wrapper around OpenUDP and OpenTCP
+ * Open: wrapper around OpenUDP and OpenTCP
*****************************************************************************/
-static int NetworkOpen( vlc_object_t * p_this, network_socket_t * p_socket )
+static int Open( vlc_object_t * p_this )
{
+ network_socket_t * p_socket = p_this->p_private;
+
if( p_socket->i_type == NETWORK_UDP )
{
return OpenUDP( p_this, p_socket );
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int aout_Open ( aout_thread_t *p_aout );
-static int aout_SetFormat ( aout_thread_t *p_aout );
-static int aout_GetBufInfo ( aout_thread_t *p_aout, int i_buffer_info );
-static void aout_Play ( aout_thread_t *p_aout,
- byte_t *buffer, int i_size );
-static void aout_Close ( aout_thread_t *p_aout );
+static int SetFormat ( aout_thread_t * );
+static int GetBufInfo ( aout_thread_t *, int );
+static void Play ( aout_thread_t *, byte_t *, int );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( aout_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.aout.pf_open = aout_Open;
- p_function_list->functions.aout.pf_setformat = aout_SetFormat;
- p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
- p_function_list->functions.aout.pf_play = aout_Play;
- p_function_list->functions.aout.pf_close = aout_Close;
-}
-
-/*****************************************************************************
- * aout_Open : creates a handle and opens an alsa device
+ * Open : creates a handle and opens an alsa device
*****************************************************************************
* This function opens an alsa device, through the alsa API
*****************************************************************************/
-static int aout_Open( aout_thread_t *p_aout )
+int E_(OpenAudio)( vlc_object_t *p_this )
{
+ aout_thread_t *p_aout = (aout_thread_t *)p_this;
int i_ret;
/* allocate structure */
PLUGIN_DISABLE_MMAP ) ) < 0 )
{
msg_Err( p_aout, "unable to disable mmap (%s)", snd_strerror(i_ret) );
- aout_Close( p_aout );
+ Close( p_this );
free( p_aout->p_sys );
return( 1 );
}
+ p_aout->pf_setformat = SetFormat;
+ p_aout->pf_getbufinfo = GetBufInfo;
+ p_aout->pf_play = Play;
+
return( 0 );
}
-
/*****************************************************************************
- * aout_SetFormat : set the audio output format
+ * SetFormat : set the audio output format
*****************************************************************************
* This function prepares the device, sets the rate, format, the mode
* ("play as soon as you have data"), and buffer information.
*****************************************************************************/
-static int aout_SetFormat( aout_thread_t *p_aout )
+static int SetFormat( aout_thread_t *p_aout )
{
int i_ret;
int i_bytes_per_sample;
}
/*****************************************************************************
- * aout_BufInfo: buffer status query
+ * GetBufInfo: buffer status query
*****************************************************************************
* This function returns the number of used byte in the queue.
* It also deals with errors : indeed if the device comes to run out
* of data to play, it switches to the "underrun" status. It has to
* be flushed and re-prepared
*****************************************************************************/
-static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
+static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
{
int i_ret;
snd_pcm_channel_status_t status;
}
/*****************************************************************************
- * aout_Play : plays a sample
+ * Play : plays a sample
*****************************************************************************
* Plays a sample using the snd_pcm_write function from the alsa API
*****************************************************************************/
-static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
int i_ret;
}
/*****************************************************************************
- * aout_Close : close the audio device
+ * CloseAudio: close the audio device
*****************************************************************************/
-static void aout_Close( aout_thread_t *p_aout )
+static void E_(CloseAudio) ( vlc_object_t *p_this )
{
+ aout_thread_t *p_aout = (aout_thread_t *)p_this;
int i_ret;
if( ( i_ret = snd_pcm_close( p_aout->p_sys->p_pcm_handle ) ) < 0 )
#include <vlc/vlc.h>
/*****************************************************************************
- * Capabilities defined in the other files.
+ * External prototypes
******************************************************************************/
-void _M( aout_getfunctions )( function_list_t * p_function_list );
-void _M( vout_getfunctions )( function_list_t * p_function_list );
+int E_(OpenAudio) ( vlc_object_t * );
+void E_(CloseAudio) ( vlc_object_t * );
+
+int E_(OpenVideo) ( vlc_object_t * );
+void E_(CloseVideo) ( vlc_object_t * );
/*****************************************************************************
- * Building configuration tree
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("QNX RTOS module") )
- ADD_CAPABILITY( VOUT, 100 )
- ADD_CAPABILITY( AOUT, 50 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( aout_getfunctions )( &p_module->p_functions->aout );
- _M( vout_getfunctions )( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("QNX RTOS module") );
+ add_submodule();
+ set_capability( "video output", 100 );
+ set_callbacks( E_(OpenVideo), E_(CloseVideo) );
+ add_submodule();
+ set_capability( "audio output", 100 );
+ set_callbacks( E_(OpenAudio), E_(CloseAudio) );
+vlc_module_end();
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int vout_Create ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static int vout_Manage ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
+static int QNXInit ( vout_thread_t * );
+static void QNXEnd ( vout_thread_t * );
+static int QNXManage ( vout_thread_t * );
+static void QNXDisplay ( vout_thread_t *, picture_t * );
static int QNXInitDisplay ( vout_thread_t * );
static int QNXCreateWnd ( vout_thread_t * );
static int NewPicture ( vout_thread_t *, picture_t *, int );
static void FreePicture ( vout_thread_t *, picture_t * );
-static int ResizeOverlayOutput ( vout_thread_t * );
+static int ResizeOverlayOutput ( vout_thread_t * );
static void SetPalette ( vout_thread_t *, u16 *, u16 *, u16 * );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( vout_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocate QNX video thread output method
+ * OpenVideo: allocate QNX video thread output method
*****************************************************************************
* This function allocate and initialize a QNX vout method. It uses some of the
* vout properties to choose the window size, and change them according to the
* actual properties of the display.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
-{
+int E_(OpenVideo) ( vlc_object_t *p_this )
+{
+ vout_thread_t * p_vout = (vout_thread_t *)p_this;
+
/* init connection to photon */
if( PtInit( "/dev/photon" ) != 0 )
{
return( 1 );
}
+ p_vout->pf_init = QNXInit;
+ p_vout->pf_end = QNXEnd;
+ p_vout->pf_manage = QNXManage;
+ p_vout->pf_render = NULL;
+ p_vout->pf_display = QNXDisplay;
+
return( 0 );
}
/*****************************************************************************
- * vout_Init: initialize QNX video thread output method
+ * QNXInit: initialize QNX video thread output method
*****************************************************************************
* This function create the buffers needed by the output thread. It is called
* at the beginning of the thread, but also each time the window is resized.
*****************************************************************************/
-static int vout_Init( vout_thread_t *p_vout )
+static int QNXInit( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic;
}
/*****************************************************************************
- * vout_End: terminate QNX video thread output method
+ * QNXEnd: terminate QNX video thread output method
*****************************************************************************
- * Destroy the buffers created by vout_Init. It is called at the end of
+ * Destroy the buffers created by QNXInit. It is called at the end of
* the thread, but also each time the window is resized.
*****************************************************************************/
-static void vout_End( vout_thread_t *p_vout )
+static void QNXEnd( vout_thread_t *p_vout )
{
int i_index;
}
/*****************************************************************************
- * vout_Destroy: destroy QNX video thread output method
+ * CloseVideo: destroy QNX video thread output method
*****************************************************************************
- * Terminate an output method created by vout_CreateOutputMethod
+ * Terminate an output method created by QNXCreate
*****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
-{
+void E_(CloseVideo) ( vlc_object_t *p_this )
+{
+ vout_thread_t * p_vout = (vout_thread_t *)p_this;
+
/* destroy the window */
QNXDestroyWnd( p_vout );
}
/*****************************************************************************
- * vout_Manage: handle QNX events
+ * QNXManage: handle QNX events
*****************************************************************************
* This function should be called regularly by video output thread. It allows
* window resizing. It returns a non null value on error.
*****************************************************************************/
-static int vout_Manage( vout_thread_t *p_vout )
+static int QNXManage( vout_thread_t *p_vout )
{
int i_ev, i_buflen;
PhEvent_t *p_event;
p_vout->output.i_height = p_vout->p_sys->dim.h;
p_vout->i_changes |= VOUT_YUV_CHANGE;
- vout_End( p_vout );
- if( vout_Init( p_vout ) )
+ QNXEnd( p_vout );
+ if( QNXInit( p_vout ) )
{
msg_Err( p_vout, "cannot resize display" );
return( 1 );
}
/*****************************************************************************
- * vout_Render: render previously calculated output
- *****************************************************************************/
-static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
-}
-
-/*****************************************************************************
- * vout_Display: displays previously rendered output
+ * QNXDisplay: displays previously rendered output
*****************************************************************************
* This function send the currently rendered image to QNX server, wait until
* it is displayed and switch the two rendering buffer, preparing next frame.
*****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+static void QNXDisplay( vout_thread_t *p_vout, picture_t *p_pic )
{
if( p_vout->p_sys->i_mode == MODE_NORMAL_MEM ||
p_vout->p_sys->i_mode == MODE_SHARED_MEM )
* intf_qt.cpp: Qt interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_qt.cpp,v 1.17 2002/07/20 18:01:43 sam Exp $
+ * $Id: intf_qt.cpp,v 1.18 2002/07/31 20:56:52 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
};
/*****************************************************************************
- * Local prototypes.
+ * Local prototype
*****************************************************************************/
-static int intf_Open ( intf_thread_t *p_intf );
-static void intf_Close ( intf_thread_t *p_intf );
-static void intf_Run ( intf_thread_t *p_intf );
+static void Run ( intf_thread_t *p_intf );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Open: initialize and create window
*****************************************************************************/
-extern "C"
-{
-
-void _M( intf_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.intf.pf_open = intf_Open;
- p_function_list->functions.intf.pf_close = intf_Close;
- p_function_list->functions.intf.pf_run = intf_Run;
-}
-
-}
-
-/*****************************************************************************
- * intf_Open: initialize and create window
- *****************************************************************************/
-static int intf_Open( intf_thread_t *p_intf )
+int E_(Open) ( vlc_object_t *p_this )
{
+ intf_thread_t *p_intf = (intf_thread_t*) p_this;
char *pp_argv[] = { "" };
int i_argc = 1;
return 1;
}
+ p_intf->pf_run = Run;
+
/* Create the C++ objects */
p_intf->p_sys->p_app = new QApplication( i_argc, pp_argv );
p_intf->p_sys->p_window = new IntfWindow( p_intf );
}
/*****************************************************************************
- * intf_Close: destroy interface window
+ * Close: destroy interface window
*****************************************************************************/
-static void intf_Close( intf_thread_t *p_intf )
+void E_(Close) ( vlc_object_t *p_this )
{
+ intf_thread_t *p_intf = (intf_thread_t*) p_this;
+
if( p_intf->p_sys->p_input )
{
vlc_object_release( p_intf->p_sys->p_input );
}
/*****************************************************************************
- * intf_Run: Qt thread
+ * Run: Qt thread
*****************************************************************************
* This part of the interface is in a separate thread so that we can call
* exec() from within it without annoying the rest of the program.
*****************************************************************************/
-static void intf_Run( intf_thread_t *p_intf )
+static void Run( intf_thread_t *p_intf )
{
p_intf->p_sys->p_window->show();
* qt.cpp : Qt plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: qt.cpp,v 1.11 2002/06/01 12:32:00 sam Exp $
+ * $Id: qt.cpp,v 1.12 2002/07/31 20:56:52 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include <vlc/vlc.h>
-extern "C"
-{
/*****************************************************************************
- * Capabilities defined in the other files.
+ * External prototypes
*****************************************************************************/
-void _M( intf_getfunctions )( function_list_t * p_function_list );
+int E_(Open) ( vlc_object_t * );
+void E_(Close) ( vlc_object_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("Qt interface module") )
-#ifndef WIN32
- if( getenv( "DISPLAY" ) == NULL )
- {
- ADD_CAPABILITY( INTF, 7 )
- }
- else
+vlc_module_begin();
+#ifdef WIN32
+ int i = 80;
+#else
+ int i = getenv( "DISPLAY" ) == NULL ? 7 : 80;
#endif
- {
- ADD_CAPABILITY( INTF, 80 )
- }
- ADD_PROGRAM( "qvlc" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( intf_getfunctions )( &p_module->p_functions->intf );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+ set_description( _("Qt interface module") );
+ set_capability( "interface", i );
+ set_program( "qvlc" );
+ set_callbacks( E_(Open), E_(Close) );
+vlc_module_end();
-} /* extern "C" */
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int SatelliteOpen ( input_thread_t * );
-static void SatelliteClose ( input_thread_t * );
static ssize_t SatelliteRead( input_thread_t * p_input, byte_t * p_buffer,
size_t i_len );
static int SatelliteSetArea ( input_thread_t *, input_area_t * );
static void SatelliteSeek ( input_thread_t *, off_t );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Open: open the dvr device
*****************************************************************************/
-void _M( access_getfunctions )( function_list_t * p_function_list )
-{
-#define access p_function_list->functions.access
- access.pf_open = SatelliteOpen;
- access.pf_close = SatelliteClose;
- access.pf_read = SatelliteRead;
- access.pf_set_area = SatelliteSetArea;
- access.pf_set_program = SatelliteSetProgram;
- access.pf_seek = SatelliteSeek;
-#undef access
-}
-
-/*****************************************************************************
- * SatelliteOpen : open the dvr device
- *****************************************************************************/
-static int SatelliteOpen( input_thread_t * p_input )
+int E_(Open) ( vlc_object_t *p_this )
{
+ input_thread_t * p_input = (input_thread_t *)p_this;
input_socket_t * p_satellite;
char * psz_parser;
char * psz_next;
return( -1 );
}
+ p_input->pf_read = SatelliteRead;
+ p_input->pf_set_program = SatelliteSetProgram;
+ p_input->pf_set_area = SatelliteSetArea;
+ p_input->pf_seek = SatelliteSeek;
+
i_freq = (int)strtol( psz_parser, &psz_next, 10 );
if( *psz_next )
}
/*****************************************************************************
- * SatelliteClose : Closes the device
+ * Close : Close the device
*****************************************************************************/
-static void SatelliteClose( input_thread_t * p_input )
+void E_(Close) ( vlc_object_t *p_this )
{
+ input_thread_t * p_input = (input_thread_t *)p_this;
input_socket_t * p_satellite;
int i_es_index;
#include <vlc/vlc.h>
/*****************************************************************************
- * Capabilities defined in the other files.
+ * External prototypes
*****************************************************************************/
-void _M( access_getfunctions )( function_list_t * p_function_list );
-void _M( demux_getfunctions )( function_list_t * p_function_list );
+int E_(Open) ( vlc_object_t * );
+void E_(Close) ( vlc_object_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
#define FREQ_TEXT N_("satellite default transponder frequency")
#define LNB_SLOF_TEXT N_("antenna lnb_slof (kHz)")
#define LNB_SLOF_LONGTEXT ""
-MODULE_CONFIG_START
- ADD_CATEGORY_HINT( N_("Input"), NULL )
- ADD_INTEGER ( "frequency", 11954, NULL, FREQ_TEXT, FREQ_LONGTEXT )
- ADD_INTEGER ( "polarization", 0, NULL, POL_TEXT, POL_LONGTEXT )
- ADD_INTEGER ( "fec", 3, NULL, FEC_TEXT, FEC_LONGTEXT )
- ADD_INTEGER ( "symbol-rate", 27500, NULL, SRATE_TEXT, SRATE_LONGTEXT )
- ADD_BOOL ( "diseqc", 0, NULL, DISEQC_TEXT, DISEQC_LONGTEXT )
- ADD_INTEGER ( "lnb-lof1", 10000, NULL, LNB_LOF1_TEXT, LNB_LOF1_LONGTEXT )
- ADD_INTEGER ( "lnb-lof2", 10000, NULL, LNB_LOF2_TEXT, LNB_LOF2_LONGTEXT )
- ADD_INTEGER ( "lnb-slof", 11700, NULL, LNB_SLOF_TEXT, LNB_SLOF_LONGTEXT )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("satellite input module") )
- ADD_CAPABILITY( ACCESS, 0 )
- ADD_SHORTCUT( "sat" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( access_getfunctions )( &p_module->p_functions->access );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( N_("Input"), NULL );
+ add_integer( "frequency", 11954, NULL, FREQ_TEXT, FREQ_LONGTEXT );
+ add_integer( "polarization", 0, NULL, POL_TEXT, POL_LONGTEXT );
+ add_integer( "fec", 3, NULL, FEC_TEXT, FEC_LONGTEXT );
+ add_integer( "symbol-rate", 27500, NULL, SRATE_TEXT, SRATE_LONGTEXT );
+ add_bool( "diseqc", 0, NULL, DISEQC_TEXT, DISEQC_LONGTEXT );
+ add_integer( "lnb-lof1", 10000, NULL,
+ LNB_LOF1_TEXT, LNB_LOF1_LONGTEXT );
+ add_integer( "lnb-lof2", 10000, NULL,
+ LNB_LOF2_TEXT, LNB_LOF2_LONGTEXT );
+ add_integer( "lnb-slof", 11700, NULL,
+ LNB_SLOF_TEXT, LNB_SLOF_LONGTEXT );
+ set_description( _("satellite input module") );
+ set_capability( "access", 0 );
+ add_shortcut( "sat" );
+ set_callbacks( E_(Open), E_(Close) );
+vlc_module_end();
* aout_sdl.c : audio sdl functions library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: aout_sdl.c,v 1.30 2002/07/20 18:01:43 sam Exp $
+ * $Id: aout_sdl.c,v 1.31 2002/07/31 20:56:52 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
};
/*****************************************************************************
- * Local prototypes.
+ * Local prototypes
*****************************************************************************/
-static int aout_Open ( aout_thread_t *p_aout );
-static int aout_SetFormat ( aout_thread_t *p_aout );
-static int aout_GetBufInfo ( aout_thread_t *p_aout, int i_buffer_info );
-static void aout_Play ( aout_thread_t *p_aout,
- byte_t *buffer, int i_size );
-static void aout_Close ( aout_thread_t *p_aout );
+static int SetFormat ( aout_thread_t * );
+static int GetBufInfo ( aout_thread_t *, int );
+static void Play ( aout_thread_t *, byte_t *, int );
-static void aout_SDLCallback ( void *userdata, Uint8 *stream, int len );
+static void SDLCallback ( void *, Uint8 *, int );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( aout_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.aout.pf_open = aout_Open;
- p_function_list->functions.aout.pf_setformat = aout_SetFormat;
- p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
- p_function_list->functions.aout.pf_play = aout_Play;
- p_function_list->functions.aout.pf_close = aout_Close;
-}
-
-/*****************************************************************************
- * aout_Open: open the audio device
+ * OpenAudio: open the audio device
*****************************************************************************
* This function opens the dsp as a usual non-blocking write-only file, and
* modifies the p_aout->i_fd with the file's descriptor.
*****************************************************************************/
-static int aout_Open( aout_thread_t *p_aout )
+int E_(OpenAudio) ( vlc_object_t *p_this )
{
+ aout_thread_t * p_aout = (aout_thread_t *)p_this;
+
SDL_AudioSpec desired;
if( SDL_WasInit( SDL_INIT_AUDIO ) != 0 )
return( 1 );
}
+ p_aout->pf_setformat = SetFormat;
+ p_aout->pf_getbufinfo = GetBufInfo;
+ p_aout->pf_play = Play;
+
/* Allocate structure */
p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
desired.format = AUDIO_S16LSB; /* stereo 16 bits */
#endif
desired.channels = p_aout->i_channels;
- desired.callback = aout_SDLCallback;
+ desired.callback = SDLCallback;
desired.userdata = p_aout->p_sys;
desired.samples = 1024;
}
/*****************************************************************************
- * aout_SetFormat: reset the audio device and sets its format
+ * SetFormat: reset the audio device and sets its format
*****************************************************************************
* This functions resets the audio device, tries to initialize the output
* format with the value contained in the dsp structure, and if this value
* could not be set, the default value returned by ioctl is set. It then
* does the same for the stereo mode, and for the output rate.
*****************************************************************************/
-static int aout_SetFormat( aout_thread_t *p_aout )
+static int SetFormat( aout_thread_t *p_aout )
{
/* TODO: finish and clean this */
SDL_AudioSpec desired;
desired.format = AUDIO_S16LSB; /* stereo 16 bits */
#endif
desired.channels = p_aout->i_channels;
- desired.callback = aout_SDLCallback;
+ desired.callback = SDLCallback;
desired.userdata = p_aout->p_sys;
desired.samples = 2048;
}
/*****************************************************************************
- * aout_GetBufInfo: buffer status query
+ * GetBufInfo: buffer status query
*****************************************************************************
* returns the number of bytes in the audio buffer compared to the size of
* i_buffer_limit...
*****************************************************************************/
-static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
+static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
{
if(i_buffer_limit > p_aout->p_sys->i_audio_end)
{
}
/*****************************************************************************
- * aout_Play: play a sound samples buffer
+ * Play: play a sound samples buffer
*****************************************************************************
* This function writes a buffer of i_length bytes in the dsp
*****************************************************************************/
-static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
byte_t * audio_buf = p_aout->p_sys->audio_buf;
}
/*****************************************************************************
- * aout_Close: close the audio device
+ * CloseAudio: close the audio device
*****************************************************************************/
-static void aout_Close( aout_thread_t *p_aout )
+void E_(CloseAudio) ( vlc_object_t *p_this )
{
+ aout_thread_t * p_aout = (aout_thread_t *)p_this;
+
if( p_aout->p_sys->b_active )
{
SDL_PauseAudio( 1 ); /* pause audio */
}
/*****************************************************************************
- * aout_SDLCallback: what to do once SDL has played sound samples
+ * SDLCallback: what to do once SDL has played sound samples
*****************************************************************************/
-static void aout_SDLCallback( void *userdata, byte_t *stream, int len )
+static void SDLCallback( void *userdata, byte_t *stream, int len )
{
aout_sys_t * p_sys = userdata;
* sdl.c : SDL plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: sdl.c,v 1.21 2002/06/01 12:32:00 sam Exp $
+ * $Id: sdl.c,v 1.22 2002/07/31 20:56:52 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Pierre Baillet <oct@zoy.org>
#include <vlc/vlc.h>
/*****************************************************************************
- * Capabilities defined in the other files.
+ * External prototypes
*****************************************************************************/
-void _M( aout_getfunctions )( function_list_t * p_function_list );
-void _M( vout_getfunctions )( function_list_t * p_function_list );
+int E_(OpenVideo) ( vlc_object_t * );
+void E_(CloseVideo) ( vlc_object_t * );
+
+int E_(OpenAudio) ( vlc_object_t * );
+void E_(CloseAudio) ( vlc_object_t * );
/*****************************************************************************
- * Building configuration tree
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("Simple DirectMedia Layer module") )
- ADD_CAPABILITY( AOUT, 40 )
- ADD_CAPABILITY( VOUT, 100 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( aout_getfunctions )( &p_module->p_functions->aout );
- _M( vout_getfunctions )( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("Simple DirectMedia Layer module") );
+ add_submodule();
+ set_capability( "video output", 40 );
+ set_callbacks( E_(OpenVideo), E_(CloseVideo) );
+ add_submodule();
+ set_capability( "audio output", 40 );
+ set_callbacks( E_(OpenAudio), E_(CloseAudio) );
+vlc_module_end();
* vout_sdl.c: SDL video output display method
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: vout_sdl.c,v 1.97 2002/07/23 00:39:17 sam Exp $
+ * $Id: vout_sdl.c,v 1.98 2002/07/31 20:56:52 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Pierre Baillet <oct@zoy.org>
};
/*****************************************************************************
- * Local prototypes.
+ * Local prototypes
*****************************************************************************/
-static int vout_Create ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static int vout_Manage ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
+static int Init ( vout_thread_t * );
+static void End ( vout_thread_t * );
+static int Manage ( vout_thread_t * );
+static void Display ( vout_thread_t *, picture_t * );
static int OpenDisplay ( vout_thread_t * );
static void CloseDisplay ( vout_thread_t * );
static void SetPalette ( vout_thread_t *, u16 *, u16 *, u16 * );
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( vout_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocate SDL video thread output method
+ * OpenVideo: allocate SDL video thread output method
*****************************************************************************
* This function allocate and initialize a SDL vout method. It uses some of the
* vout properties to choose the correct mode, and change them according to the
* mode actually used.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
+int E_(OpenVideo) ( vlc_object_t *p_this )
{
+ vout_thread_t * p_vout = (vout_thread_t *)p_this;
+
#ifdef HAVE_SETENV
char *psz_method;
#endif
return( 1 );
}
+ p_vout->pf_init = Init;
+ p_vout->pf_end = End;
+ p_vout->pf_manage = Manage;
+ p_vout->pf_render = NULL;
+ p_vout->pf_display = Display;
+
#ifdef HAVE_SETENV
psz_method = config_GetPsz( p_vout, "vout" );
if( psz_method )
}
/*****************************************************************************
- * vout_Init: initialize SDL video thread output method
+ * Init: initialize SDL video thread output method
*****************************************************************************
* This function initialize the SDL display device.
*****************************************************************************/
-static int vout_Init( vout_thread_t *p_vout )
+static int Init( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic;
}
/*****************************************************************************
- * vout_End: terminate Sys video thread output method
+ * End: terminate Sys video thread output method
*****************************************************************************
- * Terminate an output method created by vout_SDLCreate
+ * Terminate an output method created by OpenVideo
*****************************************************************************/
-static void vout_End( vout_thread_t *p_vout )
+static void End( vout_thread_t *p_vout )
{
int i_index;
}
/*****************************************************************************
- * vout_Destroy: destroy Sys video thread output method
+ * CloseVideo: destroy Sys video thread output method
*****************************************************************************
* Terminate an output method created by vout_SDLCreate
*****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
+void E_(CloseVideo) ( vlc_object_t *p_this )
{
- CloseDisplay( p_vout );
+ vout_thread_t * p_vout = (vout_thread_t *)p_this;
+ CloseDisplay( p_vout );
SDL_QuitSubSystem( SDL_INIT_VIDEO );
free( p_vout->p_sys );
}
/*****************************************************************************
- * vout_Manage: handle Sys events
+ * Manage: handle Sys events
*****************************************************************************
* This function should be called regularly by video output thread. It returns
* a non null value if an error occured.
*****************************************************************************/
-static int vout_Manage( vout_thread_t *p_vout )
+static int Manage( vout_thread_t *p_vout )
{
SDL_Event event; /* SDL event */
}
/*****************************************************************************
- * vout_Render: render previously calculated output
- *****************************************************************************/
-static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
-}
-
-/*****************************************************************************
- * vout_Display: displays previously rendered output
+ * Display: displays previously rendered output
*****************************************************************************
* This function sends the currently rendered image to the display.
*****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+static void Display( vout_thread_t *p_vout, picture_t *p_pic )
{
int x, y, w, h;
SDL_Rect disp;
* spu_decoder.c : spu decoder thread
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: spu_decoder.c,v 1.30 2002/07/23 00:39:17 sam Exp $
+ * $Id: spu_decoder.c,v 1.31 2002/07/31 20:56:52 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Rudolf Cornelissen <rag.cornelissen@inter.nl.net>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int decoder_Probe ( vlc_fourcc_t * );
-static int decoder_Run ( decoder_fifo_t * );
+static int OpenDecoder ( vlc_object_t * );
+static int RunDecoder ( decoder_fifo_t * );
static int InitThread ( spudec_thread_t * );
static void EndThread ( spudec_thread_t * );
static int ParseRLE ( spudec_thread_t *, subpicture_t *, u8 * );
static void RenderSPU ( vout_thread_t *, picture_t *,
const subpicture_t * );
-
-/*****************************************************************************
- * Capabilities
- *****************************************************************************/
-void _M( spudec_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.dec.pf_probe = decoder_Probe;
- p_function_list->functions.dec.pf_run = decoder_Run;
-}
-
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor.
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("DVD subtitles decoder module") )
- ADD_CAPABILITY( DECODER, 50 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( spudec_getfunctions )( &p_module->p_functions->dec );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("DVD subtitles decoder module") );
+ set_capability( "decoder", 50 );
+ set_callbacks( OpenDecoder, NULL );
+vlc_module_end();
/*****************************************************************************
- * decoder_Probe: probe the decoder and return score
+ * OpenDecoder: probe the decoder and return score
*****************************************************************************
* Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
-static int decoder_Probe( vlc_fourcc_t *pi_type )
+static int OpenDecoder( vlc_object_t *p_this )
{
- return ( *pi_type == VLC_FOURCC('s','p','u',' ') ) ? 0 : -1;
+ decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
+
+ if( p_fifo->i_fourcc == VLC_FOURCC('s','p','u',' ') )
+ {
+ p_fifo->pf_run = RunDecoder;
+ return VLC_SUCCESS;
+ }
+
+ return VLC_EGENERIC;
}
/*****************************************************************************
- * decoder_Run: this function is called just after the thread is created
+ * RunDecoder: this function is called just after the thread is created
*****************************************************************************/
-static int decoder_Run( decoder_fifo_t * p_fifo )
+static int RunDecoder( decoder_fifo_t * p_fifo )
{
spudec_thread_t * p_spudec;
* logger.c : file logging plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: logger.c,v 1.13 2002/07/20 18:01:43 sam Exp $
+ * $Id: logger.c,v 1.14 2002/07/31 20:56:52 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
};
/*****************************************************************************
- * Local prototypes.
+ * Local prototypes
*****************************************************************************/
-static void intf_getfunctions ( function_list_t * p_function_list );
-static int intf_Open ( intf_thread_t *p_intf );
-static void intf_Close ( intf_thread_t *p_intf );
-static void intf_Run ( intf_thread_t *p_intf );
+static int Open ( vlc_object_t * );
+static void Close ( vlc_object_t * );
+static void Run ( intf_thread_t * );
static void FlushQueue ( msg_subscription_t *, FILE *, int );
static void TextPrint ( const msg_item_t *, FILE * );
static void HtmlPrint ( const msg_item_t *, FILE * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
- ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
- ADD_STRING( "logfile", NULL, NULL, N_("log filename"), N_("Specify the log filename.") )
- ADD_STRING( "logmode", NULL, NULL, N_("log format"), N_("Specify the log format. Available choices are \"text\" (default) and \"html\"") )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("file logging interface module") )
- ADD_CAPABILITY( INTF, 1 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- intf_getfunctions( &p_module->p_functions->intf );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void intf_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.intf.pf_open = intf_Open;
- p_function_list->functions.intf.pf_close = intf_Close;
- p_function_list->functions.intf.pf_run = intf_Run;
-}
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_string( "logfile", NULL, NULL, N_("log filename"), N_("Specify the log filename.") );
+ add_string( "logmode", NULL, NULL, N_("log format"), N_("Specify the log format. Available choices are \"text\" (default) and \"html\"") );
+ set_description( _("file logging interface module") );
+ set_capability( "interface", 0 );
+ set_callbacks( Open, Close );
+vlc_module_end();
/*****************************************************************************
- * intf_Open: initialize and create stuff
+ * Open: initialize and create stuff
*****************************************************************************/
-static int intf_Open( intf_thread_t *p_intf )
-{
+static int Open( vlc_object_t *p_this )
+{
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
char *psz_mode, *psz_file;
#ifdef WIN32
}
/*****************************************************************************
- * intf_Close: destroy interface stuff
+ * Close: destroy interface stuff
*****************************************************************************/
-static void intf_Close( intf_thread_t *p_intf )
-{
+static void Close( vlc_object_t *p_this )
+{
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
+
/* Flush the queue and unsubscribe from the message queue */
FlushQueue( p_intf->p_sys->p_sub, p_intf->p_sys->p_file,
p_intf->p_sys->i_mode );
}
/*****************************************************************************
- * intf_Run: rc thread
+ * Run: rc thread
*****************************************************************************
* This part of the interface is in a separate thread so that we can call
* exec() from within it without annoying the rest of the program.
*****************************************************************************/
-static void intf_Run( intf_thread_t *p_intf )
+static void Run( intf_thread_t *p_intf )
{
while( !p_intf->b_die )
{
* ncurses.c : NCurses plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: ncurses.c,v 1.19 2002/07/20 18:01:43 sam Exp $
+ * $Id: ncurses.c,v 1.20 2002/07/31 20:56:52 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static void intf_getfunctions ( function_list_t * );
-static int intf_Open ( intf_thread_t * );
-static void intf_Close ( intf_thread_t * );
-static void intf_Run ( intf_thread_t * );
-
-static void FullScreen ( intf_thread_t * );
-static void Play ( intf_thread_t * );
-static void Stop ( intf_thread_t * );
+static int Open ( vlc_object_t * );
+static void Close ( vlc_object_t * );
+
+static void Run ( intf_thread_t * );
+static void FullScreen ( intf_thread_t * );
+static void Play ( intf_thread_t * );
+static void Stop ( intf_thread_t * );
static void Next ( intf_thread_t * );
static void Eject ( intf_thread_t * );
static void Pause ( intf_thread_t * );
static void ManageSlider ( intf_thread_t * );
/*****************************************************************************
- * Building configuration tree
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("ncurses interface module") )
- ADD_CAPABILITY( INTF, 10 )
- ADD_SHORTCUT( "curses" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- intf_getfunctions( &p_module->p_functions->intf );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("ncurses interface module") );
+ set_capability( "interface", 10 );
+ set_callbacks( Open, Close );
+ add_shortcut( "curses" );
+vlc_module_end();
/*****************************************************************************
* intf_sys_t: description and status of ncurses interface
*****************************************************************************/
struct intf_sys_t
{
- /* special actions */
- vlc_mutex_t change_lock; /* the change lock */
+ input_thread_t * p_input;
float f_slider_state;
float f_slider_state_old;
};
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Open: initialize and create window
*****************************************************************************/
-static void intf_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.intf.pf_open = intf_Open;
- p_function_list->functions.intf.pf_close = intf_Close;
- p_function_list->functions.intf.pf_run = intf_Run;
-}
+static int Open( vlc_object_t *p_this )
+{
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
-/*****************************************************************************
- * intf_Open: initialize and create window
- *****************************************************************************/
-static int intf_Open( intf_thread_t *p_intf )
-{
/* Allocate instance and initialize some members */
p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
return( 1 );
}
- memset ( p_intf->p_sys, 0, sizeof ( intf_sys_t ) );
+ p_intf->p_sys->p_input = NULL;
+
+ p_intf->pf_run = Run;
/* Initialize the curses library */
initscr();
}
/*****************************************************************************
- * intf_Close: destroy interface window
+ * Close: destroy interface window
*****************************************************************************/
-static void intf_Close( intf_thread_t *p_intf )
-{
+static void Close( vlc_object_t *p_this )
+{
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
+
+ if( p_intf->p_sys->p_input )
+ {
+ vlc_object_release( p_intf->p_sys->p_input );
+ }
+
/* Close the ncurses interface */
endwin();
}
/*****************************************************************************
- * intf_Run: ncurses thread
+ * Run: ncurses thread
*****************************************************************************/
-static void intf_Run( intf_thread_t *p_intf )
+static void Run( intf_thread_t *p_intf )
{
signed char i_key;
time_t t_last_refresh;
while( !p_intf->b_die )
{
- p_intf->pf_manage( p_intf );
-
msleep( INTF_IDLE_SLEEP );
+ /* Update the input */
+ if( p_intf->p_sys->p_input == NULL )
+ {
+ p_intf->p_sys->p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT,
+ FIND_ANYWHERE );
+ }
+ else if( p_intf->p_sys->p_input->b_dead )
+ {
+ vlc_object_release( p_intf->p_sys->p_input );
+ p_intf->p_sys->p_input = NULL;
+ }
+
while( (i_key = getch()) != -1 )
{
/*
row++;
move ( row, 0 );
- if ( p_intf->p_vlc->p_input_bank->pp_input[0] != NULL )
+ if ( p_intf->p_sys->p_input != NULL )
{
PrintFullLine ( " DVD Chapter:%3d DVD Title:%3d",
- p_intf->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_part,
- p_intf->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_id );
+ p_intf->p_sys->p_input->stream.p_selected_area->i_part,
+ p_intf->p_sys->p_input->stream.p_selected_area->i_id );
}
row++;
static void FullScreen( intf_thread_t *p_intf )
{
- vlc_mutex_lock( &p_intf->p_vlc->p_vout_bank->pp_vout[0]->change_lock );
+ vout_thread_t *p_vout;
- p_intf->p_vlc->p_vout_bank->pp_vout[0]->i_changes |= VOUT_FULLSCREEN_CHANGE;
+ p_vout = vlc_object_find( p_intf->p_sys->p_input,
+ VLC_OBJECT_VOUT, FIND_CHILD );
+ if( p_vout == NULL )
+ {
+ return;
+ }
- vlc_mutex_unlock( &p_intf->p_vlc->p_vout_bank->pp_vout[0]->change_lock );
+ p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
+ vlc_object_release( p_vout );
}
static void Eject ( intf_thread_t *p_intf )
{
- char *psz_device = NULL;
- char *psz_parser;
+ char *psz_device = NULL, *psz_parser, *psz_name;
/*
* Get the active input
* If it's neither a VCD nor a DVD, then return
*/
- /*
- * Don't really know if I must lock the stuff here, we're using it read-only
- */
+ playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+ FIND_ANYWHERE );
+
+ if( p_playlist == NULL )
+ {
+ return;
+ }
+
+ vlc_mutex_lock( &p_playlist->object_lock );
- if( p_intf->p_vlc->p_playlist->current.psz_name != NULL)
+ if( p_playlist->i_index < 0 )
+ {
+ vlc_mutex_unlock( &p_playlist->object_lock );
+ vlc_object_release( p_playlist );
+ return;
+ }
+
+ psz_name = p_playlist->pp_items[ p_playlist->i_index ]->psz_name;
+
+ if( psz_name )
{
- if( !strncmp(p_intf->p_vlc->p_playlist->current.psz_name, "dvd:", 4) )
+ if( !strncmp(psz_name, "dvd:", 4) )
{
- switch( p_intf->p_vlc->p_playlist->current.psz_name[4] )
+ switch( psz_name[4] )
{
case '\0':
case '@':
break;
default:
/* Omit the first 4 characters */
- psz_device = strdup( p_intf->p_vlc->p_playlist->current.psz_name + 4 );
+ psz_device = strdup( psz_name + 4 );
break;
}
}
- else if( !strncmp(p_intf->p_vlc->p_playlist->current.psz_name, "vcd:", 4) )
+ else if( !strncmp(psz_name, "vcd:", 4) )
{
- switch( p_intf->p_vlc->p_playlist->current.psz_name[4] )
+ switch( psz_name[4] )
{
case '\0':
case '@':
break;
default:
/* Omit the first 4 characters */
- psz_device = strdup( p_intf->p_vlc->p_playlist->current.psz_name + 4 );
+ psz_device = strdup( psz_name + 4 );
break;
}
}
else
{
- psz_device = strdup( p_intf->p_vlc->p_playlist->current.psz_name );
+ psz_device = strdup( psz_name );
}
}
+ vlc_mutex_unlock( &p_playlist->object_lock );
+ vlc_object_release( p_playlist );
+
if( psz_device == NULL )
{
return;
}
/* If there's a stream playing, we aren't allowed to eject ! */
- if( p_intf->p_vlc->p_input_bank->pp_input[0] == NULL )
+ if( p_intf->p_sys->p_input == NULL )
{
//X msg_Dbg( p_input, "ejecting %s", psz_device );
static void Play ( intf_thread_t *p_intf )
{
- if( p_intf->p_vlc->p_input_bank->pp_input[0] != NULL )
+ playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+ FIND_ANYWHERE );
+ if( p_playlist )
{
- input_SetStatus( p_intf->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
- p_intf->p_vlc->p_playlist->b_stopped = 0;
- }
- else
- {
- vlc_mutex_lock( &p_intf->p_vlc->p_playlist->change_lock );
+ vlc_mutex_lock( &p_playlist->object_lock );
- if( p_intf->p_vlc->p_playlist->b_stopped )
+ if( p_playlist->i_size )
{
- if( p_intf->p_vlc->p_playlist->i_size )
- {
- vlc_mutex_unlock( &p_intf->p_vlc->p_playlist->change_lock );
- intf_PlaylistJumpto( p_intf->p_vlc->p_playlist,
- p_intf->p_vlc->p_playlist->i_index );
- }
- else
- {
- vlc_mutex_unlock( &p_intf->p_vlc->p_playlist->change_lock );
- }
+ vlc_mutex_unlock( &p_playlist->object_lock );
+ playlist_Play( p_playlist );
+ vlc_object_release( p_playlist );
}
else
{
-
- vlc_mutex_unlock( &p_intf->p_vlc->p_playlist->change_lock );
+ vlc_mutex_unlock( &p_playlist->object_lock );
+ vlc_object_release( p_playlist );
}
-
}
}
static void Pause ( intf_thread_t *p_intf )
{
- if( p_intf->p_vlc->p_input_bank->pp_input[0] != NULL )
+ if( p_intf->p_sys->p_input == NULL )
{
- if ( p_intf->p_vlc->p_input_bank->pp_input[0]->i_status & INPUT_STATUS_PLAY )
- {
- input_SetStatus( p_intf->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PAUSE );
-
- vlc_mutex_lock( &p_intf->p_vlc->p_playlist->change_lock );
- p_intf->p_vlc->p_playlist->b_stopped = 0;
- vlc_mutex_unlock( &p_intf->p_vlc->p_playlist->change_lock );
- }
- else
- {
- Play ( p_intf );
- }
+ return;
}
+
+ input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PAUSE );
+
+ return;
}
static void Stop ( intf_thread_t *p_intf )
{
- if( p_intf->p_vlc->p_input_bank->pp_input[0] != NULL )
+ playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+ FIND_ANYWHERE );
+ if( p_playlist == NULL )
{
- /* end playing item */
- p_intf->p_vlc->p_input_bank->pp_input[0]->b_eof = 1;
-
- /* update playlist */
- vlc_mutex_lock( &p_intf->p_vlc->p_playlist->change_lock );
-
- p_intf->p_vlc->p_playlist->i_index--;
- p_intf->p_vlc->p_playlist->b_stopped = 1;
+ return;
+ }
- vlc_mutex_unlock( &p_intf->p_vlc->p_playlist->change_lock );
+ playlist_Stop( p_playlist );
+ vlc_object_release( p_playlist );
- }
+ return;
}
static void Next ( intf_thread_t *p_intf )
int i_id;
input_area_t * p_area;
- i_id = p_intf->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_id+1;
+ i_id = p_intf->p_sys->p_input->stream.p_selected_area->i_id+1;
- if ( i_id < p_intf->p_vlc->p_input_bank->pp_input[0]->stream.i_area_nb )
+ if ( i_id < p_intf->p_sys->p_input->stream.i_area_nb )
{
- p_area = p_intf->p_vlc->p_input_bank->pp_input[0]->stream.pp_areas[i_id];
+ p_area = p_intf->p_sys->p_input->stream.pp_areas[i_id];
- input_ChangeArea( p_intf->p_vlc->p_input_bank->pp_input[0],
+ input_ChangeArea( p_intf->p_sys->p_input,
(input_area_t *) p_area );
- input_SetStatus( p_intf->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
+ input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
}
}
static void ManageSlider ( intf_thread_t *p_intf )
{
- if( p_intf->p_vlc->p_input_bank->pp_input[0] != NULL )
+ if( p_intf->p_sys->p_input != NULL )
{
- vlc_mutex_lock( &p_intf->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
+ vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
- if( p_intf->p_vlc->p_input_bank->pp_input[0]->stream.b_seekable &&
- p_intf->p_vlc->p_input_bank->pp_input[0]->i_status & INPUT_STATUS_PLAY )
+ if( p_intf->p_sys->p_input->stream.b_seekable &&
+ p_intf->p_sys->p_input->stream.control.i_status == PLAYING_S )
{
float newvalue = p_intf->p_sys->f_slider_state;
-#define p_area p_intf->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area
+#define p_area p_intf->p_sys->p_input->stream.p_selected_area
/* If the user hasn't touched the slider since the last time,
* then the input can safely change it */
off_t i_seek = ( newvalue * p_area->i_size ) / 100;
/* release the lock to be able to seek */
- vlc_mutex_unlock( &p_intf->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
- input_Seek( p_intf->p_vlc->p_input_bank->pp_input[0]->p_this, i_seek, INPUT_SEEK_SET );
- vlc_mutex_lock( &p_intf->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
+ vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
+ input_Seek( p_intf, i_seek, INPUT_SEEK_SET );
+ vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
/* Update the old value */
p_intf->p_sys->f_slider_state_old = newvalue;
# undef p_area
}
- vlc_mutex_unlock( &p_intf->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
+ vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
}
}
input_area_t * p_area;
int i_id;
- i_id = p_intf->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_id - 1;
+ i_id = p_intf->p_sys->p_input->stream.p_selected_area->i_id - 1;
/* Disallow area 0 since it is used for video_ts.vob */
if ( i_id > 0 )
{
- p_area = p_intf->p_vlc->p_input_bank->pp_input[0]->stream.pp_areas[i_id];
- input_ChangeArea( p_intf->p_vlc->p_input_bank->pp_input[0], (input_area_t*)p_area );
+ p_area = p_intf->p_sys->p_input->stream.pp_areas[i_id];
+ input_ChangeArea( p_intf->p_sys->p_input, (input_area_t*)p_area );
- input_SetStatus( p_intf->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
+ input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
}
}
input_area_t * p_area;
int i_id;
- i_id = p_intf->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_id + 1;
+ i_id = p_intf->p_sys->p_input->stream.p_selected_area->i_id + 1;
- if ( i_id < p_intf->p_vlc->p_input_bank->pp_input[0]->stream.i_area_nb )
+ if ( i_id < p_intf->p_sys->p_input->stream.i_area_nb )
{
- p_area = p_intf->p_vlc->p_input_bank->pp_input[0]->stream.pp_areas[i_id];
- input_ChangeArea( p_intf->p_vlc->p_input_bank->pp_input[0], (input_area_t*)p_area );
+ p_area = p_intf->p_sys->p_input->stream.pp_areas[i_id];
+ input_ChangeArea( p_intf->p_sys->p_input, (input_area_t*)p_area );
- input_SetStatus( p_intf->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
+ input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
}
}
{
input_area_t * p_area;
- p_area = p_intf->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area;
+ p_area = p_intf->p_sys->p_input->stream.p_selected_area;
if ( p_area->i_part > 0 )
{
p_area->i_part--;
- input_ChangeArea( p_intf->p_vlc->p_input_bank->pp_input[0], (input_area_t*)p_area );
+ input_ChangeArea( p_intf->p_sys->p_input, (input_area_t*)p_area );
- input_SetStatus( p_intf->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
+ input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
}
}
{
input_area_t * p_area;
- p_area = p_intf->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area;
+ p_area = p_intf->p_sys->p_input->stream.p_selected_area;
if ( p_area->i_part < p_area->i_part_nb )
{
p_area->i_part++;
- input_ChangeArea( p_intf->p_vlc->p_input_bank->pp_input[0], (input_area_t*)p_area );
+ input_ChangeArea( p_intf->p_sys->p_input, (input_area_t*)p_area );
- input_SetStatus( p_intf->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
+ input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
}
}
* rc.c : remote control stdin/stdout plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: rc.c,v 1.23 2002/07/21 18:57:02 sigmunau Exp $
+ * $Id: rc.c,v 1.24 2002/07/31 20:56:52 sam Exp $
*
* Authors: Peter Surda <shurdeek@panorama.sth.ac.at>
*
#include <winsock2.h> /* select() */
#endif
-/*****************************************************************************
- * intf_sys_t: description and status of rc interface
- *****************************************************************************/
-struct intf_sys_t
-{
- input_thread_t * p_input;
-};
-
#define MAX_LINE_LENGTH 256
/*****************************************************************************
- * Local prototypes.
+ * Local prototypes
*****************************************************************************/
-static void intf_getfunctions ( function_list_t * p_function_list );
-static int intf_Open ( intf_thread_t *p_intf );
-static void intf_Close ( intf_thread_t *p_intf );
-static void intf_Run ( intf_thread_t *p_intf );
+static int Activate ( vlc_object_t * );
+static void Run ( intf_thread_t *p_intf );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("remote control interface module") )
- ADD_CAPABILITY( INTF, 20 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- intf_getfunctions( &p_module->p_functions->intf );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("remote control interface module") );
+ set_capability( "interface", 20 );
+ set_callbacks( Activate, NULL );
+vlc_module_end();
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Activate: initialize and create stuff
*****************************************************************************/
-static void intf_getfunctions( function_list_t * p_function_list )
+static int Activate( vlc_object_t *p_this )
{
- p_function_list->functions.intf.pf_open = intf_Open;
- p_function_list->functions.intf.pf_close = intf_Close;
- p_function_list->functions.intf.pf_run = intf_Run;
-}
+ intf_thread_t *p_intf = (intf_thread_t*)p_this;
-/*****************************************************************************
- * intf_Open: initialize and create stuff
- *****************************************************************************/
-static int intf_Open( intf_thread_t *p_intf )
-{
#ifdef HAVE_ISATTY
/* Check that stdin is a TTY */
if( !isatty( 0 ) )
/* Non-buffered stdout */
setvbuf( stdout, (char *)NULL, _IOLBF, 0 );
- /* Allocate instance and initialize some members */
- p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) );
- if( p_intf->p_sys == NULL )
- {
- msg_Err( p_intf, "out of memory" );
- return 1;
- }
+ p_intf->pf_run = Run;
#ifdef WIN32
AllocConsole();
}
/*****************************************************************************
- * intf_Close: destroy interface stuff
- *****************************************************************************/
-static void intf_Close( intf_thread_t *p_intf )
-{
- /* Destroy structure */
- free( p_intf->p_sys );
-}
-
-/*****************************************************************************
- * intf_Run: rc thread
+ * Run: rc thread
*****************************************************************************
* This part of the interface is in a separate thread so that we can call
* exec() from within it without annoying the rest of the program.
*****************************************************************************/
-static void intf_Run( intf_thread_t *p_intf )
+static void Run( intf_thread_t *p_intf )
{
+ input_thread_t * p_input;
+
char p_buffer[ MAX_LINE_LENGTH + 1 ];
vlc_bool_t b_complete = 0;
input_info_category_t * p_category;
memset(psz_dashes, '-', 80);
psz_dashes[80] = '\0';
- p_intf->p_sys->p_input = NULL;
+ p_input = NULL;
while( !p_intf->b_die )
{
}
/* Manage the input part */
- if( p_intf->p_sys->p_input == NULL )
+ if( p_input == NULL )
{
- p_intf->p_sys->p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT,
- FIND_ANYWHERE );
+ p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT,
+ FIND_ANYWHERE );
}
- else if( p_intf->p_sys->p_input->b_dead )
+ else if( p_input->b_dead )
{
- vlc_object_release( p_intf->p_sys->p_input );
- p_intf->p_sys->p_input = NULL;
+ vlc_object_release( p_input );
+ p_input = NULL;
}
- if( p_intf->p_sys->p_input )
+ if( p_input )
{
- input_thread_t *p_input = p_intf->p_sys->p_input;
-
/* Get position */
vlc_mutex_lock( &p_input->stream.stream_lock );
if( !p_input->b_die && p_input->stream.i_mux_rate )
case 'p':
case 'P':
- if( p_intf->p_sys->p_input )
+ if( p_input )
{
- input_SetStatus( p_intf->p_sys->p_input,
- INPUT_STATUS_PAUSE );
+ input_SetStatus( p_input, INPUT_STATUS_PAUSE );
}
break;
case 'f':
case 'F':
- if( p_intf->p_sys->p_input )
+ if( p_input )
{
vout_thread_t *p_vout;
- p_vout = vlc_object_find( p_intf->p_sys->p_input,
+ p_vout = vlc_object_find( p_input,
VLC_OBJECT_VOUT, FIND_CHILD );
if( p_vout )
case 'r':
case 'R':
- if( p_intf->p_sys->p_input )
+ if( p_input )
{
for( i_dummy = 1;
i_dummy < MAX_LINE_LENGTH && p_cmd[ i_dummy ] >= '0'
}
p_cmd[ i_dummy ] = 0;
- input_Seek( p_intf->p_sys->p_input,
- (off_t)atoi( p_cmd + 1 ),
+ input_Seek( p_input, (off_t)atoi( p_cmd + 1 ),
INPUT_SEEK_SECONDS | INPUT_SEEK_SET );
/* rcreseek(f_cpos); */
}
case 'i':
case 'I':
printf( "Dumping stream info\n" );
- vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
- p_category = p_intf->p_sys->p_input->stream.p_info;
+ vlc_mutex_lock( &p_input->stream.stream_lock );
+ p_category = p_input->stream.p_info;
while ( p_category )
{
psz_dashes[72 - strlen(p_category->psz_name) ] = '\0';
}
psz_dashes[78] = '\0';
printf( "+%s+\n", psz_dashes );
- vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
+ vlc_mutex_unlock( &p_input->stream.stream_lock );
+ break;
+ case '\0':
+ /* Ignore empty lines */
break;
default:
printf( "unknown command `%s'\n", p_cmd );
msleep( INTF_IDLE_SLEEP );
}
- if( p_intf->p_sys->p_input )
+ if( p_input )
{
- vlc_object_release( p_intf->p_sys->p_input );
- p_intf->p_sys->p_input = NULL;
+ vlc_object_release( p_input );
+ p_input = NULL;
}
-
}
-vcd_SOURCES = vcd.c input_vcd.c cdrom_tools.c
+vcd_SOURCES = vcd.c cdrom_tools.c
+++ /dev/null
-/****************************************************************************
- * input_vcd.c: VideoCD raw reading plugin.
- *****************************************************************************
- * Copyright (C) 1998-2001 VideoLAN
- *
- * Author: Johan Bilien <jobi@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.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <vlc/vlc.h>
-#include <vlc/input.h>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <errno.h>
-
-#if defined( WIN32 )
-# include <io.h> /* read() */
-#else
-# include <sys/uio.h> /* struct iovec */
-#endif
-
-#if defined( WIN32 )
-# include "input_iovec.h"
-#endif
-
-#include "input_vcd.h"
-#include "cdrom_tools.h"
-
-/* how many blocks VCDRead will read in each loop */
-#define VCD_BLOCKS_ONCE 20
-#define VCD_DATA_ONCE (VCD_BLOCKS_ONCE * VCD_DATA_SIZE)
-
-/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-/* called from outside */
-
-static int VCDOpen ( input_thread_t *);
-static void VCDClose ( input_thread_t *);
-static int VCDRead ( input_thread_t *, byte_t *, size_t );
-static void VCDSeek ( input_thread_t *, off_t );
-static int VCDSetArea ( input_thread_t *, input_area_t * );
-static int VCDSetProgram ( input_thread_t *, pgrm_descriptor_t * );
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( access_getfunctions )( function_list_t * p_function_list )
-{
-#define access p_function_list->functions.access
- access.pf_open = VCDOpen;
- access.pf_close = VCDClose;
- access.pf_read = VCDRead;
- access.pf_set_area = VCDSetArea;
- access.pf_set_program = VCDSetProgram;
- access.pf_seek = VCDSeek;
-#undef access
-}
-
-/*
- * Data reading functions
- */
-
-/*****************************************************************************
- * VCDOpen: open vcd
- *****************************************************************************/
-static int VCDOpen( input_thread_t *p_input )
-{
- char * psz_orig;
- char * psz_parser;
- char * psz_source;
- char * psz_next;
- struct stat stat_info;
- thread_vcd_data_t * p_vcd;
- int i;
- input_area_t * p_area;
- int i_title = 1;
- int i_chapter = 1;
-
-
-
- /* parse the options passed in command line : */
- psz_orig = psz_parser = psz_source = strdup( p_input->psz_name );
-
- if( !psz_orig )
- {
- return( -1 );
- }
-
- while( *psz_parser && *psz_parser != '@' )
- {
- psz_parser++;
- }
-
- if( *psz_parser == '@' )
- {
- /* Found options */
- *psz_parser = '\0';
- ++psz_parser;
-
- i_title = (int)strtol( psz_parser, &psz_next, 10 );
- if( *psz_next )
- {
- psz_parser = psz_next + 1;
- i_chapter = (int)strtol( psz_parser, &psz_next, 10 );
- }
-
- i_title = i_title ? i_title : 1;
- i_chapter = i_chapter ? i_chapter : 1;
- }
-
- if( !*psz_source )
- {
- if( !p_input->psz_access )
- {
- free( psz_orig );
- return -1;
- }
- psz_source = config_GetPsz( p_input, "vcd" );
- }
-
- /* test the type of file given */
-
- if( stat( psz_source, &stat_info ) == -1 )
- {
- msg_Err( p_input, "cannot stat() source `%s' (%s)",
- psz_source, strerror(errno));
- return( -1 );
- }
-
- if( !S_ISBLK(stat_info.st_mode) && !S_ISCHR(stat_info.st_mode))
- {
- msg_Warn( p_input, "vcd module discarded (not a valid drive)" );
- return -1;
- }
-
-
- p_vcd = malloc( sizeof(thread_vcd_data_t) );
-
- if( p_vcd == NULL )
- {
- msg_Err( p_input, "out of memory" );
- return -1;
- }
-
- p_input->p_access_data = (void *)p_vcd;
-
- p_input->i_mtu = VCD_DATA_ONCE;
-
- vlc_mutex_lock( &p_input->stream.stream_lock );
-
- p_input->stream.b_pace_control = 1;
-
- p_input->stream.b_seekable = 1;
- p_input->stream.p_selected_area->i_size = 0;
- p_input->stream.p_selected_area->i_tell = 0;
-
- vlc_mutex_unlock( &p_input->stream.stream_lock );
-
- p_vcd->i_handle = open( psz_source, O_RDONLY | O_NONBLOCK );
-
- if( p_vcd->i_handle == -1 )
- {
- msg_Err( p_input, "could not open %s\n", psz_source );
- free (p_vcd);
- return -1;
- }
-
- /* We read the Table Of Content information */
- p_vcd->nb_tracks = ioctl_GetTrackCount( p_vcd->i_handle,
- psz_source );
- if( p_vcd->nb_tracks < 0 )
- {
- msg_Err( p_input, "unable to count tracks" );
- close( p_vcd->i_handle );
- free( p_vcd );
- return -1;
- }
- else if( p_vcd->nb_tracks <= 1 )
- {
- msg_Err( p_input, "no movie tracks found" );
- close( p_vcd->i_handle );
- free( p_vcd );
- return -1;
- }
-
- p_vcd->p_sectors = ioctl_GetSectors( p_vcd->i_handle,
- psz_source );
- if( p_vcd->p_sectors == NULL )
- {
- input_BuffersEnd( p_input, p_input->p_method_data );
- close( p_vcd->i_handle );
- free( p_vcd );
- return -1;
- }
-
- /* Set stream and area data */
- vlc_mutex_lock( &p_input->stream.stream_lock );
-
- /* Initialize ES structures */
- input_InitStream( p_input, sizeof( stream_ps_data_t ) );
-
- /* disc input method */
- p_input->stream.i_method = INPUT_METHOD_VCD;
-
-#define area p_input->stream.pp_areas
- for( i = 1 ; i <= p_vcd->nb_tracks - 1 ; i++ )
- {
- input_AddArea( p_input );
-
- /* Titles are Program Chains */
- area[i]->i_id = i;
-
- /* Absolute start offset and size */
- area[i]->i_start = (off_t)p_vcd->p_sectors[i] * (off_t)VCD_DATA_SIZE;
- area[i]->i_size = (off_t)(p_vcd->p_sectors[i+1] - p_vcd->p_sectors[i])
- * (off_t)VCD_DATA_SIZE;
-
- /* Number of chapters */
- area[i]->i_part_nb = 0; // will be the entry points
- area[i]->i_part = 1;
-
- area[i]->i_plugin_data = p_vcd->p_sectors[i];
- }
-#undef area
-
- p_area = p_input->stream.pp_areas[i_title];
-
- VCDSetArea( p_input, p_area );
-
- vlc_mutex_unlock( &p_input->stream.stream_lock );
-
- p_input->psz_demux = "ps";
-
- return 0;
-}
-
-/*****************************************************************************
- * VCDClose: closes vcd
- *****************************************************************************/
-static void VCDClose( input_thread_t *p_input )
-{
- thread_vcd_data_t *p_vcd = (thread_vcd_data_t *)p_input->p_access_data;
-
- close( p_vcd->i_handle );
- free( p_vcd );
-}
-
-/*****************************************************************************
- * VCDRead: reads from the VCD into PES packets.
- *****************************************************************************
- * Returns -1 in case of error, 0 in case of EOF, otherwise the number of
- * bytes.
- *****************************************************************************/
-static int VCDRead( input_thread_t * p_input, byte_t * p_buffer,
- size_t i_len )
-{
- thread_vcd_data_t * p_vcd;
- int i_blocks;
- int i_index;
- int i_read;
- byte_t p_last_sector[ VCD_DATA_SIZE ];
-
- p_vcd = (thread_vcd_data_t *)p_input->p_access_data;
-
- i_read = 0;
-
- /* Compute the number of blocks we have to read */
-
- i_blocks = i_len / VCD_DATA_SIZE;
-
- for ( i_index = 0 ; i_index < i_blocks ; i_index++ )
- {
- if ( ioctl_ReadSector( p_vcd->i_handle, p_vcd->i_sector,
- p_buffer + i_index * VCD_DATA_SIZE ) < 0 )
- {
- msg_Err( p_input, "could not read sector %d", p_vcd->i_sector );
- return -1;
- }
-
- p_vcd->i_sector ++;
- if ( p_vcd->i_sector == p_vcd->p_sectors[p_vcd->i_track + 1] )
- {
- input_area_t *p_area;
-
- if ( p_vcd->i_track >= p_vcd->nb_tracks - 1 )
- return 0; /* EOF */
-
- p_area = p_input->stream.pp_areas[
- p_input->stream.p_selected_area->i_id + 1 ];
-
- msg_Dbg( p_input, "new title" );
-
- p_area->i_part = 1;
- VCDSetArea( p_input, p_area );
-
- }
- i_read += VCD_DATA_SIZE;
- }
-
- if ( i_len % VCD_DATA_SIZE ) /* this should not happen */
- {
- if ( ioctl_ReadSector( p_vcd->i_handle, p_vcd->i_sector,
- p_last_sector ) < 0 )
- {
- msg_Err( p_input, "could not read sector %d", p_vcd->i_sector );
- return -1;
- }
-
- p_input->p_vlc->pf_memcpy( p_buffer + i_blocks * VCD_DATA_SIZE,
- p_last_sector, i_len % VCD_DATA_SIZE );
- i_read += i_len % VCD_DATA_SIZE;
- }
-
- p_input->stream.p_selected_area->i_tell =
- (off_t)p_vcd->i_sector * (off_t)VCD_DATA_SIZE
- - p_input->stream.p_selected_area->i_start;
-
- return i_read;
-}
-
-
-/*****************************************************************************
- * VCDSetProgram: Does nothing since a VCD is mono_program
- *****************************************************************************/
-static int VCDSetProgram( input_thread_t * p_input,
- pgrm_descriptor_t * p_program)
-{
- return 0;
-}
-
-
-/*****************************************************************************
- * VCDSetArea: initialize input data for title x, chapter y.
- * It should be called for each user navigation request.
- ****************************************************************************/
-static int VCDSetArea( input_thread_t * p_input, input_area_t * p_area )
-{
- thread_vcd_data_t * p_vcd;
-
- p_vcd = (thread_vcd_data_t*)p_input->p_access_data;
-
- /* we can't use the interface slider until initilization is complete */
- p_input->stream.b_seekable = 0;
-
- if( p_area != p_input->stream.p_selected_area )
- {
- /* Reset the Chapter position of the current title */
- p_input->stream.p_selected_area->i_part = 1;
- p_input->stream.p_selected_area->i_tell = 0;
-
- /* Change the default area */
- p_input->stream.p_selected_area = p_area;
-
- /* Change the current track */
- /* The first track is not a valid one */
- p_vcd->i_track = p_area->i_id;
- p_vcd->i_sector = p_vcd->p_sectors[p_vcd->i_track];
- }
-
- /* warn interface that something has changed */
- p_input->stream.b_seekable = 1;
- p_input->stream.b_changed = 1;
-
- return 0;
-}
-
-
-/****************************************************************************
- * VCDSeek
- ****************************************************************************/
-static void VCDSeek( input_thread_t * p_input, off_t i_off )
-{
- thread_vcd_data_t * p_vcd;
-
- p_vcd = (thread_vcd_data_t *) p_input->p_access_data;
-
- p_vcd->i_sector = p_vcd->p_sectors[p_vcd->i_track]
- + i_off / (off_t)VCD_DATA_SIZE;
-
- p_input->stream.p_selected_area->i_tell =
- (off_t)p_vcd->i_sector * (off_t)VCD_DATA_SIZE
- - p_input->stream.p_selected_area->i_start;
-}
* vcd.c : VCD input module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: vcd.c,v 1.12 2002/06/01 12:32:00 sam Exp $
+ * $Id: vcd.c,v 1.13 2002/07/31 20:56:52 sam Exp $
*
- * Authors: Samuel Hocevar <sam@zoy.org>
+ * Author: Johan Bilien <jobi@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
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdlib.h> /* malloc(), free() */
-#include <string.h> /* strdup() */
+#include <stdio.h>
+#include <stdlib.h>
#include <vlc/vlc.h>
+#include <vlc/input.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <errno.h>
+
+#if defined( WIN32 )
+# include <io.h> /* read() */
+#else
+# include <sys/uio.h> /* struct iovec */
+#endif
+
+#if defined( WIN32 )
+# include "input_iovec.h"
+#endif
+
+#include "input_vcd.h"
+#include "cdrom_tools.h"
+
+/* how many blocks VCDRead will read in each loop */
+#define VCD_BLOCKS_ONCE 20
+#define VCD_DATA_ONCE (VCD_BLOCKS_ONCE * VCD_DATA_SIZE)
+
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+static int VCDOpen ( vlc_object_t * );
+static void VCDClose ( vlc_object_t * );
+static int VCDRead ( input_thread_t *, byte_t *, size_t );
+static void VCDSeek ( input_thread_t *, off_t );
+static int VCDSetArea ( input_thread_t *, input_area_t * );
+static int VCDSetProgram ( input_thread_t *, pgrm_descriptor_t * );
+
+/*****************************************************************************
+ * Module descriptior
+ *****************************************************************************/
+vlc_module_begin();
+ set_description( _("VCD input module") );
+ set_capability( "access", 80 );
+ set_callbacks( VCDOpen, VCDClose );
+ add_shortcut( "svcd" );
+vlc_module_end();
+
+/*
+ * Data reading functions
+ */
+
+/*****************************************************************************
+ * VCDOpen: open vcd
+ *****************************************************************************/
+static int VCDOpen( vlc_object_t *p_this )
+{
+ input_thread_t * p_input = (input_thread_t *)p_this;
+ char * psz_orig;
+ char * psz_parser;
+ char * psz_source;
+ char * psz_next;
+ struct stat stat_info;
+ thread_vcd_data_t * p_vcd;
+ int i;
+ input_area_t * p_area;
+ int i_title = 1;
+ int i_chapter = 1;
+
+ p_input->pf_read = VCDRead;
+ p_input->pf_seek = VCDSeek;
+ p_input->pf_set_area = VCDSetArea;
+ p_input->pf_set_program = VCDSetProgram;
+
+ /* parse the options passed in command line : */
+ psz_orig = psz_parser = psz_source = strdup( p_input->psz_name );
+
+ if( !psz_orig )
+ {
+ return( -1 );
+ }
+
+ while( *psz_parser && *psz_parser != '@' )
+ {
+ psz_parser++;
+ }
+
+ if( *psz_parser == '@' )
+ {
+ /* Found options */
+ *psz_parser = '\0';
+ ++psz_parser;
+
+ i_title = (int)strtol( psz_parser, &psz_next, 10 );
+ if( *psz_next )
+ {
+ psz_parser = psz_next + 1;
+ i_chapter = (int)strtol( psz_parser, &psz_next, 10 );
+ }
+
+ i_title = i_title ? i_title : 1;
+ i_chapter = i_chapter ? i_chapter : 1;
+ }
+
+ if( !*psz_source )
+ {
+ if( !p_input->psz_access )
+ {
+ free( psz_orig );
+ return -1;
+ }
+ psz_source = config_GetPsz( p_input, "vcd" );
+ }
+
+ /* test the type of file given */
+
+ if( stat( psz_source, &stat_info ) == -1 )
+ {
+ msg_Err( p_input, "cannot stat() source `%s' (%s)",
+ psz_source, strerror(errno));
+ return( -1 );
+ }
+
+ if( !S_ISBLK(stat_info.st_mode) && !S_ISCHR(stat_info.st_mode))
+ {
+ msg_Warn( p_input, "vcd module discarded (not a valid drive)" );
+ return -1;
+ }
+
+
+ p_vcd = malloc( sizeof(thread_vcd_data_t) );
+
+ if( p_vcd == NULL )
+ {
+ msg_Err( p_input, "out of memory" );
+ return -1;
+ }
+
+ p_input->p_access_data = (void *)p_vcd;
+
+ p_input->i_mtu = VCD_DATA_ONCE;
+
+ vlc_mutex_lock( &p_input->stream.stream_lock );
+
+ p_input->stream.b_pace_control = 1;
+
+ p_input->stream.b_seekable = 1;
+ p_input->stream.p_selected_area->i_size = 0;
+ p_input->stream.p_selected_area->i_tell = 0;
+
+ vlc_mutex_unlock( &p_input->stream.stream_lock );
+
+ p_vcd->i_handle = open( psz_source, O_RDONLY | O_NONBLOCK );
+
+ if( p_vcd->i_handle == -1 )
+ {
+ msg_Err( p_input, "could not open %s\n", psz_source );
+ free (p_vcd);
+ return -1;
+ }
+
+ /* We read the Table Of Content information */
+ p_vcd->nb_tracks = ioctl_GetTrackCount( p_vcd->i_handle,
+ psz_source );
+ if( p_vcd->nb_tracks < 0 )
+ {
+ msg_Err( p_input, "unable to count tracks" );
+ close( p_vcd->i_handle );
+ free( p_vcd );
+ return -1;
+ }
+ else if( p_vcd->nb_tracks <= 1 )
+ {
+ msg_Err( p_input, "no movie tracks found" );
+ close( p_vcd->i_handle );
+ free( p_vcd );
+ return -1;
+ }
+
+ p_vcd->p_sectors = ioctl_GetSectors( p_vcd->i_handle,
+ psz_source );
+ if( p_vcd->p_sectors == NULL )
+ {
+ input_BuffersEnd( p_input, p_input->p_method_data );
+ close( p_vcd->i_handle );
+ free( p_vcd );
+ return -1;
+ }
+
+ /* Set stream and area data */
+ vlc_mutex_lock( &p_input->stream.stream_lock );
+
+ /* Initialize ES structures */
+ input_InitStream( p_input, sizeof( stream_ps_data_t ) );
+
+ /* disc input method */
+ p_input->stream.i_method = INPUT_METHOD_VCD;
+
+#define area p_input->stream.pp_areas
+ for( i = 1 ; i <= p_vcd->nb_tracks - 1 ; i++ )
+ {
+ input_AddArea( p_input );
+
+ /* Titles are Program Chains */
+ area[i]->i_id = i;
+
+ /* Absolute start offset and size */
+ area[i]->i_start = (off_t)p_vcd->p_sectors[i] * (off_t)VCD_DATA_SIZE;
+ area[i]->i_size = (off_t)(p_vcd->p_sectors[i+1] - p_vcd->p_sectors[i])
+ * (off_t)VCD_DATA_SIZE;
+
+ /* Number of chapters */
+ area[i]->i_part_nb = 0; // will be the entry points
+ area[i]->i_part = 1;
+
+ area[i]->i_plugin_data = p_vcd->p_sectors[i];
+ }
+#undef area
+
+ p_area = p_input->stream.pp_areas[i_title];
+
+ VCDSetArea( p_input, p_area );
+
+ vlc_mutex_unlock( &p_input->stream.stream_lock );
+
+ p_input->psz_demux = "ps";
+
+ return 0;
+}
+
+/*****************************************************************************
+ * VCDClose: closes vcd
+ *****************************************************************************/
+static void VCDClose( vlc_object_t *p_this )
+{
+ input_thread_t * p_input = (input_thread_t *)p_this;
+ thread_vcd_data_t *p_vcd = (thread_vcd_data_t *)p_input->p_access_data;
+
+ close( p_vcd->i_handle );
+ free( p_vcd );
+}
/*****************************************************************************
- * Capabilities defined in the other files.
+ * VCDRead: reads from the VCD into PES packets.
+ *****************************************************************************
+ * Returns -1 in case of error, 0 in case of EOF, otherwise the number of
+ * bytes.
*****************************************************************************/
-void _M( access_getfunctions )( function_list_t * p_function_list );
+static int VCDRead( input_thread_t * p_input, byte_t * p_buffer,
+ size_t i_len )
+{
+ thread_vcd_data_t * p_vcd;
+ int i_blocks;
+ int i_index;
+ int i_read;
+ byte_t p_last_sector[ VCD_DATA_SIZE ];
+
+ p_vcd = (thread_vcd_data_t *)p_input->p_access_data;
+
+ i_read = 0;
+
+ /* Compute the number of blocks we have to read */
+
+ i_blocks = i_len / VCD_DATA_SIZE;
+
+ for ( i_index = 0 ; i_index < i_blocks ; i_index++ )
+ {
+ if ( ioctl_ReadSector( p_vcd->i_handle, p_vcd->i_sector,
+ p_buffer + i_index * VCD_DATA_SIZE ) < 0 )
+ {
+ msg_Err( p_input, "could not read sector %d", p_vcd->i_sector );
+ return -1;
+ }
+
+ p_vcd->i_sector ++;
+ if ( p_vcd->i_sector == p_vcd->p_sectors[p_vcd->i_track + 1] )
+ {
+ input_area_t *p_area;
+
+ if ( p_vcd->i_track >= p_vcd->nb_tracks - 1 )
+ return 0; /* EOF */
+
+ p_area = p_input->stream.pp_areas[
+ p_input->stream.p_selected_area->i_id + 1 ];
+
+ msg_Dbg( p_input, "new title" );
+
+ p_area->i_part = 1;
+ VCDSetArea( p_input, p_area );
+
+ }
+ i_read += VCD_DATA_SIZE;
+ }
+
+ if ( i_len % VCD_DATA_SIZE ) /* this should not happen */
+ {
+ if ( ioctl_ReadSector( p_vcd->i_handle, p_vcd->i_sector,
+ p_last_sector ) < 0 )
+ {
+ msg_Err( p_input, "could not read sector %d", p_vcd->i_sector );
+ return -1;
+ }
+
+ p_input->p_vlc->pf_memcpy( p_buffer + i_blocks * VCD_DATA_SIZE,
+ p_last_sector, i_len % VCD_DATA_SIZE );
+ i_read += i_len % VCD_DATA_SIZE;
+ }
+
+ p_input->stream.p_selected_area->i_tell =
+ (off_t)p_vcd->i_sector * (off_t)VCD_DATA_SIZE
+ - p_input->stream.p_selected_area->i_start;
+
+ return i_read;
+}
+
/*****************************************************************************
- * Build configuration tree.
+ * VCDSetProgram: Does nothing since a VCD is mono_program
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
+static int VCDSetProgram( input_thread_t * p_input,
+ pgrm_descriptor_t * p_program)
+{
+ return 0;
+}
+
+
+/*****************************************************************************
+ * VCDSetArea: initialize input data for title x, chapter y.
+ * It should be called for each user navigation request.
+ ****************************************************************************/
+static int VCDSetArea( input_thread_t * p_input, input_area_t * p_area )
+{
+ thread_vcd_data_t * p_vcd;
+
+ p_vcd = (thread_vcd_data_t*)p_input->p_access_data;
+
+ /* we can't use the interface slider until initilization is complete */
+ p_input->stream.b_seekable = 0;
+
+ if( p_area != p_input->stream.p_selected_area )
+ {
+ /* Reset the Chapter position of the current title */
+ p_input->stream.p_selected_area->i_part = 1;
+ p_input->stream.p_selected_area->i_tell = 0;
+
+ /* Change the default area */
+ p_input->stream.p_selected_area = p_area;
+
+ /* Change the current track */
+ /* The first track is not a valid one */
+ p_vcd->i_track = p_area->i_id;
+ p_vcd->i_sector = p_vcd->p_sectors[p_vcd->i_track];
+ }
+
+ /* warn interface that something has changed */
+ p_input->stream.b_seekable = 1;
+ p_input->stream.b_changed = 1;
+
+ return 0;
+}
+
-MODULE_INIT_START
- SET_DESCRIPTION( _("VCD input module") )
- ADD_CAPABILITY( ACCESS, 80 )
- ADD_SHORTCUT( "svcd" )
-MODULE_INIT_STOP
+/****************************************************************************
+ * VCDSeek
+ ****************************************************************************/
+static void VCDSeek( input_thread_t * p_input, off_t i_off )
+{
+ thread_vcd_data_t * p_vcd;
-MODULE_ACTIVATE_START
- _M( access_getfunctions )( &p_module->p_functions->access );
-MODULE_ACTIVATE_STOP
+ p_vcd = (thread_vcd_data_t *) p_input->p_access_data;
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+ p_vcd->i_sector = p_vcd->p_sectors[p_vcd->i_track]
+ + i_off / (off_t)VCD_DATA_SIZE;
+ p_input->stream.p_selected_area->i_tell =
+ (off_t)p_vcd->i_sector * (off_t)VCD_DATA_SIZE
+ - p_input->stream.p_selected_area->i_start;
+}
/*****************************************************************************\r
* Local prototypes.\r
*****************************************************************************/\r
-static int intf_Open ( intf_thread_t *p_intf );\r
-static void intf_Close ( intf_thread_t *p_intf );\r
static void intf_Run ( intf_thread_t *p_intf );\r
\r
int Win32Manage( void *p_data );\r
\r
/*****************************************************************************\r
- * Functions exported as capabilities. They are declared as static so that\r
- * we don't pollute the namespace too much.\r
+ * Open: initialize interface\r
*****************************************************************************/\r
-void _M( intf_getfunctions )( function_list_t * p_function_list )\r
+int E_(Open)( vlc_object_t *p_this )\r
{\r
- p_function_list->functions.intf.pf_open = intf_Open;\r
- p_function_list->functions.intf.pf_close = intf_Close;\r
- p_function_list->functions.intf.pf_run = intf_Run;\r
-}\r
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;\r
\r
-/*****************************************************************************\r
- * intf_Open: initialize interface\r
- *****************************************************************************/\r
-static int intf_Open( intf_thread_t *p_intf )\r
-{\r
/* Allocate instance and initialize some members */\r
p_intf->p_sys = (intf_sys_s *) malloc( sizeof( intf_sys_t ) );\r
if( p_intf->p_sys == NULL )\r
};\r
\r
p_intfGlobal = p_intf;\r
+ p_intf->pf_run = intf_Run;\r
\r
p_intf->p_sys->p_sub = msg_Subscribe( p_intf );\r
\r
}\r
\r
/*****************************************************************************\r
- * intf_Close: destroy interface\r
+ * Close: destroy interface\r
*****************************************************************************/\r
-static void intf_Close( intf_thread_t *p_intf )\r
+void E_(Close)( vlc_object_t *p_this )\r
{\r
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;\r
+\r
if( p_intf->p_sys->p_input )\r
{\r
vlc_object_release( p_intf->p_sys->p_input );\r
* waveout.c : Windows waveOut plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: waveout.c,v 1.10 2002/07/20 18:01:43 sam Exp $
+ * $Id: waveout.c,v 1.11 2002/07/31 20:56:52 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
#include <mmsystem.h>
/*****************************************************************************
- * Local prototypes.
+ * Local prototypes
*****************************************************************************/
-static void aout_getfunctions( function_list_t * p_function_list );
+static int Open ( vlc_object_t * );
+static void Close ( vlc_object_t * );
-static int aout_Open ( aout_thread_t *p_aout );
-static int aout_SetFormat ( aout_thread_t *p_aout );
-static int aout_GetBufInfo ( aout_thread_t *p_aout, int i_buffer_info );
-static void aout_Play ( aout_thread_t *p_aout,
- byte_t *buffer, int i_size );
-static void aout_Close ( aout_thread_t *p_aout );
+static int SetFormat ( aout_thread_t * );
+static int GetBufInfo ( aout_thread_t *, int );
+static void Play ( aout_thread_t *, byte_t *, int );
/* local functions */
static int OpenWaveOutDevice( aout_thread_t *p_aout );
/*****************************************************************************
- * Building configuration tree
+ * Module descriptor
*****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("Win32 waveOut extension module") )
- ADD_CAPABILITY( AOUT, 250 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- aout_getfunctions( &p_module->p_functions->aout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ set_description( _("Win32 waveOut extension module") );
+ set_capability( "audio output", 250 );
+ set_callbacks( Open, Close );
+vlc_module_end();
/*****************************************************************************
* aout_sys_t: waveOut audio output method descriptor
};
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void aout_getfunctions( function_list_t * p_function_list )
-{
- p_function_list->functions.aout.pf_open = aout_Open;
- p_function_list->functions.aout.pf_setformat = aout_SetFormat;
- p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
- p_function_list->functions.aout.pf_play = aout_Play;
- p_function_list->functions.aout.pf_close = aout_Close;
-}
-
-/*****************************************************************************
- * aout_Open: open the audio device
+ * Open: open the audio device
*****************************************************************************
* This function opens and setups Win32 waveOut
*****************************************************************************/
-static int aout_Open( aout_thread_t *p_aout )
-{
+static int Open( vlc_object_t *p_this )
+{
+ aout_thread_t *p_aout = (aout_thread_t *)p_this;
int i;
/* Allocate structure */
return( 1 );
}
+ p_aout->pf_setformat = SetFormat;
+ p_aout->pf_getbufinfo = GetBufInfo;
+ p_aout->pf_play = Play;
/* Initialize some variables */
p_aout->p_sys->i_current_buffer = 0;
}
/*****************************************************************************
- * aout_SetFormat: reset the audio device and sets its format
+ * SetFormat: reset the audio device and sets its format
*****************************************************************************
* This functions set a new audio format.
* For this we need to close the current device and create another
* one with the desired format.
*****************************************************************************/
-static int aout_SetFormat( aout_thread_t *p_aout )
+static int SetFormat( aout_thread_t *p_aout )
{
- msg_Dbg( p_aout, "aout_SetFormat" );
+ msg_Dbg( p_aout, "SetFormat" );
/* Check if the format has changed */
}
/*****************************************************************************
- * aout_GetBufInfo: buffer status query
+ * GetBufInfo: buffer status query
*****************************************************************************
* returns the number of bytes in the audio buffer that have not yet been
* sent to the sound device.
*****************************************************************************/
-static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
+static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
{
MMTIME mmtime;
#if 0
- msg_Dbg( p_aout, "aout_GetBufInfo: %i",
+ msg_Dbg( p_aout, "GetBufInfo: %i",
p_aout->p_sys->dw_counter - mmtime.u.cb );
#endif
}
/*****************************************************************************
- * aout_Play: play a sound buffer
+ * Play: play a sound buffer
*****************************************************************************
* This function writes a buffer of i_length bytes
*****************************************************************************/
-static void aout_Play( aout_thread_t *p_aout, byte_t *p_buffer, int i_size )
+static void Play( aout_thread_t *p_aout, byte_t *p_buffer, int i_size )
{
MMRESULT result;
int current_buffer = p_aout->p_sys->i_current_buffer;
}
/*****************************************************************************
- * aout_Close: close the audio device
+ * Close: close the audio device
*****************************************************************************/
-static void aout_Close( aout_thread_t *p_aout )
-{
+static void Close( vlc_object_t *p_this )
+{
+ aout_thread_t *p_aout = (aout_thread_t *)p_this;
int i;
/* Before calling waveOutClose we must reset the device */
#include "win32.h" /* Borland specific */
/*****************************************************************************
- * Capabilities defined in the other files.
+ * External prototypes
*****************************************************************************/
-void _M( intf_getfunctions ) ( function_list_t * p_function_list );
+int E_(Open) ( vlc_object_t * );
+void E_(Close) ( vlc_object_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
#define MAX_LINES_TEXT N_("maximum number of lines in the log window")
"You can set the maximum number of lines that the log window will display."\
" Enter -1 if you want to keep all messages." )
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
- ADD_INTEGER( "intfwin-max-lines", 500, NULL, MAX_LINES_TEXT, MAX_LINES_LONGTEXT )
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("Win32 interface module") )
- ADD_CAPABILITY( INTF, 100 )
- ADD_SHORTCUT( "win" )
- ADD_SHORTCUT( "win32" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( intf_getfunctions )( &p_module->p_functions->intf );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_integer( "intfwin-max-lines", 500, NULL, MAX_LINES_TEXT, MAX_LINES_LONGTEXT );
+ set_description( _("Win32 interface module") );
+ set_capability( "interface", 100 );
+ set_callbacks( E_(Open), E_(Close) );
+ add_shortcut( "win" );
+ add_shortcut( "win32" );
+vlc_module_end();
* Exported interface functions.
*****************************************************************************/
extern "C" __declspec(dllexport)\r
- int __VLC_SYMBOL( InitModule ) ( module_t *p_module );\r
-extern "C" __declspec(dllexport)\r
- int __VLC_SYMBOL( ActivateModule ) ( module_t *p_module );\r
-extern "C" __declspec(dllexport)\r
- int __VLC_SYMBOL( DeactivateModule ) ( module_t *p_module );\r
+ int __VLC_SYMBOL( vlc_entry ) ( module_t *p_module );\r
* x11.c : X11 plugin for vlc
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: x11.c,v 1.20 2002/07/02 19:14:59 sam Exp $
+ * $Id: x11.c,v 1.21 2002/07/31 20:56:52 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#include <vlc/vlc.h>
-#include "xcommon.h"
-
/*****************************************************************************
- * Building configuration tree
+ * Exported prototypes
*****************************************************************************/
+extern int E_(Activate) ( vlc_object_t * );
+extern void E_(Deactivate) ( vlc_object_t * );
+/*****************************************************************************
+ * Module descriptor
+ *****************************************************************************/
#define ALT_FS_TEXT N_("alternate fullscreen method")
#define ALT_FS_LONGTEXT N_( \
"There are two ways to make a fullscreen window, unfortunately each one " \
#define SHM_LONGTEXT N_( \
"Use shared memory to communicate between vlc and the X server.")
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_STRING ( "x11-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT )
-ADD_BOOL ( "x11-altfullscreen", 0, NULL, ALT_FS_TEXT, ALT_FS_LONGTEXT )
-ADD_INTEGER ( "x11-drawable", -1, NULL, DRAWABLE_TEXT, DRAWABLE_LONGTEXT )
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_string( "x11-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT );
+ add_bool( "x11-altfullscreen", 0, NULL, ALT_FS_TEXT, ALT_FS_LONGTEXT );
+ add_integer( "x11-drawable", -1, NULL, DRAWABLE_TEXT, DRAWABLE_LONGTEXT );
#ifdef HAVE_SYS_SHM_H
-ADD_BOOL ( "x11-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT )
+ add_bool( "x11-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT );
#endif
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("X11 module") )
- ADD_CAPABILITY( VOUT, 50 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( vout_getfunctions )( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+ set_description( _("X11 module") );
+ set_capability( "video output", 50 );
+ set_callbacks( E_(Activate), E_(Deactivate) );
+vlc_module_end();
* xcommon.c: Functions common to the X11 and XVideo plugins
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: xcommon.c,v 1.45 2002/07/23 00:39:17 sam Exp $
+ * $Id: xcommon.c,v 1.46 2002/07/31 20:56:52 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
# include <X11/extensions/Xvlib.h>
#endif
-#include "xcommon.h"
-
#include "netutils.h" /* network_ChannelJoin */
-/*****************************************************************************
- * Defines
- *****************************************************************************/
-#ifdef MODULE_NAME_IS_xvideo
-# define IMAGE_TYPE XvImage
-# define EXTRA_ARGS int i_xvport, int i_chroma
-# define EXTRA_ARGS_SHM int i_xvport, int i_chroma, XShmSegmentInfo *p_shm
-# define DATA_SIZE(p) (p)->data_size
-# define IMAGE_FREE XFree /* There is nothing like XvDestroyImage */
-#else
-# define IMAGE_TYPE XImage
-# define EXTRA_ARGS Visual *p_visual, int i_depth, int i_bytes_per_pixel
-# define EXTRA_ARGS_SHM Visual *p_visual, int i_depth, XShmSegmentInfo *p_shm
-# define DATA_SIZE(p) ((p)->bytes_per_line * (p)->height)
-# define IMAGE_FREE XDestroyImage
-#endif
-
-VLC_DECLARE_STRUCT(x11_window_t)
+#include "xcommon.h"
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int vout_Create ( vout_thread_t * );
-static void vout_Destroy ( vout_thread_t * );
-static void vout_Render ( vout_thread_t *, picture_t * );
-static void vout_Display ( vout_thread_t *, picture_t * );
-static int vout_Manage ( vout_thread_t * );
-static int vout_Init ( vout_thread_t * );
-static void vout_End ( vout_thread_t * );
+int E_(Activate) ( vlc_object_t * );
+void E_(Deactivate) ( vlc_object_t * );
+
+static int InitVideo ( vout_thread_t * );
+static void EndVideo ( vout_thread_t * );
+static void DisplayVideo ( vout_thread_t *, picture_t * );
+static int ManageVideo ( vout_thread_t * );
static int InitDisplay ( vout_thread_t * );
#endif
/*****************************************************************************
- * x11_window_t: X11 window descriptor
- *****************************************************************************
- * This structure contains all the data necessary to describe an X11 window.
- *****************************************************************************/
-struct x11_window_t
-{
- Window base_window; /* base window */
- Window video_window; /* sub-window for displaying video */
- GC gc; /* graphic context instance handler */
- int i_width; /* width of main window */
- int i_height; /* height of main window */
- Atom wm_protocols;
- Atom wm_delete_window;
-};
-
-/*****************************************************************************
- * vout_sys_t: video output method descriptor
- *****************************************************************************
- * This structure is part of the video output thread descriptor.
- * It describes the X11 and XVideo specific properties of an output thread.
- *****************************************************************************/
-struct vout_sys_t
-{
- /* Internal settings and properties */
- Display * p_display; /* display pointer */
-
- Visual * p_visual; /* visual pointer */
- int i_screen; /* screen number */
-
- /* Our current window */
- x11_window_t * p_win;
-
- /* Our two windows */
- x11_window_t original_window;
- x11_window_t fullscreen_window;
-
- /* X11 generic properties */
- vlc_bool_t b_altfullscreen; /* which fullscreen method */
- vlc_bool_t b_createwindow; /* are we the base window's owner ? */
-#ifdef HAVE_SYS_SHM_H
- vlc_bool_t b_shm; /* shared memory extension flag */
-#endif
-
-#ifdef MODULE_NAME_IS_xvideo
- int i_xvport;
-#else
- Colormap colormap; /* colormap used (8bpp only) */
-
- int i_screen_depth;
- int i_bytes_per_pixel;
- int i_bytes_per_line;
-#endif
-
- /* Screen saver properties */
- int i_ss_timeout; /* timeout */
- int i_ss_interval; /* interval between changes */
- int i_ss_blanking; /* blanking mode */
- int i_ss_exposure; /* exposure mode */
-#ifdef DPMSINFO_IN_DPMS_H
- BOOL b_ss_dpms; /* DPMS mode */
-#endif
-
- /* Mouse pointer properties */
- vlc_bool_t b_mouse_pointer_visible;
- mtime_t i_time_mouse_last_moved; /* used to auto-hide pointer*/
- Cursor blank_cursor; /* the hidden cursor */
- mtime_t i_time_button_last_pressed; /* to track dbl-clicks */
- Pixmap cursor_pixmap;
-};
-
-/*****************************************************************************
- * picture_sys_t: direct buffer method descriptor
- *****************************************************************************
- * This structure is part of the picture descriptor, it describes the
- * XVideo specific properties of a direct buffer.
- *****************************************************************************/
-struct picture_sys_t
-{
- IMAGE_TYPE * p_image;
-
-#ifdef HAVE_SYS_SHM_H
- XShmSegmentInfo shminfo; /* shared memory zone information */
-#endif
-};
-
-/*****************************************************************************
- * mwmhints_t: window manager hints
- *****************************************************************************
- * Fullscreen needs to be able to hide the wm decorations so we provide
- * this structure to make it easier.
- *****************************************************************************/
-#define MWM_HINTS_DECORATIONS (1L << 1)
-#define PROP_MWM_HINTS_ELEMENTS 5
-typedef struct mwmhints_t
-{
- u32 flags;
- u32 functions;
- u32 decorations;
- s32 input_mode;
- u32 status;
-} mwmhints_t;
-
-/*****************************************************************************
- * Chroma defines
- *****************************************************************************/
-#ifdef MODULE_NAME_IS_xvideo
-# define MAX_DIRECTBUFFERS 10
-#else
-# define MAX_DIRECTBUFFERS 2
-#endif
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( vout_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->functions.vout.pf_create = vout_Create;
- p_function_list->functions.vout.pf_init = vout_Init;
- p_function_list->functions.vout.pf_end = vout_End;
- p_function_list->functions.vout.pf_destroy = vout_Destroy;
- p_function_list->functions.vout.pf_manage = vout_Manage;
- p_function_list->functions.vout.pf_render = vout_Render;
- p_function_list->functions.vout.pf_display = vout_Display;
-}
-
-/*****************************************************************************
- * vout_Create: allocate X11 video thread output method
+ * Activate: allocate X11 video thread output method
*****************************************************************************
* This function allocate and initialize a X11 vout method. It uses some of the
* vout properties to choose the window size, and change them according to the
* actual properties of the display.
*****************************************************************************/
-static int vout_Create( vout_thread_t *p_vout )
+int E_(Activate) ( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
char * psz_display;
#ifdef MODULE_NAME_IS_xvideo
char * psz_chroma;
vlc_bool_t b_chroma = 0;
#endif
+ p_vout->pf_init = InitVideo;
+ p_vout->pf_end = EndVideo;
+ p_vout->pf_manage = ManageVideo;
+ p_vout->pf_render = NULL;
+ p_vout->pf_display = DisplayVideo;
+
/* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
}
/*****************************************************************************
- * vout_Destroy: destroy X11 video thread output method
+ * Deactivate: destroy X11 video thread output method
*****************************************************************************
- * Terminate an output method created by vout_CreateOutputMethod
+ * Terminate an output method created by Open
*****************************************************************************/
-static void vout_Destroy( vout_thread_t *p_vout )
+void E_(Deactivate) ( vlc_object_t *p_this )
{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+
/* If the fullscreen window is still open, close it */
if( p_vout->b_fullscreen )
{
}
/*****************************************************************************
- * vout_Init: initialize X11 video thread output method
+ * InitVideo: initialize X11 video thread output method
*****************************************************************************
* This function create the XImages needed by the output thread. It is called
* at the beginning of the thread, but also each time the window is resized.
*****************************************************************************/
-static int vout_Init( vout_thread_t *p_vout )
+static int InitVideo( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic;
return( 0 );
}
-/*****************************************************************************
- * vout_Render: render previously calculated output
- *****************************************************************************/
-static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
-{
- ;
-}
-
/*****************************************************************************
- * vout_Display: displays previously rendered output
+ * DisplayVideo: displays previously rendered output
*****************************************************************************
* This function sends the currently rendered image to X11 server.
* (The Xv extension takes care of "double-buffering".)
*****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+static void DisplayVideo( vout_thread_t *p_vout, picture_t *p_pic )
{
int i_width, i_height, i_x, i_y;
}
/*****************************************************************************
- * vout_Manage: handle X11 events
+ * ManageVideo: handle X11 events
*****************************************************************************
* This function should be called regularly by video output thread. It manages
* X11 events and allows window resizing. It returns a non null value on
* error.
*****************************************************************************/
-static int vout_Manage( vout_thread_t *p_vout )
+static int ManageVideo( vout_thread_t *p_vout )
{
XEvent xevent; /* X11 event */
char i_key; /* ISO Latin-1 key */
}
/*****************************************************************************
- * vout_End: terminate X11 video thread output method
+ * EndVideo: terminate X11 video thread output method
*****************************************************************************
- * Destroy the X11 XImages created by vout_Init. It is called at the end of
+ * Destroy the X11 XImages created by Init. It is called at the end of
* the thread, but also each time the window is resized.
*****************************************************************************/
-static void vout_End( vout_thread_t *p_vout )
+static void EndVideo( vout_thread_t *p_vout )
{
int i_index;
XSelectInput( p_vout->p_sys->p_display, p_win->video_window,
ExposureMask );
- /* make sure the video window will be centered in the next vout_Manage() */
+ /* make sure the video window will be centered in the next ManageVideo() */
p_vout->i_changes |= VOUT_SIZE_CHANGE;
/* If the cursor was formerly blank than blank it again */
/*****************************************************************************
- * xcommon.h: Common X11 and Xvideo video output display method
+ * xcommon.h: Defines common to the X11 and XVideo plugins
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: xcommon.h,v 1.3 2002/03/17 13:53:21 gbazin Exp $
+ * $Id: xcommon.h,v 1.4 2002/07/31 20:56:52 sam Exp $
*
- * Authors: Shane Harper <shanegh@optusnet.com.au>
- * Vincent Seguin <seguin@via.ecp.fr>
+ * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* David Kennedy <dkennedy@tinytoad.com>
+ * Gildas Bazin <gbazin@netcourrier.com>
*
* 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
*****************************************************************************/
/*****************************************************************************
- * Common prototypes
+ * Defines
*****************************************************************************/
-void _M( vout_getfunctions )( function_list_t * p_function_list );
+#ifdef MODULE_NAME_IS_xvideo
+# define IMAGE_TYPE XvImage
+# define EXTRA_ARGS int i_xvport, int i_chroma
+# define EXTRA_ARGS_SHM int i_xvport, int i_chroma, XShmSegmentInfo *p_shm
+# define DATA_SIZE(p) (p)->data_size
+# define IMAGE_FREE XFree /* There is nothing like XvDestroyImage */
+#else
+# define IMAGE_TYPE XImage
+# define EXTRA_ARGS Visual *p_visual, int i_depth, int i_bytes_per_pixel
+# define EXTRA_ARGS_SHM Visual *p_visual, int i_depth, XShmSegmentInfo *p_shm
+# define DATA_SIZE(p) ((p)->bytes_per_line * (p)->height)
+# define IMAGE_FREE XDestroyImage
+#endif
+
+VLC_DECLARE_STRUCT(x11_window_t)
+
+/*****************************************************************************
+ * x11_window_t: X11 window descriptor
+ *****************************************************************************
+ * This structure contains all the data necessary to describe an X11 window.
+ *****************************************************************************/
+struct x11_window_t
+{
+ Window base_window; /* base window */
+ Window video_window; /* sub-window for displaying video */
+ GC gc; /* graphic context instance handler */
+ int i_width; /* width of main window */
+ int i_height; /* height of main window */
+ Atom wm_protocols;
+ Atom wm_delete_window;
+};
+
+/*****************************************************************************
+ * vout_sys_t: video output method descriptor
+ *****************************************************************************
+ * This structure is part of the video output thread descriptor.
+ * It describes the X11 and XVideo specific properties of an output thread.
+ *****************************************************************************/
+struct vout_sys_t
+{
+ /* Internal settings and properties */
+ Display * p_display; /* display pointer */
+
+ Visual * p_visual; /* visual pointer */
+ int i_screen; /* screen number */
+
+ /* Our current window */
+ x11_window_t * p_win;
+
+ /* Our two windows */
+ x11_window_t original_window;
+ x11_window_t fullscreen_window;
+
+ /* X11 generic properties */
+ vlc_bool_t b_altfullscreen; /* which fullscreen method */
+ vlc_bool_t b_createwindow; /* are we the base window's owner ? */
+#ifdef HAVE_SYS_SHM_H
+ vlc_bool_t b_shm; /* shared memory extension flag */
+#endif
+
+#ifdef MODULE_NAME_IS_xvideo
+ int i_xvport;
+#else
+ Colormap colormap; /* colormap used (8bpp only) */
+
+ int i_screen_depth;
+ int i_bytes_per_pixel;
+ int i_bytes_per_line;
+#endif
+
+ /* Screen saver properties */
+ int i_ss_timeout; /* timeout */
+ int i_ss_interval; /* interval between changes */
+ int i_ss_blanking; /* blanking mode */
+ int i_ss_exposure; /* exposure mode */
+#ifdef DPMSINFO_IN_DPMS_H
+ BOOL b_ss_dpms; /* DPMS mode */
+#endif
+
+ /* Mouse pointer properties */
+ vlc_bool_t b_mouse_pointer_visible;
+ mtime_t i_time_mouse_last_moved; /* used to auto-hide pointer*/
+ Cursor blank_cursor; /* the hidden cursor */
+ mtime_t i_time_button_last_pressed; /* to track dbl-clicks */
+ Pixmap cursor_pixmap;
+};
+
+/*****************************************************************************
+ * picture_sys_t: direct buffer method descriptor
+ *****************************************************************************
+ * This structure is part of the picture descriptor, it describes the
+ * XVideo specific properties of a direct buffer.
+ *****************************************************************************/
+struct picture_sys_t
+{
+ IMAGE_TYPE * p_image;
+
+#ifdef HAVE_SYS_SHM_H
+ XShmSegmentInfo shminfo; /* shared memory zone information */
+#endif
+};
+
+/*****************************************************************************
+ * mwmhints_t: window manager hints
+ *****************************************************************************
+ * Fullscreen needs to be able to hide the wm decorations so we provide
+ * this structure to make it easier.
+ *****************************************************************************/
+#define MWM_HINTS_DECORATIONS (1L << 1)
+#define PROP_MWM_HINTS_ELEMENTS 5
+typedef struct mwmhints_t
+{
+ u32 flags;
+ u32 functions;
+ u32 decorations;
+ s32 input_mode;
+ u32 status;
+} mwmhints_t;
+
+/*****************************************************************************
+ * Chroma defines
+ *****************************************************************************/
+#ifdef MODULE_NAME_IS_xvideo
+# define MAX_DIRECTBUFFERS 10
+#else
+# define MAX_DIRECTBUFFERS 2
+#endif
* xvideo.c : Xvideo plugin for vlc
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: xvideo.c,v 1.16 2002/07/02 19:14:59 sam Exp $
+ * $Id: xvideo.c,v 1.17 2002/07/31 20:56:52 sam Exp $
*
* Authors: Shane Harper <shanegh@optusnet.com.au>
* Vincent Seguin <seguin@via.ecp.fr>
#include <vlc/vlc.h>
-#include "xcommon.h"
+/*****************************************************************************
+ * Exported prototypes
+ *****************************************************************************/
+extern int E_(Activate) ( vlc_object_t * );
+extern void E_(Deactivate) ( vlc_object_t * );
/*****************************************************************************
- * Building configuration tree
+ * Module descriptor
*****************************************************************************/
#define ADAPTOR_TEXT N_("XVideo adaptor number")
#define ADAPTOR_LONGTEXT N_( \
#define SHM_LONGTEXT N_( \
"Use shared memory to communicate between vlc and the X server.")
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_STRING ( "xvideo-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT )
-ADD_INTEGER ( "xvideo-adaptor", -1, NULL, ADAPTOR_TEXT, ADAPTOR_LONGTEXT )
-ADD_BOOL ( "xvideo-altfullscreen", 0, NULL, ALT_FS_TEXT, ALT_FS_LONGTEXT )
-ADD_STRING ( "xvideo-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT )
-ADD_INTEGER ( "xvideo-drawable", -1, NULL, DRAWABLE_TEXT, DRAWABLE_LONGTEXT )
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_string( "xvideo-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT );
+ add_integer( "xvideo-adaptor", -1, NULL, ADAPTOR_TEXT, ADAPTOR_LONGTEXT );
+ add_bool( "xvideo-altfullscreen", 0, NULL, ALT_FS_TEXT, ALT_FS_LONGTEXT );
+ add_string( "xvideo-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT );
+ add_integer( "xvideo-drawable", -1, NULL, DRAWABLE_TEXT, DRAWABLE_LONGTEXT );
#ifdef HAVE_SYS_SHM_H
-ADD_BOOL ( "xvideo-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT )
+ add_bool( "xvideo-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT );
#endif
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("XVideo extension module") )
- ADD_CAPABILITY( VOUT, 150 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- _M( vout_getfunctions )( &p_module->p_functions->vout );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+ set_description( _("XVideo extension module") );
+ set_capability( "video output", 150 );
+ set_callbacks( E_(Activate), E_(Deactivate) );
+vlc_module_end();
/* following functions are local */
* xosd.c : X On Screen Display interface
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: xosd.c,v 1.4 2002/07/20 18:01:43 sam Exp $
+ * $Id: xosd.c,v 1.5 2002/07/31 20:56:52 sam Exp $
*
* Authors: Loïc Minier <lool@videolan.org>
*
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
-static void intf_getfunctions ( function_list_t * p_function_list );
-static int intf_Open ( intf_thread_t *p_intf );
-static void intf_Close ( intf_thread_t *p_intf );
-static void intf_Run ( intf_thread_t *p_intf );
+static int Open ( vlc_object_t * );
+static void Close ( vlc_object_t * );
+
+static void Run ( intf_thread_t * );
/*****************************************************************************
- * Build configuration tree.
+ * Module descriptor
*****************************************************************************/
#define POSITION_TEXT N_("flip vertical position")
#define POSITION_LONGTEXT N_("Display xosd output on the bottom of the " \
#define FONT_TEXT N_("font")
#define FONT_LONGTEXT N_("Font used to display text in the xosd output")
-MODULE_CONFIG_START
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_BOOL( "xosd-position", 1, NULL, POSITION_TEXT, POSITION_LONGTEXT )
-ADD_INTEGER( "xosd-text-offset", 0, NULL, TXT_OFS_TEXT, TXT_OFS_LONGTEXT )
-ADD_INTEGER( "xosd-shadow-offset", 1, NULL, SHD_OFS_TEXT, SHD_OFS_LONGTEXT )
-ADD_STRING( "xosd-font", "-misc-fixed-medium-r-*-*-*-300-*-*-*-*-*-*", NULL, FONT_TEXT, FONT_LONGTEXT )
-MODULE_CONFIG_STOP
-// -misc-fixed-medium-r-normal-*-*-160-*-*-c-*-iso8859-15
-
-MODULE_INIT_START
- SET_DESCRIPTION( _("xosd interface module") )
- ADD_CAPABILITY( INTF, 40 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
- intf_getfunctions( &p_module->p_functions->intf );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+vlc_module_begin();
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_bool( "xosd-position", 1, NULL, POSITION_TEXT, POSITION_LONGTEXT );
+ add_integer( "xosd-text-offset", 0, NULL, TXT_OFS_TEXT, TXT_OFS_LONGTEXT );
+ add_integer( "xosd-shadow-offset", 1, NULL,
+ SHD_OFS_TEXT, SHD_OFS_LONGTEXT );
+ add_string( "xosd-font", "-misc-fixed-medium-r-*-*-*-300-*-*-*-*-*-*",
+ NULL, FONT_TEXT, FONT_LONGTEXT );
+ set_description( _("xosd interface module") );
+ set_capability( "interface", 40 );
+ set_callbacks( Open, Close );
+vlc_module_end();
/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
+ * Open: initialize and create stuff
*****************************************************************************/
-static void intf_getfunctions( function_list_t * p_function_list )
+static int Open( vlc_object_t *p_this )
{
- p_function_list->functions.intf.pf_open = intf_Open;
- p_function_list->functions.intf.pf_close = intf_Close;
- p_function_list->functions.intf.pf_run = intf_Run;
-}
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
-/*****************************************************************************
- * intf_Open: initialize and create stuff
- *****************************************************************************/
-static int intf_Open( intf_thread_t * p_intf )
-{
/* Allocate instance and initialize some members */
p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
0,
XOSD_string,
"xosd interface initialized" );
+
+ p_intf->pf_run = Run;
+
return( 0 );
}
/*****************************************************************************
- * intf_Close: destroy interface stuff
+ * Close: destroy interface stuff
*****************************************************************************/
-static void intf_Close( intf_thread_t *p_intf )
-{
+static void Close( vlc_object_t *p_this )
+{
+ intf_thread_t *p_intf = (intf_thread_t *)p_this;
+
if( p_intf->p_sys->psz_source ) free( p_intf->p_sys->psz_source );
/* Uninitialize library */
}
/*****************************************************************************
- * intf_Run: xosd thread
+ * Run: xosd thread
*****************************************************************************
* This part of the interface runs in a separate thread
*****************************************************************************/
-static void intf_Run( intf_thread_t *p_intf )
+static void Run( intf_thread_t *p_intf )
{
p_intf->p_sys->p_input = NULL;
* audio_output.c : audio output thread
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: audio_output.c,v 1.86 2002/06/08 14:08:46 sam Exp $
+ * $Id: audio_output.c,v 1.87 2002/07/31 20:56:52 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
/* Choose the best module */
psz_name = config_GetPsz( p_aout, "aout" );
- p_aout->p_module = module_Need( p_aout, MODULE_CAPABILITY_AOUT,
- psz_name, (void *)p_aout );
+ p_aout->p_module = module_Need( p_aout, "audio output", psz_name );
if( psz_name ) free( psz_name );
if( p_aout->p_module == NULL )
{
return NULL;
}
-#define aout_functions p_aout->p_module->p_functions->aout.functions.aout
- p_aout->pf_open = aout_functions.pf_open;
- p_aout->pf_setformat = aout_functions.pf_setformat;
- p_aout->pf_getbufinfo = aout_functions.pf_getbufinfo;
- p_aout->pf_play = aout_functions.pf_play;
- p_aout->pf_close = aout_functions.pf_close;
-#undef aout_functions
-
/*
* Initialize audio device
*/
if ( p_aout->pf_setformat( p_aout ) )
{
- p_aout->pf_close( p_aout );
- module_Unneed( p_aout->p_module );
+ module_Unneed( p_aout, p_aout->p_module );
vlc_object_destroy( p_aout );
return NULL;
}
* this thread is only called in main and all calls are blocking */
if( aout_SpawnThread( p_aout ) )
{
- p_aout->pf_close( p_aout );
- module_Unneed( p_aout->p_module );
+ module_Unneed( p_aout, p_aout->p_module );
vlc_object_destroy( p_aout );
return NULL;
}
}
vlc_mutex_destroy( &p_aout->fifos_lock );
- /* Free the plugin */
- p_aout->pf_close( p_aout );
-
/* Release the aout module */
- module_Unneed( p_aout->p_module );
+ module_Unneed( p_aout, p_aout->p_module );
/* Free structure */
vlc_object_destroy( p_aout );
* decoders.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input.c,v 1.208 2002/07/25 21:53:53 sigmunau Exp $
+ * $Id: input.c,v 1.209 2002/07/31 20:56:52 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
p_input->psz_source = strdup( p_item->psz_name );
/* Demux */
- p_input->p_demux_module = NULL;
- p_input->pf_init = NULL;
- p_input->pf_end = NULL;
- p_input->pf_demux = NULL;
- p_input->pf_rewind = NULL;
+ p_input->p_demux = NULL;
/* Access */
- p_input->p_access_module = NULL;
- p_input->pf_open = NULL;
- p_input->pf_close = NULL;
- p_input->pf_read = NULL;
- p_input->pf_seek = NULL;
- p_input->pf_set_area = NULL;
- p_input->pf_set_program = NULL;
+ p_input->p_access = NULL;
p_input->i_bufsize = 0;
p_input->i_mtu = 0;
p_input->stream.control.i_rate = DEFAULT_RATE;
p_input->stream.control.b_mute = 0;
p_input->stream.control.b_grayscale = config_GetInt( p_input, "grayscale" );
- p_input->stream.control.i_smp = config_GetInt( p_input, "vdec-smp" );
/* Initialize input info */
p_input->stream.p_info = malloc( sizeof( input_info_category_t ) );
input_AccessReinit( p_input );
p_input->pf_set_program( p_input,
- p_input->stream.p_new_program );
+ p_input->stream.p_new_program );
/* Escape all decoders for the stream discontinuity they
* will encounter. */
if( p_input->stream.p_selected_area->i_seek != NO_SEEK )
{
- if( p_input->stream.b_seekable && p_input->pf_seek != NULL )
+ if( p_input->stream.b_seekable
+ && p_input->pf_seek != NULL )
{
off_t i_new_pos;
if( i_count == 0 && p_input->stream.b_seekable )
{
/* End of file - we do not set b_die because only the
- * interface is allowed to do so. */
+ * playlist is allowed to do so. */
msg_Info( p_input, "EOF reached" );
p_input->b_eof = 1;
}
}
/* Find and open appropriate access module */
- p_input->p_access_module =
- module_Need( p_input, MODULE_CAPABILITY_ACCESS,
- p_input->psz_access, (void *)p_input );
+ p_input->p_access = module_Need( p_input, "access",
+ p_input->psz_access );
- if( p_input->p_access_module == NULL )
+ if( p_input->p_access == NULL )
{
msg_Err( p_input, "no suitable access module for `%s/%s://%s'",
p_input->psz_access, p_input->psz_demux, p_input->psz_name );
return -1;
}
-#define f p_input->p_access_module->p_functions->access.functions.access
- p_input->pf_open = f.pf_open;
- p_input->pf_close = f.pf_close;
- p_input->pf_read = f.pf_read;
- p_input->pf_set_area = f.pf_set_area;
- p_input->pf_set_program = f.pf_set_program;
- p_input->pf_seek = f.pf_seek;
-#undef f
-
/* Waiting for stream. */
if( p_input->i_mtu )
{
{
if( p_input->b_die || p_input->b_error || p_input->b_eof )
{
- module_Unneed( p_input->p_access_module );
+ module_Unneed( p_input, p_input->p_access );
return -1;
}
}
}
/* Find and open appropriate demux module */
- p_input->p_demux_module =
- module_Need( p_input, MODULE_CAPABILITY_DEMUX,
- p_input->psz_demux, (void *)p_input );
+ p_input->p_demux = module_Need( p_input, "demux",
+ p_input->psz_demux );
- if( p_input->p_demux_module == NULL )
+ if( p_input->p_demux== NULL )
{
msg_Err( p_input, "no suitable demux module for `%s/%s://%s'",
p_input->psz_access, p_input->psz_demux, p_input->psz_name );
- module_Unneed( p_input->p_access_module );
+ module_Unneed( p_input, p_input->p_access );
return -1;
}
-#define f p_input->p_demux_module->p_functions->demux.functions.demux
- p_input->pf_init = f.pf_init;
- p_input->pf_end = f.pf_end;
- p_input->pf_demux = f.pf_demux;
- p_input->pf_rewind = f.pf_rewind;
-#undef f
-
return 0;
}
input_EndStream( p_input );
/* Free demultiplexer's data */
- p_input->pf_end( p_input );
- module_Unneed( p_input->p_demux_module );
+ module_Unneed( p_input, p_input->p_demux );
/* Close the access plug-in */
- p_input->pf_close( p_input );
- module_Unneed( p_input->p_access_module );
+ module_Unneed( p_input, p_input->p_access );
input_AccessEnd( p_input );
* input_dec.c: Functions for the management of decoders
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: input_dec.c,v 1.40 2002/07/23 00:39:17 sam Exp $
+ * $Id: input_dec.c,v 1.41 2002/07/31 20:56:52 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
decoder_fifo_t * input_RunDecoder( input_thread_t * p_input,
es_descriptor_t * p_es )
{
- char * psz_plugin = config_GetPsz( p_input, "codec" );
+ char * psz_plugin;
+ decoder_fifo_t *p_fifo;
- /* Get a suitable module */
- p_es->p_module = module_Need( p_input, MODULE_CAPABILITY_DECODER,
- psz_plugin, (void *)&p_es->i_fourcc );
- if( psz_plugin ) free( psz_plugin );
- if( p_es->p_module == NULL )
+ /* Create the decoder configuration structure */
+ p_fifo = CreateDecoderFifo( p_input, p_es );
+
+ if( p_fifo == NULL )
{
- msg_Err( p_input, "no suitable decoder module for fourcc `%4.4s'",
- (char*)&p_es->i_fourcc );
+ msg_Err( p_input, "could not create decoder fifo" );
return NULL;
}
- /* Create the decoder configuration structure */
- p_es->p_decoder_fifo = CreateDecoderFifo( p_input, p_es );
-
- if( p_es->p_decoder_fifo == NULL )
+ /* Get a suitable module */
+ psz_plugin = config_GetPsz( p_fifo, "codec" );
+ p_fifo->p_module = module_Need( p_fifo, "decoder", psz_plugin );
+ if( psz_plugin ) free( psz_plugin );
+ if( p_fifo->p_module == NULL )
{
- msg_Err( p_input, "could not create decoder fifo" );
- module_Unneed( p_es->p_module );
+ msg_Err( p_fifo, "no suitable decoder module for fourcc `%4.4s'",
+ (char*)&p_fifo->i_fourcc );
+ DeleteDecoderFifo( p_fifo );
+ vlc_object_destroy( p_fifo );
return NULL;
}
/* Spawn the decoder thread */
- if ( vlc_thread_create( p_es->p_decoder_fifo, "decoder",
- p_es->p_module->p_functions->dec.functions.dec.pf_run, 0 ) )
+ if( vlc_thread_create( p_fifo, "decoder", p_fifo->pf_run, 0 ) )
{
- msg_Err( p_input, "cannot spawn decoder thread \"%s\"",
- p_es->p_module->psz_object_name );
- DeleteDecoderFifo( p_es->p_decoder_fifo );
- module_Unneed( p_es->p_module );
+ msg_Err( p_fifo, "cannot spawn decoder thread \"%s\"",
+ p_fifo->p_module->psz_object_name );
+ module_Unneed( p_fifo, p_fifo->p_module );
return NULL;
}
p_input->stream.b_changed = 1;
- return p_es->p_decoder_fifo;
+ return p_fifo;
}
DeleteDecoderFifo( p_es->p_decoder_fifo );
/* Unneed module */
- module_Unneed( p_es->p_module );
+ module_Unneed( p_es->p_decoder_fifo, p_es->p_decoder_fifo->p_module );
+
+ /* Delete the fifo */
+ vlc_object_destroy( p_es->p_decoder_fifo );
/* Tell the input there is no more decoder */
p_es->p_decoder_fifo = NULL;
/* Destroy the lock and cond */
vlc_cond_destroy( &p_fifo->data_wait );
vlc_mutex_destroy( &p_fifo->data_lock );
-
- vlc_object_destroy( p_fifo );
}
* input_ext-intf.c: services to the interface
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input_ext-intf.c,v 1.39 2002/07/23 00:39:17 sam Exp $
+ * $Id: input_ext-intf.c,v 1.40 2002/07/31 20:56:52 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
return 0;
}
-/****************************************************************************
- * input_SetSMP: change the number of video decoder threads
- ****************************************************************************/
-int input_SetSMP( input_thread_t * p_input, int i_smp )
-{
- /* No need to warn the input thread since only the decoders
- * worry about it. */
- vlc_mutex_lock( &p_input->stream.control.control_lock );
- p_input->stream.control.i_smp = i_smp;
- vlc_mutex_unlock( &p_input->stream.control.control_lock );
-
- return 0;
-}
-
* input_ext-plugins.c: useful functions for access and demux plug-ins
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: input_ext-plugins.c,v 1.17 2002/07/24 23:11:55 massiot Exp $
+ * $Id: input_ext-plugins.c,v 1.18 2002/07/31 20:56:52 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
/* Safety check */
if( p_buffers->i_allocated > INPUT_MAX_ALLOCATION )
{
-//X intf_Err( "INPUT_MAX_ALLOCATION reached (%d)",
-//X p_buffers->i_allocated );
return NULL;
}
p_buf = malloc( sizeof(input_buffers_t) + i_size );
if( p_buf == NULL )
{
-//X intf_ErrMsg( "Out of memory" );
return NULL;
}
p_buf->i_size = i_size;
p_buf = malloc( sizeof(input_buffers_t) + i_size );
if( p_buf == NULL )
{
-//X intf_ErrMsg( "Out of memory" );
return NULL;
}
p_buf->i_size = i_size;
p_buf->p_next = NULL;
p_buf->i_refcount = 0;
- return( p_buf );
+ return p_buf;
}
data_buffer_t * input_NewBuffer( input_buffers_t * p_buffers, size_t i_size )
p_data = malloc( sizeof(data_packet_t) );
if( p_data == NULL )
{
-//X intf_ErrMsg( "Out of memory" );
return NULL;
}
}
p_data->p_payload_end = p_data->p_demux_start + p_buf->i_size;
p_buf->i_refcount++;
- return( p_data );
+ return p_data;
}
data_packet_t * input_ShareBuffer( input_buffers_t * p_buffers,
static inline data_packet_t * NewPacket( input_buffers_t * p_buffers,
size_t i_size )
{
- data_buffer_t * p_buf = NewBuffer( p_buffers, i_size );
+ data_buffer_t * p_buf;
data_packet_t * p_data;
+ p_buf = NewBuffer( p_buffers, i_size );
+
if( p_buf == NULL )
{
return( NULL );
p_pes = malloc( sizeof(pes_packet_t) );
if( p_pes == NULL )
{
-//X intf_ErrMsg( "Out of memory" );
return NULL;
}
}
i_remains + p_input->i_bufsize );
if( p_buf == NULL )
{
- return( -1 );
+ msg_Err( p_input, "failed allocating a new buffer (decoder stuck?)" );
+ return -1;
}
p_buf->i_refcount = 1;
/*****************************************************************************
* input_FDClose: close the target
*****************************************************************************/
-void input_FDClose( input_thread_t * p_input )
+void __input_FDClose( vlc_object_t * p_this )
{
+ input_thread_t * p_input = (input_thread_t *)p_this;
input_socket_t * p_access_data = (input_socket_t *)p_input->p_access_data;
msg_Info( p_input, "closing `%s/%s://%s'",
/*****************************************************************************
* input_FDNetworkClose: close a network target
*****************************************************************************/
-void input_FDNetworkClose( input_thread_t * p_input )
+void __input_FDNetworkClose( vlc_object_t * p_this )
{
+ input_thread_t * p_input = (input_thread_t *)p_this;
input_socket_t * p_access_data = (input_socket_t *)p_input->p_access_data;
msg_Info( p_input, "closing network `%s/%s://%s'",
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999-2002 VideoLAN
- * $Id: input_programs.c,v 1.93 2002/07/23 00:39:17 sam Exp $
+ * $Id: input_programs.c,v 1.94 2002/07/31 20:56:52 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
*****************************************************************************/
int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
{
- decoder_fifo_t *p_fifo;
-
if( p_es == NULL )
{
msg_Err( p_input, "nothing to do in input_SelectES" );
/* Release the lock, not to block the input thread during
* the creation of the thread. */
vlc_mutex_unlock( &p_input->stream.stream_lock );
- p_fifo = input_RunDecoder( p_input, p_es );
+ p_es->p_decoder_fifo = input_RunDecoder( p_input, p_es );
vlc_mutex_lock( &p_input->stream.stream_lock );
- if( p_fifo == NULL )
+ if( p_es->p_decoder_fifo == NULL )
{
return -1;
}
- p_es->p_decoder_fifo = p_fifo;
-
return 0;
}
* interface, such as command line.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: interface.c,v 1.96 2002/06/04 00:11:12 sam Exp $
+ * $Id: interface.c,v 1.97 2002/07/31 20:56:52 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
/* Choose the best module */
psz_name = config_GetPsz( p_intf, "intf" );
- p_intf->p_module = module_Need( p_intf, MODULE_CAPABILITY_INTF,
- psz_name, (void *)p_intf );
+ p_intf->p_module = module_Need( p_intf, "interface", psz_name );
if( psz_name ) free( psz_name );
if( p_intf->p_module == NULL )
return NULL;
}
-#define f p_intf->p_module->p_functions->intf.functions.intf
- p_intf->pf_open = f.pf_open;
- p_intf->pf_close = f.pf_close;
- p_intf->pf_run = f.pf_run;
-#undef f
-
/* Initialize structure */
p_intf->b_menu = 0;
p_intf->b_menu_change = 0;
*****************************************************************************/
void intf_Destroy( intf_thread_t *p_intf )
{
- /* Destroy interface */
- p_intf->pf_close( p_intf );
-
/* Unlock module */
- module_Unneed( p_intf->p_module );
+ module_Unneed( p_intf, p_intf->p_module );
vlc_mutex_destroy( &p_intf->change_lock );
/*****************************************************************************
* libvlc.c: main libvlc source
- * Includes the main() function for vlc. Parses command line, starts playlist
- * and spawns threads.
*****************************************************************************
- * Copyright (C) 1998-2001 VideoLAN
- * $Id: libvlc.c,v 1.18 2002/07/21 18:57:02 sigmunau Exp $
+ * Copyright (C) 1998-2002 VideoLAN
+ * $Id: libvlc.c,v 1.19 2002/07/31 20:56:52 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
static void Usage ( vlc_t *, const char *psz_module_name );
static void ListModules ( vlc_t * );
static void Version ( void );
-static void Build ( void );
#ifndef WIN32
static void InitSignalHandler ( void );
fprintf( stderr, COPYRIGHT_MESSAGE "\n" );
/* Guess what CPU we have */
- p_vlc->i_cpu_capabilities = CPUCapabilities( p_vlc );
+ p_vlc->i_cpu = CPUCapabilities( p_vlc );
/*
* Support for gettext
}
p_help_module->psz_object_name = "help";
config_Duplicate( p_help_module, p_help_config );
- p_help_module->next = p_vlc->module_bank.first;
- p_vlc->module_bank.first = p_help_module;
+ p_help_module->next = p_vlc->p_module_bank->first;
+ p_vlc->p_module_bank->first = p_help_module;
/* End hack */
if( config_LoadCmdLine( p_vlc, &i_argc, ppsz_argv, VLC_TRUE ) )
{
- p_vlc->module_bank.first = p_help_module->next;
+ p_vlc->p_module_bank->first = p_help_module->next;
config_Free( p_help_module );
vlc_object_destroy( p_help_module );
module_EndBank( p_vlc );
Usage( p_vlc, "help" );
Usage( p_vlc, "main" );
- p_vlc->module_bank.first = p_help_module->next;
+ p_vlc->p_module_bank->first = p_help_module->next;
config_Free( p_help_module );
vlc_object_destroy( p_help_module );
module_EndBank( p_vlc );
if( config_GetInt( p_vlc, "version" ) )
{
Version();
- p_vlc->module_bank.first = p_help_module->next;
- config_Free( p_help_module );
- vlc_object_destroy( p_help_module );
- module_EndBank( p_vlc );
- msg_Destroy( p_vlc );
- return VLC_EEXIT;
- }
-
- /* Check for build option */
- if( config_GetInt( p_vlc, "build" ) )
- {
- Build();
- p_vlc->module_bank.first = p_help_module->next;
+ p_vlc->p_module_bank->first = p_help_module->next;
config_Free( p_help_module );
vlc_object_destroy( p_help_module );
module_EndBank( p_vlc );
}
/* Hack: remove the help module here */
- p_vlc->module_bank.first = p_help_module->next;
+ p_vlc->p_module_bank->first = p_help_module->next;
/* End hack */
/*
module_LoadBuiltins( p_vlc );
module_LoadPlugins( p_vlc );
msg_Dbg( p_vlc, "module bank initialized, found %i modules",
- p_vlc->module_bank.i_count );
+ p_vlc->p_module_bank->i_count );
/* Hack: insert the help module here */
- p_help_module->next = p_vlc->module_bank.first;
- p_vlc->module_bank.first = p_help_module;
+ p_help_module->next = p_vlc->p_module_bank->first;
+ p_vlc->p_module_bank->first = p_help_module;
/* End hack */
/* Check for help on modules */
{
Usage( p_vlc, p_tmp );
free( p_tmp );
- p_vlc->module_bank.first = p_help_module->next;
+ p_vlc->p_module_bank->first = p_help_module->next;
config_Free( p_help_module );
vlc_object_destroy( p_help_module );
module_EndBank( p_vlc );
if( config_GetInt( p_vlc, "longhelp" ) )
{
Usage( p_vlc, NULL );
- p_vlc->module_bank.first = p_help_module->next;
+ p_vlc->p_module_bank->first = p_help_module->next;
config_Free( p_help_module );
vlc_object_destroy( p_help_module );
module_EndBank( p_vlc );
if( config_GetInt( p_vlc, "list" ) )
{
ListModules( p_vlc );
- p_vlc->module_bank.first = p_help_module->next;
+ p_vlc->p_module_bank->first = p_help_module->next;
config_Free( p_help_module );
vlc_object_destroy( p_help_module );
module_EndBank( p_vlc );
}
/* Hack: remove the help module here */
- p_vlc->module_bank.first = p_help_module->next;
+ p_vlc->p_module_bank->first = p_help_module->next;
config_Free( p_help_module );
vlc_object_destroy( p_help_module );
/* End hack */
/* p_vlc inititalization. FIXME ? */
p_vlc->i_desync = config_GetInt( p_vlc, "desync" ) * (mtime_t)1000;
+#if defined( __i386__ )
if( !config_GetInt( p_vlc, "mmx" ) )
- p_vlc->i_cpu_capabilities &= ~CPU_CAPABILITY_MMX;
+ p_vlc->i_cpu &= ~CPU_CAPABILITY_MMX;
if( !config_GetInt( p_vlc, "3dn" ) )
- p_vlc->i_cpu_capabilities &= ~CPU_CAPABILITY_3DNOW;
+ p_vlc->i_cpu &= ~CPU_CAPABILITY_3DNOW;
if( !config_GetInt( p_vlc, "mmxext" ) )
- p_vlc->i_cpu_capabilities &= ~CPU_CAPABILITY_MMXEXT;
+ p_vlc->i_cpu &= ~CPU_CAPABILITY_MMXEXT;
if( !config_GetInt( p_vlc, "sse" ) )
- p_vlc->i_cpu_capabilities &= ~CPU_CAPABILITY_SSE;
+ p_vlc->i_cpu &= ~CPU_CAPABILITY_SSE;
+#endif
+#if defined( __powerpc__ ) || defined( SYS_DARWIN )
if( !config_GetInt( p_vlc, "altivec" ) )
- p_vlc->i_cpu_capabilities &= ~CPU_CAPABILITY_ALTIVEC;
+ p_vlc->i_cpu &= ~CPU_CAPABILITY_ALTIVEC;
+#endif
#define PRINT_CAPABILITY( capability, string ) \
- if( p_vlc->i_cpu_capabilities & capability ) \
+ if( p_vlc->i_cpu & capability ) \
{ \
strncat( p_capabilities, string " ", \
sizeof(p_capabilities) - strlen(p_capabilities) ); \
* Choose the best memcpy module
*/
psz_module = config_GetPsz( p_vlc, "memcpy" );
- p_vlc->p_memcpy_module =
- module_Need( p_vlc, MODULE_CAPABILITY_MEMCPY, psz_module, NULL );
+ p_vlc->p_memcpy_module = module_Need( p_vlc, "memcpy", psz_module );
if( psz_module ) free( psz_module );
+
if( p_vlc->p_memcpy_module == NULL )
{
- msg_Err( p_vlc, "no suitable memcpy module, using libc default" );
+ msg_Warn( p_vlc, "no suitable memcpy module, using libc default" );
p_vlc->pf_memcpy = memcpy;
}
- else
- {
- p_vlc->pf_memcpy = p_vlc->p_memcpy_module->p_functions
- ->memcpy.functions.memcpy.pf_memcpy;
- }
/*
* Initialize shared resources and libraries
&& network_ChannelCreate( p_vlc ) )
{
/* On error during Channels initialization, switch off channels */
- msg_Err( p_vlc,
- "channels initialization failed, deactivating channels" );
+ msg_Warn( p_vlc,
+ "channels initialization failed, deactivating channels" );
config_PutInt( p_vlc, "network-channel", VLC_FALSE );
}
msg_Err( p_vlc, "playlist initialization failed" );
if( p_vlc->p_memcpy_module != NULL )
{
- module_Unneed( p_vlc->p_memcpy_module );
+ module_Unneed( p_vlc, p_vlc->p_memcpy_module );
}
module_EndBank( p_vlc );
msg_Destroy( p_vlc );
*/
if( p_vlc->p_memcpy_module != NULL )
{
- module_Unneed( p_vlc->p_memcpy_module );
+ module_Unneed( p_vlc, p_vlc->p_memcpy_module );
}
free( p_vlc->psz_homedir );
#endif
/* Enumerate the config for each module */
- for( p_module = p_this->p_vlc->module_bank.first ;
+ for( p_module = p_this->p_vlc->p_module_bank->first ;
p_module != NULL ;
p_module = p_module->next )
{
fprintf( stderr, _("[module] [description]\n") );
/* Enumerate each module */
- for( p_module = p_this->p_vlc->module_bank.first ;
+ for( p_module = p_this->p_vlc->p_module_bank->first ;
p_module != NULL ;
p_module = p_module->next )
{
#endif
}
-/*****************************************************************************
- * Build: print information about the vlc build
- *****************************************************************************
- * Print the ./configure command line and other information.
- *****************************************************************************/
-static void Build( void )
-{
-#ifdef WIN32
- ShowConsole();
-#endif
-
- fprintf( stderr, "configured with %s\n", CONFIGURE_LINE );
-
-#ifdef WIN32 /* Pause the console because it's destroyed when we exit */
- fprintf( stderr, _("\nPress the RETURN key to continue...\n") );
- getchar();
-#endif
-}
-
/*****************************************************************************
* ShowConsole: On Win32, create an output console for debug messages
*****************************************************************************
* libvlc.h: main libvlc header
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.h,v 1.8 2002/07/29 19:05:47 gbazin Exp $
+ * $Id: libvlc.h,v 1.9 2002/07/31 20:56:52 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/*
* Quick usage guide for the configuration options:
*
- * MODULE_CONFIG_START
- * MODULE_CONFIG_STOP
- * ADD_CATEGORY_HINT( N_(text), N_(longtext) )
- * ADD_SUBCATEGORY_HINT( N_(text), N_(longtext) )
- * ADD_USAGE_HINT( N_(text) )
- * ADD_STRING( option_name, value, p_callback, N_(text), N_(longtext) )
- * ADD_FILE( option_name, psz_value, p_callback, N_(text), N_(longtext) )
- * ADD_MODULE( option_name, psz_value, i_capability, p_callback,
- * N_(text), N_(longtext) )
- * ADD_INTEGER( option_name, i_value, p_callback, N_(text), N_(longtext) )
- * ADD_BOOL( option_name, b_value, p_callback, N_(text), N_(longtext) )
+ * add_category_hint( N_(text), N_(longtext) );
+ * add_subcategory_hint( N_(text), N_(longtext) );
+ * add_usage_hint( N_(text) );
+ * add_string( option_name, value, p_callback, N_(text), N_(longtext) );
+ * add_file( option_name, psz_value, p_callback, N_(text), N_(longtext) );
+ * add_module( option_name, psz_value, i_capability, p_callback,
+ * N_(text), N_(longtext) );
+ * add_integer( option_name, i_value, p_callback, N_(text), N_(longtext) );
+ * add_bool( option_name, b_value, p_callback, N_(text), N_(longtext) );
*/
-MODULE_CONFIG_START
-
-/* Interface options */
-ADD_CATEGORY_HINT( N_("Interface"), NULL)
-ADD_MODULE_WITH_SHORT ( "intf", 'I', MODULE_CAPABILITY_INTF, NULL, NULL, INTF_TEXT, INTF_LONGTEXT )
-ADD_BOOL_WITH_SHORT ( "verbose", 'v', 0, NULL, VERBOSE_TEXT, VERBOSE_LONGTEXT )
-ADD_BOOL_WITH_SHORT ( "quiet", 'q', 0, NULL, QUIET_TEXT, QUIET_LONGTEXT )
-ADD_BOOL ( "color", 0, NULL, COLOR_TEXT, COLOR_LONGTEXT )
-ADD_STRING ( "search-path", NULL, NULL, INTF_PATH_TEXT, INTF_PATH_LONGTEXT )
-ADD_STRING ( "plugin-path", NULL, NULL, PLUGIN_PATH_TEXT, PLUGIN_PATH_LONGTEXT )
-
-/* Audio options */
-ADD_CATEGORY_HINT( N_("Audio"), NULL)
-ADD_MODULE_WITH_SHORT ( "aout", 'A', MODULE_CAPABILITY_AOUT, NULL, NULL, AOUT_TEXT, AOUT_LONGTEXT )
-ADD_BOOL ( "audio", 1, NULL, AUDIO_TEXT, AUDIO_LONGTEXT )
-ADD_BOOL ( "mono", 0, NULL, MONO_TEXT, MONO_LONGTEXT )
-ADD_INTEGER ( "volume", VOLUME_DEFAULT, NULL, VOLUME_TEXT, VOLUME_LONGTEXT )
-ADD_INTEGER ( "rate", 44100, NULL, RATE_TEXT, RATE_LONGTEXT )
-ADD_INTEGER ( "desync", 0, NULL, DESYNC_TEXT, DESYNC_LONGTEXT )
-ADD_INTEGER ( "audio-format", 0, NULL, FORMAT_TEXT, FORMAT_LONGTEXT )
-
-/* Video options */
-ADD_CATEGORY_HINT( N_("Video"), NULL )
-ADD_MODULE_WITH_SHORT ( "vout", 'V', MODULE_CAPABILITY_VOUT, NULL, NULL, VOUT_TEXT, VOUT_LONGTEXT )
-ADD_BOOL ( "video", 1, NULL, VIDEO_TEXT, VIDEO_LONGTEXT )
-ADD_INTEGER ( "width", -1, NULL, WIDTH_TEXT, WIDTH_LONGTEXT )
-ADD_INTEGER ( "height", -1, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT )
-ADD_FLOAT ( "zoom", 1, NULL, ZOOM_TEXT, ZOOM_LONGTEXT )
-ADD_BOOL ( "grayscale", 0, NULL, GRAYSCALE_TEXT, GRAYSCALE_LONGTEXT )
-ADD_BOOL ( "fullscreen", 0, NULL, FULLSCREEN_TEXT, FULLSCREEN_LONGTEXT )
-ADD_BOOL ( "overlay", 1, NULL, OVERLAY_TEXT, OVERLAY_LONGTEXT )
-ADD_INTEGER ( "spumargin", -1, NULL, SPUMARGIN_TEXT, SPUMARGIN_LONGTEXT )
-ADD_MODULE ( "filter", MODULE_CAPABILITY_VOUT_FILTER, NULL, NULL, FILTER_TEXT, FILTER_LONGTEXT )
-
-/* Input options */
-ADD_CATEGORY_HINT( N_("Input"), NULL )
-ADD_INTEGER ( "server-port", 1234, NULL, SERVER_PORT_TEXT, SERVER_PORT_LONGTEXT )
-ADD_BOOL ( "network-channel", 0, NULL, NETCHANNEL_TEXT, NETCHANNEL_LONGTEXT )
-ADD_STRING ( "channel-server", "localhost", NULL, CHAN_SERV_TEXT, CHAN_SERV_LONGTEXT )
-ADD_INTEGER ( "channel-port", 6010, NULL, CHAN_PORT_TEXT, CHAN_PORT_LONGTEXT )
-ADD_INTEGER ( "mtu", 1500, NULL, MTU_TEXT, MTU_LONGTEXT )
-ADD_STRING ( "iface", "eth0", NULL, IFACE_TEXT, IFACE_LONGTEXT )
-
-ADD_INTEGER ( "program", 0, NULL, INPUT_PROGRAM_TEXT, INPUT_PROGRAM_LONGTEXT )
-ADD_INTEGER ( "audio-type", -1, NULL, INPUT_AUDIO_TEXT, INPUT_AUDIO_LONGTEXT )
-ADD_INTEGER ( "audio-channel", -1, NULL, INPUT_CHAN_TEXT, INPUT_CHAN_LONGTEXT )
-ADD_INTEGER ( "spu-channel", -1, NULL, INPUT_SUBT_TEXT, INPUT_SUBT_LONGTEXT )
-
-ADD_STRING ( "dvd", DVD_DEVICE, NULL, DVD_DEV_TEXT, DVD_DEV_LONGTEXT )
-ADD_STRING ( "vcd", VCD_DEVICE, NULL, VCD_DEV_TEXT, VCD_DEV_LONGTEXT )
-
-ADD_BOOL_WITH_SHORT ( "ipv6", '6', 0, NULL, IPV6_TEXT, IPV6_LONGTEXT )
-ADD_BOOL_WITH_SHORT ( "ipv4", '4', 0, NULL, IPV4_TEXT, IPV4_LONGTEXT )
-
-/* Decoder options */
-ADD_CATEGORY_HINT( N_("Decoders"), NULL )
-ADD_MODULE ( "codec", MODULE_CAPABILITY_DECODER, NULL, NULL, CODEC_TEXT, CODEC_LONGTEXT )
-
-/* CPU options */
-ADD_CATEGORY_HINT( N_("CPU"), NULL )
-ADD_BOOL ( "mmx", 1, NULL, MMX_TEXT, MMX_LONGTEXT )
-ADD_BOOL ( "3dn", 1, NULL, THREE_DN_TEXT, THREE_DN_LONGTEXT )
-ADD_BOOL ( "mmxext", 1, NULL, MMXEXT_TEXT, MMXEXT_LONGTEXT )
-ADD_BOOL ( "sse", 1, NULL, SSE_TEXT, SSE_LONGTEXT )
-ADD_BOOL ( "altivec", 1, NULL, ALTIVEC_TEXT, ALTIVEC_LONGTEXT )
-
-/* Playlist options */
-ADD_CATEGORY_HINT( N_("Playlist"), NULL )
-ADD_BOOL ( "playlist", 0, NULL, PL_LAUNCH_TEXT, PL_LAUNCH_LONGTEXT )
-ADD_BOOL ( "enqueue", 0, NULL, PL_ENQUEUE_TEXT, PL_ENQUEUE_LONGTEXT )
-ADD_BOOL ( "loop", 0, NULL, PL_LOOP_TEXT, PL_LOOP_LONGTEXT )
-
-/* Misc options */
-ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
-ADD_MODULE ( "memcpy", MODULE_CAPABILITY_MEMCPY, NULL, NULL, MEMCPY_TEXT, MEMCPY_LONGTEXT )
-ADD_MODULE ( "access", MODULE_CAPABILITY_ACCESS, NULL, NULL, ACCESS_TEXT, ACCESS_LONGTEXT )
-ADD_MODULE ( "demux", MODULE_CAPABILITY_DEMUX, NULL, NULL, DEMUX_TEXT, DEMUX_LONGTEXT )
-
-#if defined(WIN32)
-ADD_BOOL ( "fast-mutex", 0, NULL, FAST_MUTEX_TEXT, FAST_MUTEX_LONGTEXT )
-ADD_INTEGER ( "win9x-cv-method", 0, NULL, WIN9X_CV_TEXT, WIN9X_CV_LONGTEXT )
+vlc_module_begin();
+ /* Interface options */
+ add_category_hint( N_("Interface"), NULL);
+ add_module_with_short( "intf", 'I', "interface", NULL, NULL,
+ INTF_TEXT, INTF_LONGTEXT );
+ add_bool_with_short( "verbose", 'v', 0, NULL,
+ VERBOSE_TEXT, VERBOSE_LONGTEXT );
+ add_bool_with_short( "quiet", 'q', 0, NULL, QUIET_TEXT, QUIET_LONGTEXT );
+ add_bool( "color", 0, NULL, COLOR_TEXT, COLOR_LONGTEXT );
+ add_string( "search-path", NULL, NULL, INTF_PATH_TEXT, INTF_PATH_LONGTEXT );
+ add_string( "plugin-path", NULL, NULL,
+ PLUGIN_PATH_TEXT, PLUGIN_PATH_LONGTEXT );
+
+ /* Audio options */
+ add_category_hint( N_("Audio"), NULL);
+ add_module_with_short( "aout", 'A', "audio output", NULL, NULL,
+ AOUT_TEXT, AOUT_LONGTEXT );
+ add_bool( "audio", 1, NULL, AUDIO_TEXT, AUDIO_LONGTEXT );
+ add_bool( "mono", 0, NULL, MONO_TEXT, MONO_LONGTEXT );
+ add_integer( "volume", VOLUME_DEFAULT, NULL, VOLUME_TEXT, VOLUME_LONGTEXT );
+ add_integer( "rate", 44100, NULL, RATE_TEXT, RATE_LONGTEXT );
+ add_integer( "desync", 0, NULL, DESYNC_TEXT, DESYNC_LONGTEXT );
+ add_integer( "audio-format", 0, NULL, FORMAT_TEXT, FORMAT_LONGTEXT );
+
+ /* Video options */
+ add_category_hint( N_("Video"), NULL );
+ add_module_with_short( "vout", 'V', "video output", NULL, NULL,
+ VOUT_TEXT, VOUT_LONGTEXT );
+ add_bool( "video", 1, NULL, VIDEO_TEXT, VIDEO_LONGTEXT );
+ add_integer( "width", -1, NULL, WIDTH_TEXT, WIDTH_LONGTEXT );
+ add_integer( "height", -1, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT );
+ add_float( "zoom", 1, NULL, ZOOM_TEXT, ZOOM_LONGTEXT );
+ add_bool( "grayscale", 0, NULL, GRAYSCALE_TEXT, GRAYSCALE_LONGTEXT );
+ add_bool( "fullscreen", 0, NULL, FULLSCREEN_TEXT, FULLSCREEN_LONGTEXT );
+ add_bool( "overlay", 1, NULL, OVERLAY_TEXT, OVERLAY_LONGTEXT );
+ add_integer( "spumargin", -1, NULL, SPUMARGIN_TEXT, SPUMARGIN_LONGTEXT );
+ add_module( "filter", "video filter", NULL, NULL,
+ FILTER_TEXT, FILTER_LONGTEXT );
+
+ /* Input options */
+ add_category_hint( N_("Input"), NULL );
+ add_integer( "server-port", 1234, NULL,
+ SERVER_PORT_TEXT, SERVER_PORT_LONGTEXT );
+ add_bool( "network-channel", 0, NULL,
+ NETCHANNEL_TEXT, NETCHANNEL_LONGTEXT );
+ add_string( "channel-server", "localhost", NULL,
+ CHAN_SERV_TEXT, CHAN_SERV_LONGTEXT );
+ add_integer( "channel-port", 6010, NULL,
+ CHAN_PORT_TEXT, CHAN_PORT_LONGTEXT );
+ add_integer( "mtu", 1500, NULL, MTU_TEXT, MTU_LONGTEXT );
+ add_string( "iface", "eth0", NULL, IFACE_TEXT, IFACE_LONGTEXT );
+
+ add_integer( "program", 0, NULL,
+ INPUT_PROGRAM_TEXT, INPUT_PROGRAM_LONGTEXT );
+ add_integer( "audio-type", -1, NULL,
+ INPUT_AUDIO_TEXT, INPUT_AUDIO_LONGTEXT );
+ add_integer( "audio-channel", -1, NULL,
+ INPUT_CHAN_TEXT, INPUT_CHAN_LONGTEXT );
+ add_integer( "spu-channel", -1, NULL,
+ INPUT_SUBT_TEXT, INPUT_SUBT_LONGTEXT );
+
+ add_string( "dvd", DVD_DEVICE, NULL, DVD_DEV_TEXT, DVD_DEV_LONGTEXT );
+ add_string( "vcd", VCD_DEVICE, NULL, VCD_DEV_TEXT, VCD_DEV_LONGTEXT );
+
+ add_bool_with_short( "ipv6", '6', 0, NULL, IPV6_TEXT, IPV6_LONGTEXT );
+ add_bool_with_short( "ipv4", '4', 0, NULL, IPV4_TEXT, IPV4_LONGTEXT );
+
+ /* Decoder options */
+ add_category_hint( N_("Decoders"), NULL );
+ add_module( "codec", "decoder", NULL, NULL, CODEC_TEXT, CODEC_LONGTEXT );
+
+ /* CPU options */
+ add_category_hint( N_("CPU"), NULL );
+#if defined( __i386__ )
+ add_bool( "mmx", 1, NULL, MMX_TEXT, MMX_LONGTEXT );
+ add_bool( "3dn", 1, NULL, THREE_DN_TEXT, THREE_DN_LONGTEXT );
+ add_bool( "mmxext", 1, NULL, MMXEXT_TEXT, MMXEXT_LONGTEXT );
+ add_bool( "sse", 1, NULL, SSE_TEXT, SSE_LONGTEXT );
+#endif
+#if defined( __powerpc__ ) || defined( SYS_DARWIN )
+ add_bool( "altivec", 1, NULL, ALTIVEC_TEXT, ALTIVEC_LONGTEXT );
#endif
-/* Usage (mainly useful for cmd line stuff) */
-ADD_USAGE_HINT( PLAYLIST_USAGE )
+ /* Playlist options */
+ add_category_hint( N_("Playlist"), NULL );
+ add_bool( "playlist", 0, NULL, PL_LAUNCH_TEXT, PL_LAUNCH_LONGTEXT );
+ add_bool( "enqueue", 0, NULL, PL_ENQUEUE_TEXT, PL_ENQUEUE_LONGTEXT );
+ add_bool( "loop", 0, NULL, PL_LOOP_TEXT, PL_LOOP_LONGTEXT );
-MODULE_CONFIG_STOP
+ /* Misc options */
+ add_category_hint( N_("Miscellaneous"), NULL );
+ add_module( "memcpy", "memcpy", NULL, NULL, MEMCPY_TEXT, MEMCPY_LONGTEXT );
+ add_module( "access", "access", NULL, NULL, ACCESS_TEXT, ACCESS_LONGTEXT );
+ add_module( "demux", "demux", NULL, NULL, DEMUX_TEXT, DEMUX_LONGTEXT );
-MODULE_INIT_START
- SET_DESCRIPTION( N_("main program") )
- ADD_CAPABILITY( MAIN, 100/*whatever*/ )
-MODULE_INIT_STOP
+#if defined(WIN32)
+ add_bool( "fast-mutex", 0, NULL, FAST_MUTEX_TEXT, FAST_MUTEX_LONGTEXT );
+ add_integer( "win9x-cv-method", 0, NULL, WIN9X_CV_TEXT, WIN9X_CV_LONGTEXT );
+#endif
-MODULE_ACTIVATE_START
-MODULE_ACTIVATE_STOP
+ /* Usage (mainly useful for cmd line stuff) */
+ add_usage_hint( PLAYLIST_USAGE );
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
+ set_description( N_("main program") );
+ set_capability( "main", 100 );
+vlc_module_end();
static module_config_t p_help_config[] =
{
- { CONFIG_ITEM_BOOL, "help", 'h', N_("print help") },
- { CONFIG_ITEM_BOOL, "longhelp", 'H', N_("print detailed help") },
- { CONFIG_ITEM_BOOL, "list", 'l', N_("print a list of available modules") },
- { CONFIG_ITEM_STRING, "module", 'p', N_("print help on module") },
- { CONFIG_ITEM_BOOL, "version", '\0', N_("print version information") },
- { CONFIG_ITEM_BOOL, "build", '\0', N_("print build information") },
- { CONFIG_HINT_END, NULL, '\0' }
+ { CONFIG_ITEM_BOOL, NULL, "help", 'h', N_("print help") },
+ { CONFIG_ITEM_BOOL, NULL, "longhelp", 'H', N_("print detailed help") },
+ { CONFIG_ITEM_BOOL, NULL, "list", 'l',
+ N_("print a list of available modules") },
+ { CONFIG_ITEM_STRING, NULL, "module", 'p', N_("print help on module") },
+ { CONFIG_ITEM_BOOL, NULL, "version", '\0',
+ N_("print version information") },
+ { CONFIG_HINT_END, NULL, NULL, '\0' }
};
/*****************************************************************************
* configuration.c management of the modules configuration
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: configuration.c,v 1.32 2002/07/03 19:40:49 sam Exp $
+ * $Id: configuration.c,v 1.33 2002/07/31 20:56:53 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
if( !psz_name ) return NULL;
- for( p_module = p_this->p_vlc->module_bank.first ;
+ for( p_module = p_this->p_vlc->p_module_bank->first ;
p_module != NULL ;
p_module = p_module->next )
{
p_module->p_config[i].f_value = p_orig[i].f_value;
p_module->p_config[i].b_dirty = p_orig[i].b_dirty;
+ p_module->p_config[i].psz_type = p_orig[i].psz_type ?
+ strdup( _(p_orig[i].psz_type) ) : NULL;
p_module->p_config[i].psz_name = p_orig[i].psz_name ?
strdup( _(p_orig[i].psz_name) ) : NULL;
p_module->p_config[i].psz_text = p_orig[i].psz_text ?
}
/* the callback pointer is only valid when the module is loaded so this
- * value is set in ActivateModule() and reset in DeactivateModule() */
+ * value is set in module_activate() and reset in module_deactivate() */
p_module->p_config[i].pf_callback = NULL;
}
}
for( ; p_item->i_type != CONFIG_HINT_END ; p_item++ )
{
+ if( p_item->psz_type )
+ free( p_item->psz_type );
+
if( p_item->psz_name )
free( p_item->psz_name );
}
/* Look for the selected module, if NULL then save everything */
- for( p_module = p_this->p_vlc->module_bank.first ; p_module != NULL ;
+ for( p_module = p_this->p_vlc->p_module_bank->first ; p_module != NULL ;
p_module = p_module->next )
{
!memcmp( &line[1], p_module->psz_object_name,
strlen(p_module->psz_object_name) ) )
{
- msg_Dbg( p_this, "loading config for module <%s>",
+ msg_Dbg( p_this, "loading config for module \"%s\"",
p_module->psz_object_name );
break;
if( !*psz_option_value )
break; /* ignore empty option */
p_item->i_value = atoi( psz_option_value);
- msg_Dbg( p_this, "found <%s> option %s=%i",
- p_module->psz_object_name, p_item->psz_name,
- p_item->i_value );
+ msg_Dbg( p_this, "option \"%s\", value %i",
+ p_item->psz_name, p_item->i_value );
break;
case CONFIG_ITEM_FLOAT:
if( !*psz_option_value )
break; /* ignore empty option */
p_item->f_value = (float)atof( psz_option_value);
- msg_Dbg( p_this, "found <%s> option %s=%f",
- p_module->psz_object_name, p_item->psz_name,
- (double)p_item->f_value );
+ msg_Dbg( p_this, "option \"%s\", value %f",
+ p_item->psz_name, (double)p_item->f_value );
break;
default:
vlc_mutex_unlock( p_item->p_lock );
- msg_Dbg( p_this, "found <%s> option %s=%s",
- p_module->psz_object_name, p_item->psz_name,
- p_item->psz_value != NULL ?
- p_item->psz_value : "(NULL)" );
+ msg_Dbg( p_this, "option \"%s\", value \"%s\"",
+ p_item->psz_name,
+ p_item->psz_value ? p_item->psz_value : "" );
break;
}
}
if( (p_line[0] == '[') && (p_index2 = strchr(p_line,']')))
{
/* we found a section, check if we need to do a backup */
- for( p_module = p_this->p_vlc->module_bank.first; p_module != NULL;
+ for( p_module = p_this->p_vlc->p_module_bank->first;
+ p_module != NULL;
p_module = p_module->next )
{
if( ((p_index2 - &p_line[1])
/* we don't have this section in our list so we need to back
* it up */
*p_index2 = 0;
- msg_Dbg( p_this, "backing up config for unknown module <%s>",
+ msg_Dbg( p_this, "backing up config for unknown module \"%s\"",
&p_line[1] );
*p_index2 = ']';
fprintf( file, "###\n### " COPYRIGHT_MESSAGE "\n###\n\n" );
/* Look for the selected module, if NULL then save everything */
- for( p_module = p_this->p_vlc->module_bank.first ; p_module != NULL ;
+ for( p_module = p_this->p_vlc->p_module_bank->first ; p_module != NULL ;
p_module = p_module->next )
{
if( !p_module->i_config_items )
continue;
- msg_Dbg( p_this, "saving config for module <%s>",
+ msg_Dbg( p_this, "saving config for module \"%s\"",
p_module->psz_object_name );
fprintf( file, "[%s]", p_module->psz_object_name );
*/
i_opts = 0;
- for( p_module = p_this->p_vlc->module_bank.first;
+ for( p_module = p_this->p_vlc->p_module_bank->first;
p_module != NULL ;
p_module = p_module->next )
{
/* Fill the p_longopts and psz_shortopts structures */
i_index = 0;
- for( p_module = p_this->p_vlc->module_bank.first ;
+ for( p_module = p_this->p_vlc->p_module_bank->first ;
p_module != NULL ;
p_module = p_module->next )
{
* modules, especially intf modules. See config.h for output configuration.
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: messages.c,v 1.5 2002/07/23 00:30:22 sam Exp $
+ * $Id: messages.c,v 1.6 2002/07/31 20:56:53 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/* Message queue initialization */
vlc_mutex_init( p_this, &p_this->p_vlc->msg_bank.lock );
+ p_this->p_vlc->msg_bank.b_configured = VLC_FALSE;
+ p_this->p_vlc->msg_bank.b_overflow = VLC_FALSE;
+
p_this->p_vlc->msg_bank.i_start = 0;
p_this->p_vlc->msg_bank.i_stop = 0;
vlc_mutex_lock( &p_this->p_vlc->msg_bank.lock );
+ p_this->p_vlc->msg_bank.b_configured = VLC_TRUE;
+
for( i_index = p_this->p_vlc->msg_bank.i_start;
i_index != p_this->p_vlc->msg_bank.i_stop;
i_index = (i_index+1) % VLC_MSG_QSIZE )
*****************************************************************************/
void __msg_Destroy( vlc_object_t *p_this )
{
- /* Destroy lock */
- vlc_mutex_destroy( &p_this->p_vlc->msg_bank.lock );
-
if( p_this->p_vlc->msg_bank.i_sub )
{
- fprintf( stderr, "main error: stale interface subscribers\n" );
+ msg_Err( p_this, "stale interface subscribers" );
}
- /* Free remaining messages */
- FlushMsg( &p_this->p_vlc->msg_bank );
+ /* Flush the queue */
+ if( !p_this->p_vlc->msg_bank.b_configured )
+ {
+ msg_Flush( p_this );
+ }
+ else
+ {
+ FlushMsg( &p_this->p_vlc->msg_bank );
+ }
+
+ /* Destroy lock */
+ vlc_mutex_destroy( &p_this->p_vlc->msg_bank.lock );
}
/*****************************************************************************
static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module,
const char *psz_format, va_list args )
{
+ msg_bank_t * p_bank = &p_this->p_vlc->msg_bank; /* message bank */
char * psz_str = NULL; /* formatted message string */
- msg_item_t * p_item; /* pointer to message */
+ msg_item_t * p_item = NULL; /* pointer to message */
msg_item_t item; /* message in case of a full queue */
#ifdef WIN32
char * psz_temp;
#endif
/* Put message in queue */
- vlc_mutex_lock( &p_this->p_vlc->msg_bank.lock );
+ vlc_mutex_lock( &p_bank->lock );
/* Check there is room in the queue for our message */
- if( ((p_this->p_vlc->msg_bank.i_stop - p_this->p_vlc->msg_bank.i_start + 1) % VLC_MSG_QSIZE) == 0 )
+ if( p_bank->b_overflow )
+ {
+ FlushMsg( &p_this->p_vlc->msg_bank );
+
+ if( ((p_bank->i_stop - p_bank->i_start + 1) % VLC_MSG_QSIZE) == 0 )
+ {
+ /* Still in overflow mode, print from a dummy item */
+ p_item = &item;
+ }
+ else
+ {
+ /* Pheeew, at last, there is room in the queue! */
+ p_bank->b_overflow = VLC_FALSE;
+ }
+ }
+ else if( ((p_bank->i_stop - p_bank->i_start + 2) % VLC_MSG_QSIZE) == 0 )
{
FlushMsg( &p_this->p_vlc->msg_bank );
- if( ((p_this->p_vlc->msg_bank.i_stop - p_this->p_vlc->msg_bank.i_start + 1) % VLC_MSG_QSIZE) == 0 )
+ if( ((p_bank->i_stop - p_bank->i_start + 2) % VLC_MSG_QSIZE) == 0 )
{
- fprintf( stderr, "main warning: message queue overflow\n" );
+ p_bank->b_overflow = VLC_TRUE;
+
+ /* Put the overflow message in the queue */
+ p_item = p_bank->msg + p_bank->i_stop;
+ p_bank->i_stop = (p_bank->i_stop + 1) % VLC_MSG_QSIZE;
+
+ p_item->i_type = VLC_MSG_ERR;
+ p_item->i_object_id = p_this->i_object_id;
+ p_item->psz_module = strdup( "message" );
+ p_item->psz_msg = strdup( "message queue overflowed" );
+
+ PrintMsg( p_this, p_item );
+
+ /* We print from a dummy item */
p_item = &item;
- goto print_message;
}
}
- /* Put the message in the queue */
- p_item = p_this->p_vlc->msg_bank.msg + p_this->p_vlc->msg_bank.i_stop;
- p_this->p_vlc->msg_bank.i_stop =
- (p_this->p_vlc->msg_bank.i_stop + 1) % VLC_MSG_QSIZE;
+ if( !p_bank->b_overflow )
+ {
+ /* Put the message in the queue */
+ p_item = p_bank->msg + p_bank->i_stop;
+ p_bank->i_stop = (p_bank->i_stop + 1) % VLC_MSG_QSIZE;
+ }
/* Fill message information fields */
-print_message:
p_item->i_type = i_type;
p_item->i_object_id = p_this->i_object_id;
p_item->psz_module = strdup( psz_module );
PrintMsg( p_this, p_item );
- vlc_mutex_unlock( &p_this->p_vlc->msg_bank.lock );
+ if( p_bank->b_overflow )
+ {
+ free( p_item->psz_module );
+ free( p_item->psz_msg );
+ }
+
+ vlc_mutex_unlock( &p_bank->lock );
}
/* following functions are local */
{
int i_index, i_start, i_stop;
+ /* Only flush the queue if it has been properly configured */
+ if( !p_bank->b_configured )
+ {
+ return;
+ }
+
/* Get the maximum message index that can be freed */
i_stop = p_bank->i_stop;
static const char *ppsz_color[4] = { WHITE, RED, YELLOW, GRAY };
int i_type = p_item->i_type;
+ if( p_this->p_vlc->b_quiet || !p_this->p_vlc->msg_bank.b_configured )
+ {
+ return;
+ }
+
+ if( !p_this->p_vlc->b_verbose &&
+ ( (i_type == VLC_MSG_WARN) || (i_type == VLC_MSG_DBG) ) )
+ {
+ return;
+ }
+
/* Send the message to stderr */
- if( (i_type == VLC_MSG_ERR)
- || ( (i_type == VLC_MSG_INFO) && !p_this->p_vlc->b_quiet )
- || ( (i_type == VLC_MSG_WARN) && p_this->p_vlc->b_verbose
- && !p_this->p_vlc->b_quiet )
- || ( (i_type == VLC_MSG_DBG) && p_this->p_vlc->b_verbose
- && !p_this->p_vlc->b_quiet ) )
+ if( p_this->p_vlc->b_color )
{
- if( p_this->p_vlc->b_color )
- {
- fprintf( stderr, "[" GREEN "%.2x" GRAY ":" GREEN "%.6x" GRAY "] "
- "%s%s: %s%s" GRAY "\n", p_this->p_vlc->i_unique,
- p_item->i_object_id, p_item->psz_module,
- ppsz_type[i_type], ppsz_color[i_type],
- p_item->psz_msg );
- }
- else
- {
- fprintf( stderr, "[%.2x:%.6x] %s%s: %s\n",
- p_this->p_vlc->i_unique, p_item->i_object_id,
- p_item->psz_module, ppsz_type[i_type],
- p_item->psz_msg );
- }
+ fprintf( stderr, "[" GREEN "%.2x" GRAY ":" GREEN "%.6x" GRAY "] "
+ "%s%s: %s%s" GRAY "\n", p_this->p_vlc->i_unique,
+ p_item->i_object_id, p_item->psz_module,
+ ppsz_type[i_type], ppsz_color[i_type],
+ p_item->psz_msg );
+ }
+ else
+ {
+ fprintf( stderr, "[%.2x:%.6x] %s%s: %s\n",
+ p_this->p_vlc->i_unique, p_item->i_object_id,
+ p_item->psz_module, ppsz_type[i_type],
+ p_item->psz_msg );
}
}
* modules.c : Builtin and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.74 2002/07/23 00:39:17 sam Exp $
+ * $Id: modules.c,v 1.75 2002/07/31 20:56:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
# include "modules_builtin_msvc.h"
#endif
-/*****************************************************************************
- * Static variables
- *****************************************************************************/
-DECLARE_MODULE_CAPABILITY_TABLE;
-
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static void AllocateAllPlugins ( vlc_object_t * );
static int AllocatePluginModule ( vlc_object_t *, char * );
#endif
-static int AllocateBuiltinModule( vlc_object_t *,
- int ( * ) ( module_t * ),
- int ( * ) ( module_t * ),
- int ( * ) ( module_t * ) );
+static int AllocateBuiltinModule( vlc_object_t *, int ( * ) ( module_t * ) );
static int DeleteModule ( module_t * );
static int LockModule ( module_t * );
static int UnlockModule ( module_t * );
#ifdef HAVE_DYNAMIC_PLUGINS
static int HideModule ( module_t * );
-static int CallSymbol ( module_t *, char * );
-#endif
-
-#ifdef HAVE_DYNAMIC_PLUGINS
-static module_symbols_t symbols;
+static void DupModule ( module_t * );
+static void UndupModule ( module_t * );
+static int CallEntry ( module_t * );
#endif
/*****************************************************************************
*****************************************************************************/
void __module_InitBank( vlc_object_t *p_this )
{
- p_this->p_vlc->module_bank.first = NULL;
- p_this->p_vlc->module_bank.i_count = 0;
- vlc_mutex_init( p_this, &p_this->p_vlc->module_bank.lock );
+ module_bank_t *p_bank;
+
+ p_bank = vlc_object_create( p_this, sizeof(module_bank_t) );
+ p_bank->psz_object_name = "module bank";
+
+ p_bank->first = NULL;
+ p_bank->i_count = 0;
+ vlc_mutex_init( p_this, &p_bank->lock );
/*
* Store the symbols to be exported
*/
#ifdef HAVE_DYNAMIC_PLUGINS
- STORE_SYMBOLS( &symbols );
+ STORE_SYMBOLS( &p_bank->symbols );
#endif
+ /* Everything worked, attach the object */
+ p_this->p_vlc->p_module_bank = p_bank;
+ vlc_object_attach( p_bank, p_this->p_vlc );
+
return;
}
{
module_t * p_next;
- while( p_this->p_vlc->module_bank.first != NULL )
+ vlc_object_detach_all( p_this->p_vlc->p_module_bank );
+
+ while( p_this->p_vlc->p_module_bank->first != NULL )
{
- if( DeleteModule( p_this->p_vlc->module_bank.first ) )
+ if( DeleteModule( p_this->p_vlc->p_module_bank->first ) )
{
/* Module deletion failed */
- msg_Err( p_this, "`%s' can't be removed, trying harder",
- p_this->p_vlc->module_bank.first->psz_object_name );
+ msg_Err( p_this, "module \"%s\" can't be removed, trying harder",
+ p_this->p_vlc->p_module_bank->first->psz_object_name );
/* We just free the module by hand. Niahahahahaha. */
- p_next = p_this->p_vlc->module_bank.first->next;
- free( p_this->p_vlc->module_bank.first );
- p_this->p_vlc->module_bank.first = p_next;
+ p_next = p_this->p_vlc->p_module_bank->first->next;
+ free( p_this->p_vlc->p_module_bank->first );
+ p_this->p_vlc->p_module_bank->first = p_next;
}
}
/* Destroy the lock */
- vlc_mutex_destroy( &p_this->p_vlc->module_bank.lock );
+ vlc_mutex_destroy( &p_this->p_vlc->p_module_bank->lock );
+
+ vlc_object_destroy( p_this->p_vlc->p_module_bank );
return;
}
*****************************************************************************/
void __module_LoadMain( vlc_object_t *p_this )
{
- AllocateBuiltinModule( p_this, InitModule__MODULE_main,
- ActivateModule__MODULE_main,
- DeactivateModule__MODULE_main );
+ AllocateBuiltinModule( p_this, vlc_entry__main );
}
/*****************************************************************************
module_t * p_module;
/* We take the global lock */
- vlc_mutex_lock( &p_this->p_vlc->module_bank.lock );
+ vlc_mutex_lock( &p_this->p_vlc->p_module_bank->lock );
/* Parse the module list to see if any modules need to be unloaded */
- for( p_module = p_this->p_vlc->module_bank.first ;
+ for( p_module = p_this->p_vlc->p_module_bank->first ;
p_module != NULL ;
p_module = p_module->next )
{
}
else
{
- msg_Dbg( p_this, "hiding unused plugin module `%s'",
+ msg_Dbg( p_this, "hiding unused plugin module \"%s\"",
p_module->psz_object_name );
HideModule( p_module );
}
/* We release the global lock */
- vlc_mutex_unlock( &p_this->p_vlc->module_bank.lock );
+ vlc_mutex_unlock( &p_this->p_vlc->p_module_bank->lock );
#endif /* HAVE_DYNAMIC_PLUGINS */
return;
*****************************************************************************
* This function returns the module that best fits the asked capabilities.
*****************************************************************************/
-module_t * __module_Need( vlc_object_t *p_this, int i_capability,
- const char *psz_name, void *p_data )
+module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
+ const char *psz_name )
{
typedef struct module_list_t module_list_t;
module_list_t *p_list, *p_first, *p_tmp;
- int i_ret, i_index = 0;
+ int i_index = 0;
vlc_bool_t b_intf = VLC_FALSE;
module_t *p_module;
int i_shortcuts = 0;
char *psz_shortcuts = NULL;
- msg_Dbg( p_this, "looking for %s module",
- MODULE_CAPABILITY( i_capability ) );
+ msg_Dbg( p_this, "looking for %s module", psz_capability );
/* Count how many different shortcuts were asked for */
if( psz_name && *psz_name )
}
/* We take the global lock */
- vlc_mutex_lock( &p_this->p_vlc->module_bank.lock );
+ vlc_mutex_lock( &p_this->p_vlc->p_module_bank->lock );
/* Sort the modules and test them */
- p_list = malloc( p_this->p_vlc->module_bank.i_count
+ p_list = malloc( p_this->p_vlc->p_module_bank->i_count
* sizeof( module_list_t ) );
p_first = NULL;
/* Parse the module list for capabilities and probe each of them */
- for( p_module = p_this->p_vlc->module_bank.first ;
+ for( p_module = p_this->p_vlc->p_module_bank->first ;
p_module != NULL ;
p_module = p_module->next )
{
- int i_shortcut_bonus = 0;
+ module_t * p_submodule = NULL;
+ int i_shortcut_bonus = 0, i_submodule;
- /* Test that this module can do everything we need */
- if( !(p_module->i_capabilities & ( 1 << i_capability )) )
+ /* Test that this module can do what we need */
+ if( strcmp( p_module->psz_capability, psz_capability ) )
{
- continue;
+ for( i_submodule = 0;
+ i_submodule < p_module->i_children;
+ i_submodule++ )
+ {
+ if( !strcmp( ((module_t*)p_module->pp_children[ i_submodule ])
+ ->psz_capability, psz_capability ) )
+ {
+ p_submodule =
+ (module_t*)p_module->pp_children[ i_submodule ];
+ p_submodule->next = p_module->next;
+ break;
+ }
+ }
+
+ if( p_submodule == NULL )
+ {
+ continue;
+ }
+
+ p_module = p_submodule;
}
/* Test if we have the required CPU */
- if( (p_module->i_cpu_capabilities
- & p_this->p_vlc->i_cpu_capabilities)
- != p_module->i_cpu_capabilities )
+ if( (p_module->i_cpu & p_this->p_vlc->i_cpu) != p_module->i_cpu )
{
continue;
}
b_trash && p_module->pp_shortcuts[i_dummy];
i_dummy++ )
{
- b_trash = strcmp( psz_name, "any" )
+ b_trash = ( strcmp(psz_name, "any") || !p_module->i_score )
&& strcmp( psz_name, p_module->pp_shortcuts[i_dummy] );
}
}
}
/* If we didn't require a shortcut, trash zero-scored plugins */
- else if( !p_module->pi_score[i_capability] )
+ else if( !p_module->i_score )
{
continue;
}
/* Special case: test if we requested a particular intf plugin */
- if( i_capability == MODULE_CAPABILITY_INTF )
+ if( p_module->psz_program
+ && !strcmp( p_module->psz_program,
+ p_this->p_vlc->psz_object_name ) )
{
- if( p_module->psz_program != NULL
- && !strcmp( p_module->psz_program,
- p_this->p_vlc->psz_object_name ) )
- {
- if( !b_intf )
- {
- /* Remove previous non-matching plugins */
- i_index = 0;
- b_intf = VLC_TRUE;
- }
- }
- else
+ if( !b_intf )
{
- if( b_intf )
- {
- /* This one doesn't match */
- continue;
- }
+ /* Remove previous non-matching plugins */
+ i_index = 0;
+ b_intf = VLC_TRUE;
}
}
+ else if( b_intf )
+ {
+ /* This one doesn't match */
+ continue;
+ }
/* Store this new module */
p_list[ i_index ].p_module = p_module;
- p_list[ i_index ].i_score = p_module->pi_score[i_capability]
- + i_shortcut_bonus;
+ p_list[ i_index ].i_score = p_module->i_score + i_shortcut_bonus;
/* Add it to the modules-to-probe list */
if( i_index == 0 )
i_index++;
}
+ msg_Dbg( p_this, "probing %i candidate%s",
+ i_index, i_index == 1 ? "" : "s" );
+
/* Lock all selected modules */
p_tmp = p_first;
while( p_tmp != NULL )
}
/* We can release the global lock, module refcounts were incremented */
- vlc_mutex_unlock( &p_this->p_vlc->module_bank.lock );
+ vlc_mutex_unlock( &p_this->p_vlc->p_module_bank->lock );
/* Parse the linked list and use the first successful module */
p_tmp = p_first;
while( p_tmp != NULL )
{
- /* Test the requested capability */
- switch( i_capability )
- {
- case MODULE_CAPABILITY_ACCESS:
- i_ret = p_tmp->p_module->p_functions->access.functions.
- access.pf_open( (input_thread_t *)p_data );
- break;
-
- case MODULE_CAPABILITY_DEMUX:
- i_ret = p_tmp->p_module->p_functions->demux.functions.
- demux.pf_init( (input_thread_t *)p_data );
- break;
-
- case MODULE_CAPABILITY_NETWORK:
- i_ret = p_tmp->p_module->p_functions->network.functions.
- network.pf_open( p_this, (network_socket_t *)p_data );
- break;
-
- case MODULE_CAPABILITY_DECODER:
- i_ret = p_tmp->p_module->p_functions->dec.functions.
- dec.pf_probe( (vlc_fourcc_t *)p_data );
- break;
-
- case MODULE_CAPABILITY_INTF:
- i_ret = p_tmp->p_module->p_functions->intf.functions.
- intf.pf_open( (intf_thread_t *)p_data );
- break;
-
- case MODULE_CAPABILITY_AOUT:
- i_ret = p_tmp->p_module->p_functions->aout.functions.
- aout.pf_open( (aout_thread_t *)p_data );
- break;
-
- case MODULE_CAPABILITY_VOUT:
- case MODULE_CAPABILITY_VOUT_FILTER:
- i_ret = p_tmp->p_module->p_functions->vout.functions.
- vout.pf_create( (vout_thread_t *)p_data );
- break;
-
- case MODULE_CAPABILITY_CHROMA:
- i_ret = p_tmp->p_module->p_functions->chroma.functions.
- chroma.pf_init( (vout_thread_t *)p_data );
- break;
-
- case MODULE_CAPABILITY_IDCT:
- case MODULE_CAPABILITY_IMDCT:
- case MODULE_CAPABILITY_MOTION:
- case MODULE_CAPABILITY_DOWNMIX:
- case MODULE_CAPABILITY_MEMCPY:
- /* This one always works */
- i_ret = 0;
- break;
-
- default:
- msg_Err( p_this, "unknown module type %i", i_capability );
- i_ret = -1;
- break;
- }
-
- /* If the high score was broken, we have a new champion */
- if( i_ret == 0 )
+ if( p_tmp->p_module->pf_activate
+ && p_tmp->p_module->pf_activate( p_this ) == VLC_SUCCESS )
{
break;
}
- else
- {
- UnlockModule( p_tmp->p_module );
- }
+ UnlockModule( p_tmp->p_module );
p_tmp = p_tmp->p_next;
}
if( p_module != NULL )
{
- msg_Info( p_module, "found and locked %s module `%s'",
- MODULE_CAPABILITY( i_capability ),
- p_module->psz_object_name );
+ msg_Info( p_module, "using %s module \"%s\"",
+ psz_capability, p_module->psz_object_name );
}
else if( p_first == NULL )
{
- msg_Err( p_this, "no available %s module matched `%s'",
- MODULE_CAPABILITY( i_capability ), psz_name );
+ msg_Err( p_this, "no %s module matched \"%s\"",
+ psz_capability, (psz_name && *psz_name) ? psz_name : "any" );
}
else if( psz_name != NULL && *psz_name )
{
- msg_Err( p_this, "could not load any %s module matching `%s'",
- MODULE_CAPABILITY( i_capability ), psz_name );
+ msg_Err( p_this, "no %s module matching \"%s\" could be loaded",
+ psz_capability, (psz_name && *psz_name) ? psz_name : "any" );
}
if( psz_shortcuts )
* This function must be called by the thread that called module_Need, to
* decrease the reference count and allow for hiding of modules.
*****************************************************************************/
-void module_Unneed( module_t * p_module )
+void __module_Unneed( vlc_object_t * p_this, module_t * p_module )
{
+ /* Use the close method */
+ if( p_module->pf_deactivate )
+ {
+ p_module->pf_deactivate( p_this );
+ }
+
/* We take the global lock */
- vlc_mutex_lock( &p_module->p_vlc->module_bank.lock );
+ vlc_mutex_lock( &p_module->p_vlc->p_module_bank->lock );
/* Just unlock the module - we can't do anything if it fails,
* so there is no need to check the return value. */
UnlockModule( p_module );
- msg_Info( p_module, "unlocking module `%s'", p_module->psz_object_name );
+ msg_Info( p_module, "unlocking module \"%s\"", p_module->psz_object_name );
/* We release the global lock */
- vlc_mutex_unlock( &p_module->p_vlc->module_bank.lock );
+ vlc_mutex_unlock( &p_module->p_vlc->p_module_bank->lock );
return;
}
*****************************************************************************/
static int AllocatePluginModule( vlc_object_t * p_this, char * psz_filename )
{
- char **pp_shortcut;
- module_t * p_module, * p_othermodule;
+ module_t * p_module;
module_handle_t handle;
/* Try to dynamically load the module. */
char psz_buffer[256];
/* The plugin module couldn't be opened */
- msg_Warn( p_this, "cannot open %s (%s)",
+ msg_Warn( p_this, "cannot open `%s' (%s)",
psz_filename, module_error( psz_buffer ) );
return -1;
}
return -1;
}
- /* We need to fill these since they may be needed by CallSymbol() */
- p_module->is.plugin.psz_filename = psz_filename;
- p_module->is.plugin.handle = handle;
- p_module->p_symbols = &symbols;
+ /* We need to fill these since they may be needed by CallEntry() */
+ p_module->psz_filename = psz_filename;
+ p_module->handle = handle;
+ p_module->p_symbols = &p_this->p_vlc->p_module_bank->symbols;
/* Initialize the module: fill p_module->psz_object_name, default config */
- if( CallSymbol( p_module, "InitModule" MODULE_SUFFIX ) != 0 )
+ if( CallEntry( p_module ) != 0 )
{
- /* We couldn't call InitModule() */
+ /* We couldn't call module_init() */
vlc_object_destroy( p_module );
module_unload( handle );
return -1;
}
- /* Check that we don't already have a module with this name */
- for( p_othermodule = p_this->p_vlc->module_bank.first ;
- p_othermodule != NULL ;
- p_othermodule = p_othermodule->next )
- {
- if( !strcmp( p_othermodule->psz_object_name,
- p_module->psz_object_name ) )
- {
- msg_Warn( p_this,
- "cannot load %s, a module named `%s' already exists",
- psz_filename, p_module->psz_object_name );
- config_Free( p_module );
- vlc_object_destroy( p_module );
- module_unload( handle );
- return -1;
- }
- }
+ DupModule( p_module );
+ p_module->psz_filename = strdup( p_module->psz_filename );
+ p_module->psz_longname = strdup( p_module->psz_longname );
+
+ /* Everything worked fine ! The module is ready to be added to the list. */
+ p_module->i_usage = 0;
+ p_module->i_unused_delay = 0;
+
+ p_module->b_builtin = VLC_FALSE;
- /* Activate the module : fill the capability structure, etc. */
- if( CallSymbol( p_module, "ActivateModule" MODULE_SUFFIX ) != 0 )
+ /* Link module into the linked list */
+ if( p_this->p_vlc->p_module_bank->first != NULL )
{
- /* We couldn't call ActivateModule() */
- config_Free( p_module );
- vlc_object_destroy( p_module );
- module_unload( handle );
- return -1;
+ p_this->p_vlc->p_module_bank->first->prev = p_module;
}
+ p_module->next = p_this->p_vlc->p_module_bank->first;
+ p_module->prev = NULL;
+ p_this->p_vlc->p_module_bank->first = p_module;
+ p_this->p_vlc->p_module_bank->i_count++;
+
+ msg_Dbg( p_this, "plugin \"%s\", %s",
+ p_module->psz_object_name, p_module->psz_longname );
+
+ vlc_object_attach( p_module, p_this->p_vlc->p_module_bank );
+
+ return 0;
+}
+
+/*****************************************************************************
+ * DupModule: make a plugin module standalone.
+ *****************************************************************************
+ * This function duplicates all strings in the module, so that the dynamic
+ * object can be unloaded. It acts recursively on submodules.
+ *****************************************************************************/
+static void DupModule( module_t *p_module )
+{
+ char **pp_shortcut;
+ int i_submodule;
for( pp_shortcut = p_module->pp_shortcuts ; *pp_shortcut ; pp_shortcut++ )
{
/* We strdup() these entries so that they are still valid when the
* module is unloaded. */
- p_module->is.plugin.psz_filename =
- strdup( p_module->is.plugin.psz_filename );
p_module->psz_object_name = strdup( p_module->psz_object_name );
- p_module->psz_longname = strdup( p_module->psz_longname );
-
- if( p_module->is.plugin.psz_filename == NULL
- || p_module->psz_object_name == NULL
- || p_module->psz_longname == NULL )
- {
- msg_Err( p_this, "out of memory" );
-
- free( p_module->is.plugin.psz_filename );
- free( p_module->psz_object_name );
- free( p_module->psz_longname );
- free( p_module->psz_program );
-
- config_Free( p_module );
- vlc_object_destroy( p_module );
- module_unload( handle );
- return -1;
- }
+ p_module->psz_capability = strdup( p_module->psz_capability );
if( p_module->psz_program != NULL )
{
p_module->psz_program = strdup( p_module->psz_program );
}
- /* Everything worked fine ! The module is ready to be added to the list. */
- p_module->i_usage = 0;
- p_module->i_unused_delay = 0;
+ for( i_submodule = 0; i_submodule < p_module->i_children; i_submodule++ )
+ {
+ DupModule( (module_t*)p_module->pp_children[ i_submodule ] );
+ }
+}
- p_module->b_builtin = VLC_FALSE;
+/*****************************************************************************
+ * UndupModule: free a duplicated module.
+ *****************************************************************************
+ * This function frees the allocations done in DupModule().
+ *****************************************************************************/
+static void UndupModule( module_t *p_module )
+{
+ char **pp_shortcut;
+ int i_submodule;
- /* Link module into the linked list */
- if( p_this->p_vlc->module_bank.first != NULL )
+ for( i_submodule = 0; i_submodule < p_module->i_children; i_submodule++ )
{
- p_this->p_vlc->module_bank.first->prev = p_module;
+ UndupModule( (module_t*)p_module->pp_children[ i_submodule ] );
}
- p_module->next = p_this->p_vlc->module_bank.first;
- p_module->prev = NULL;
- p_this->p_vlc->module_bank.first = p_module;
- p_this->p_vlc->module_bank.i_count++;
- msg_Dbg( p_this, "plugin `%s', %s",
- p_module->psz_object_name, p_module->psz_longname );
+ for( pp_shortcut = p_module->pp_shortcuts ; *pp_shortcut ; pp_shortcut++ )
+ {
+ free( *pp_shortcut );
+ }
- vlc_object_attach( p_module, p_this );
+ free( p_module->psz_object_name );
+ free( p_module->psz_capability );
- return 0;
+ if( p_module->psz_program != NULL )
+ {
+ free( p_module->psz_program );
+ }
}
+
#endif /* HAVE_DYNAMIC_PLUGINS */
/*****************************************************************************
* module_Unneed and HideModule. It can be removed by DeleteModule.
*****************************************************************************/
static int AllocateBuiltinModule( vlc_object_t * p_this,
- int ( *pf_init ) ( module_t * ),
- int ( *pf_activate ) ( module_t * ),
- int ( *pf_deactivate ) ( module_t * ) )
+ int ( *pf_entry ) ( module_t * ) )
{
- module_t * p_module, * p_othermodule;
+ module_t * p_module;
/* Now that we have successfully loaded the module, we can
* allocate a structure for it */
}
/* Initialize the module : fill p_module->psz_object_name, etc. */
- if( pf_init( p_module ) != 0 )
- {
- /* With a well-written module we shouldn't have to print an
- * additional error message here, but just make sure. */
- msg_Err( p_this, "failed calling init in builtin module" );
- vlc_object_destroy( p_module );
- return -1;
- }
-
- /* Check that we don't already have a module with this name */
- for( p_othermodule = p_this->p_vlc->module_bank.first ;
- p_othermodule != NULL ;
- p_othermodule = p_othermodule->next )
- {
- if( !strcmp( p_othermodule->psz_object_name,
- p_module->psz_object_name ) )
- {
- msg_Warn( p_this, "cannot load builtin `%s', "
- "a module named `%s' already exists",
- p_module->psz_object_name, p_module->psz_object_name );
- config_Free( p_module );
- vlc_object_destroy( p_module );
- return -1;
- }
- }
-
- if( pf_activate( p_module ) != 0 )
+ if( pf_entry( p_module ) != 0 )
{
/* With a well-written module we shouldn't have to print an
* additional error message here, but just make sure. */
- msg_Err( p_this, "failed calling activate in builtin module" );
- config_Free( p_module );
+ msg_Err( p_this, "failed calling entry point in builtin module" );
vlc_object_destroy( p_module );
return -1;
}
p_module->i_unused_delay = 0;
p_module->b_builtin = VLC_TRUE;
- p_module->is.builtin.pf_deactivate = pf_deactivate;
/* Link module into the linked list */
- if( p_this->p_vlc->module_bank.first != NULL )
+ if( p_this->p_vlc->p_module_bank->first != NULL )
{
- p_this->p_vlc->module_bank.first->prev = p_module;
+ p_this->p_vlc->p_module_bank->first->prev = p_module;
}
- p_module->next = p_this->p_vlc->module_bank.first;
+ p_module->next = p_this->p_vlc->p_module_bank->first;
p_module->prev = NULL;
- p_this->p_vlc->module_bank.first = p_module;
- p_this->p_vlc->module_bank.i_count++;
+ p_this->p_vlc->p_module_bank->first = p_module;
+ p_this->p_vlc->p_module_bank->i_count++;
- msg_Dbg( p_this, "builtin `%s', %s",
+ msg_Dbg( p_this, "builtin \"%s\", %s",
p_module->psz_object_name, p_module->psz_longname );
- vlc_object_attach( p_module, p_this );
+ vlc_object_attach( p_module, p_this->p_vlc->p_module_bank );
return 0;
}
{
if( p_module->i_usage != 0 )
{
- msg_Err( p_module, "trying to free builtin module `%s' with "
+ msg_Err( p_module, "trying to free builtin module \"%s\" with "
"usage %i", p_module->psz_object_name, p_module->i_usage );
return -1;
}
- else
- {
- /* We deactivate the module now. */
- p_module->is.builtin.pf_deactivate( p_module );
- }
}
#ifdef HAVE_DYNAMIC_PLUGINS
else
{
if( p_module->i_usage >= 1 )
{
- msg_Err( p_module, "trying to free module `%s' which is "
+ msg_Err( p_module, "trying to free module \"%s\" which is "
"still in use", p_module->psz_object_name );
return -1;
}
}
else
{
- p_module->p_vlc->module_bank.first = p_module->next;
+ p_module->p_vlc->p_module_bank->first = p_module->next;
}
if( p_module->next != NULL )
p_module->next->prev = p_module->prev;
}
- p_module->p_vlc->module_bank.i_count--;
+ p_module->p_vlc->p_module_bank->i_count--;
/* We free the structures that we strdup()ed in Allocate*Module(). */
#ifdef HAVE_DYNAMIC_PLUGINS
if( !p_module->b_builtin )
{
- char **pp_shortcut = p_module->pp_shortcuts;
-
- for( ; *pp_shortcut ; pp_shortcut++ )
- {
- free( *pp_shortcut );
- }
-
- free( p_module->is.plugin.psz_filename );
- free( p_module->psz_object_name );
+ UndupModule( p_module );
+ free( p_module->psz_filename );
free( p_module->psz_longname );
- free( p_module->psz_program );
}
#endif
+ /* Free and detach the object's children */
+ while( p_module->i_children )
+ {
+ vlc_object_t *p_this = p_module->pp_children[0];
+ vlc_object_detach_all( p_this );
+ vlc_object_destroy( p_this );
+ }
+
config_Free( p_module );
vlc_object_destroy( p_module );
if( p_module->b_builtin )
{
/* A builtin module should always have a refcount >= 0 ! */
- msg_Err( p_module, "builtin module `%s' has refcount %i",
+ msg_Err( p_module, "builtin module \"%s\" has refcount %i",
p_module->psz_object_name, p_module->i_usage );
return -1;
}
if( p_module->i_usage != -1 )
{
/* This shouldn't happen. Ever. We have serious problems here. */
- msg_Err( p_module, "plugin module `%s' has refcount %i",
+ msg_Err( p_module, "plugin module \"%s\" has refcount %i",
p_module->psz_object_name, p_module->i_usage );
return -1;
}
/* i_usage == -1, which means that the module isn't in memory */
- if( module_load( p_module->is.plugin.psz_filename,
- &p_module->is.plugin.handle ) )
+ if( module_load( p_module->psz_filename, &p_module->handle ) )
{
char psz_buffer[256];
/* The plugin module couldn't be opened */
- msg_Err( p_module, "cannot open %s (%s)",
- p_module->is.plugin.psz_filename, module_error(psz_buffer) );
+ msg_Err( p_module, "cannot open `%s' (%s)",
+ p_module->psz_filename, module_error(psz_buffer) );
return -1;
}
* unloaded ? It makes XMMS crash nastily, perhaps we should try
* to be a bit more clever here. */
- /* Activate the module : fill the capability structure, etc. */
- if( CallSymbol( p_module, "ActivateModule" MODULE_SUFFIX ) != 0 )
- {
- /* We couldn't call ActivateModule() -- looks nasty, but
- * we can't do much about it. Just try to unload module. */
- module_unload( p_module->is.plugin.handle );
- p_module->i_usage = -1;
- return -1;
- }
-
/* Everything worked fine ! The module is ready to be used */
p_module->i_usage = 1;
#endif /* HAVE_DYNAMIC_PLUGINS */
if( p_module->i_usage <= 0 )
{
/* This shouldn't happen. Ever. We have serious problems here. */
- msg_Err( p_module, "trying to call module_Unneed() on `%s' "
+ msg_Err( p_module, "trying to call module_Unneed() on \"%s\" "
"which is not in use", p_module->psz_object_name );
return -1;
}
* HideModule: remove a module from memory but keep its structure.
*****************************************************************************
* This function can only be called if i_usage == 0. It will make a call
- * to the module's inner DeactivateModule() symbol, and then unload it
+ * to the module's inner module_deactivate() symbol, and then unload it
* from memory. A call to module_Need() will automagically load it again.
*****************************************************************************/
static int HideModule( module_t * p_module )
if( p_module->b_builtin )
{
/* A builtin module should never be hidden. */
- msg_Err( p_module, "trying to hide builtin module `%s'",
+ msg_Err( p_module, "trying to hide builtin module \"%s\"",
p_module->psz_object_name );
return -1;
}
if( p_module->i_usage >= 1 )
{
- msg_Err( p_module, "trying to hide module `%s' which is still "
+ msg_Err( p_module, "trying to hide module \"%s\" which is still "
"in use", p_module->psz_object_name );
return -1;
}
if( p_module->i_usage <= -1 )
{
- msg_Err( p_module, "trying to hide module `%s' which is already "
+ msg_Err( p_module, "trying to hide module \"%s\" which is already "
"hidden", p_module->psz_object_name );
return -1;
}
- /* Deactivate the module : free the capability structure, etc. */
- if( CallSymbol( p_module, "DeactivateModule" MODULE_SUFFIX ) != 0 )
- {
- /* We couldn't call DeactivateModule() -- looks nasty, but
- * we can't do much about it. Just try to unload module anyway. */
- module_unload( p_module->is.plugin.handle );
- p_module->i_usage = -1;
- return -1;
- }
-
/* Everything worked fine, we can safely unload the module. */
- module_unload( p_module->is.plugin.handle );
+ module_unload( p_module->handle );
p_module->i_usage = -1;
return 0;
}
/*****************************************************************************
- * CallSymbol: calls a module symbol.
+ * CallEntry: call an entry point.
*****************************************************************************
* This function calls a symbol given its name and a module structure. The
* symbol MUST refer to a function returning int and taking a module_t* as
* an argument.
*****************************************************************************/
-static int CallSymbol( module_t * p_module, char * psz_name )
+static int CallEntry( module_t * p_module )
{
+ static char *psz_name = "vlc_entry" MODULE_SUFFIX;
int (* pf_symbol) ( module_t * p_module );
/* Try to resolve the symbol */
- pf_symbol = module_getsymbol( p_module->is.plugin.handle, psz_name );
+ pf_symbol = module_getsymbol( p_module->handle, psz_name );
if( pf_symbol == NULL )
{
char psz_buffer[256];
/* We couldn't load the symbol */
- msg_Warn( p_module, "cannot find symbol %s in module %s (%s)",
- psz_name, p_module->is.plugin.psz_filename,
+ msg_Warn( p_module, "cannot find symbol \"%s\" in file `%s' (%s)",
+ psz_name, p_module->psz_filename,
module_error( psz_buffer ) );
return -1;
}
{
/* With a well-written module we shouldn't have to print an
* additional error message here, but just make sure. */
- msg_Err( p_module, "failed calling symbol %s in module %s",
- psz_name, p_module->is.plugin.psz_filename );
+ msg_Err( p_module, "failed calling symbol \"%s\" in file `%s'",
+ psz_name, p_module->psz_filename );
return -1;
}
*****************************************************************************/
#define ALLOCATE_BUILTIN( NAME ) \
- AllocateBuiltinModule( p_this, InitModule__MODULE_ ## NAME, \
- ActivateModule__MODULE_ ## NAME, \
- DeactivateModule__MODULE_ ## NAME );
+ AllocateBuiltinModule( p_this, vlc_entry__ ## NAME );
/* We also consider the main program as a module (useful for config stuff) */
-int InitModule__MODULE_main( module_t* );
-int ActivateModule__MODULE_main( module_t* );
-int DeactivateModule__MODULE_main( module_t* );
+int vlc_entry__main( module_t* );
/* Add stuff here */
(p_symbols)->input_ReadTS_inner = input_ReadTS; \
(p_symbols)->input_DemuxPS_inner = input_DemuxPS; \
(p_symbols)->input_DemuxTS_inner = input_DemuxTS; \
- (p_symbols)->input_FDClose_inner = input_FDClose; \
- (p_symbols)->input_FDNetworkClose_inner = input_FDNetworkClose; \
+ (p_symbols)->__input_FDClose_inner = __input_FDClose; \
+ (p_symbols)->__input_FDNetworkClose_inner = __input_FDNetworkClose; \
(p_symbols)->input_FDRead_inner = input_FDRead; \
(p_symbols)->input_FDNetworkRead_inner = input_FDNetworkRead; \
(p_symbols)->input_FDSeek_inner = input_FDSeek; \
(p_symbols)->GetLang_2B_inner = GetLang_2B; \
(p_symbols)->DecodeLanguage_inner = DecodeLanguage; \
(p_symbols)->__module_Need_inner = __module_Need; \
- (p_symbols)->module_Unneed_inner = module_Unneed; \
+ (p_symbols)->__module_Unneed_inner = __module_Unneed; \
(p_symbols)->mstrtime_inner = mstrtime; \
(p_symbols)->mdate_inner = mdate; \
(p_symbols)->mwait_inner = mwait; \
* netutils.c: various network functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: netutils.c,v 1.72 2002/07/20 18:01:43 sam Exp $
+ * $Id: netutils.c,v 1.73 2002/07/31 20:56:53 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Benoit Steiner <benny@via.ecp.fr>
socket_desc.i_server_port = i_port;
/* Find an appropriate network module */
- p_network = module_Need( p_this, MODULE_CAPABILITY_NETWORK, psz_network,
- &socket_desc );
+ p_network = module_Need( p_this, "network", psz_network/*, &socket_desc*/ );
if( p_network == NULL )
{
return( -1 );
}
- module_Unneed( p_network );
+ module_Unneed( p_this, p_network );
free( psz_vlcs ); /* Do we really need this ? -- Meuuh */
i_fd = socket_desc.i_handle;
* objects.c: vlc_object_t handling
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: objects.c,v 1.11 2002/06/08 14:08:46 sam Exp $
+ * $Id: objects.c,v 1.12 2002/07/31 20:56:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
default:
i_size = i_type > sizeof(vlc_object_t)
? i_type : sizeof(vlc_object_t);
- i_type = VLC_OBJECT_PRIVATE;
- psz_type = "private";
+ i_type = VLC_OBJECT_GENERIC;
+ psz_type = "generic";
break;
}
p_new->pp_children = NULL;
p_new->i_children = 0;
+ p_new->p_private = NULL;
+
vlc_mutex_init( p_new, &p_new->object_lock );
vlc_cond_init( p_new, &p_new->object_wait );
/* Otherwise, recursively look for the object */
if( (i_mode & 0x000f) == FIND_ANYWHERE )
{
- p_found = vlc_object_find_inner( CAST_TO_VLC_OBJECT(p_this->p_vlc),
+ p_found = vlc_object_find_inner( VLC_OBJECT(p_this->p_vlc),
i_type,
(i_mode & ~0x000f) | FIND_CHILD );
}
strcpy( psz_children, ", 1 child" );
break;
default:
- snprintf( psz_children, 20, ", %i children", p_this->i_children );
+ snprintf( psz_children, 20,
+ ", %i children", p_this->i_children );
psz_children[19] = '\0';
break;
}
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: video_output.c,v 1.187 2002/07/23 00:39:17 sam Exp $
+ * $Id: video_output.c,v 1.188 2002/07/31 20:56:53 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
p_vout->p_module = module_Need( p_vout,
( p_vout->psz_filter_chain ) ?
- MODULE_CAPABILITY_VOUT_FILTER :
- MODULE_CAPABILITY_VOUT,
- psz_plugin, (void *)p_vout );
+ "video filter" : "video output",
+ psz_plugin );
if( psz_plugin ) free( psz_plugin );
if( p_vout->p_module == NULL )
return( NULL );
}
-#define f p_vout->p_module->p_functions->vout.functions.vout
- p_vout->pf_create = f.pf_create;
- p_vout->pf_init = f.pf_init;
- p_vout->pf_end = f.pf_end;
- p_vout->pf_destroy = f.pf_destroy;
- p_vout->pf_manage = f.pf_manage;
- p_vout->pf_render = f.pf_render;
- p_vout->pf_display = f.pf_display;
-#undef f
-
/* Create thread and set locks */
vlc_mutex_init( p_vout, &p_vout->picture_lock );
vlc_mutex_init( p_vout, &p_vout->subpicture_lock );
if( vlc_thread_create( p_vout, "video output", RunThread, 0 ) )
{
msg_Err( p_vout, "%s", strerror(ENOMEM) );
- p_vout->pf_destroy( p_vout );
- module_Unneed( p_vout->p_module );
+ module_Unneed( p_vout, p_vout->p_module );
vlc_object_destroy( p_vout );
return NULL;
}
p_vout->b_direct = 0;
/* Choose the best module */
- p_vout->chroma.p_module =
- module_Need( p_vout, MODULE_CAPABILITY_CHROMA,
- NULL, (void *)p_vout );
+ p_vout->chroma.p_module = module_Need( p_vout, "chroma", NULL );
if( p_vout->chroma.p_module == NULL )
{
return( 1 );
}
-#define f p_vout->chroma.p_module->p_functions->chroma.functions.chroma
- p_vout->chroma.pf_init = f.pf_init;
- p_vout->chroma.pf_end = f.pf_end;
-#undef f
-
if( I_OUTPUTPICTURES < 2 * VOUT_MAX_PICTURES )
{
msg_Dbg( p_vout, "indirect render, mapping "
if( p_vout->b_error )
{
/* Destroy thread structures allocated by Create and InitThread */
- p_vout->pf_destroy( p_vout );
-
DestroyThread( p_vout );
return;
}
p_directbuffer = vout_RenderPicture( p_vout, p_picture, p_subpic );
/*
- * Call the plugin-specific rendering method
+ * Call the plugin-specific rendering method if there is one
*/
- if( p_picture != NULL )
+ if( p_picture != NULL && p_vout->pf_render )
{
/* Render the direct buffer returned by vout_RenderPicture */
p_vout->pf_render( p_vout, p_directbuffer );
if( p_picture != NULL )
{
/* Display the direct buffer returned by vout_RenderPicture */
- p_vout->pf_display( p_vout, p_directbuffer );
+ if( p_vout->pf_display )
+ {
+ p_vout->pf_display( p_vout, p_directbuffer );
+ }
/* Reinitialize idle loop count */
i_idle_loops = 0;
/*
* Check events and manage thread
*/
- if( p_vout->pf_manage( p_vout ) )
+ if( p_vout->pf_manage && p_vout->pf_manage( p_vout ) )
{
/* A fatal error occured, and the thread must terminate
* immediately, without displaying anything - setting b_error to 1
if( p_vout->pf_init( p_vout ) )
{
msg_Err( p_vout, "cannot resize display" );
- /* FixMe: p_vout->pf_end will be called again in EndThread() */
+ /* FIXME: pf_end will be called again in EndThread() */
p_vout->b_error = 1;
}
/* Need to reinitialise the chroma plugin */
- p_vout->chroma.pf_end( p_vout );
- p_vout->chroma.pf_init( p_vout );
+ p_vout->chroma.p_module->pf_deactivate( VLC_OBJECT(p_vout) );
+ p_vout->chroma.p_module->pf_activate( VLC_OBJECT(p_vout) );
}
}
/* End of thread */
EndThread( p_vout );
- /* Destroy method-dependant resources */
- p_vout->pf_destroy( p_vout );
-
/* Destroy thread structures allocated by CreateThread */
DestroyThread( p_vout );
}
if( !p_vout->b_direct )
{
- p_vout->chroma.pf_end( p_vout );
- module_Unneed( p_vout->chroma.p_module );
+ module_Unneed( p_vout, p_vout->chroma.p_module );
}
/* Destroy all remaining pictures */
vlc_mutex_destroy( &p_vout->change_lock );
/* Release the module */
- module_Unneed( p_vout->p_module );
+ module_Unneed( p_vout, p_vout->p_module );
}
/* following functions are local */
* vout_pictures.h : picture management definitions
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: vout_pictures.h,v 1.1 2002/07/23 00:39:17 sam Exp $
+ * $Id: vout_pictures.h,v 1.2 2002/07/31 20:56:53 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*****************************************************************************/
/* Packed RGB for 8bpp */
-#define FOURCC_BI_RGB VLC_FOURCC( 0 , 0 , 0 , 0 )
+#define FOURCC_BI_RGB 0x00000000
#define FOURCC_RGB2 VLC_FOURCC('R','G','B','2')
/* Packed RGB for 16, 24, 32bpp */
-#define FOURCC_BI_BITFIELDS VLC_FOURCC( 0 , 0 , 0 , 3 )
+#define FOURCC_BI_BITFIELDS 0x00000003
/* Packed RGB 15bpp, 0x1f, 0x7e0, 0xf800 */
#define FOURCC_RV15 VLC_FOURCC('R','V','1','5')