* ALL: new module API. Makes a few things a lot simpler, and we gain

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).
This commit is contained in:
Sam Hocevar 2002-07-31 20:56:53 +00:00
parent 8a8c1fcace
commit 976dfc3eb4
193 changed files with 4644 additions and 7349 deletions

9
BUGS
View File

@ -1,4 +1,4 @@
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.
@ -16,6 +16,9 @@ Input:
* DVD raw device support doesn't seem to work.
* Going to title 0 with the dvdold or dvdread plugins segfaults (tested
with Nausicaa).
Decoders:
@ -36,6 +39,10 @@ Video output:
* 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.

View File

@ -357,7 +357,7 @@ plugins-uninstall:
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:
@ -564,9 +564,7 @@ src/misc/modules_builtin.h: Makefile.opts Makefile Makefile.config
@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
@ -621,10 +619,6 @@ ifeq ($(SYS),beos)
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
#
@ -633,6 +627,10 @@ lib/libvlc.a: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
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 $@

124
configure vendored
View File

@ -1527,7 +1527,7 @@ else
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;
@ -1602,7 +1602,7 @@ for ac_kw in inline __inline__ __inline; do
#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
@ -1708,7 +1708,7 @@ else
#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
@ -2061,15 +2061,12 @@ else
#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
@ -2124,7 +2121,7 @@ main()
/*
* 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)
@ -2145,7 +2142,7 @@ main()
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);
@ -2163,7 +2160,7 @@ main()
*/
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)
@ -2177,7 +2174,7 @@ main()
}
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
@ -2201,12 +2198,12 @@ fi
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>
@ -2242,17 +2239,17 @@ stdlib.h string.h unistd.h sys/param.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*
@ -2283,12 +2280,12 @@ getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
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. */
@ -2311,7 +2308,7 @@ $ac_func();
; 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
@ -2351,7 +2348,7 @@ fi
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
@ -2359,7 +2356,7 @@ 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>
@ -2369,7 +2366,7 @@ iconv_t cd = iconv_open("","");
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
@ -2381,7 +2378,7 @@ rm -f conftest*
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>
@ -2391,7 +2388,7 @@ iconv_t cd = iconv_open("","");
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
@ -2412,13 +2409,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
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>
@ -2437,7 +2434,7 @@ int main() {
; 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
@ -2466,19 +2463,19 @@ EOF
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
@ -2501,19 +2498,19 @@ EOF
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
@ -2534,7 +2531,7 @@ EOF
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"
@ -2556,7 +2553,7 @@ fi
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"
@ -2576,17 +2573,17 @@ fi
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*
@ -2603,12 +2600,12 @@ fi
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;
@ -2617,7 +2614,7 @@ bindtextdomain ("", "");
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
@ -2633,14 +2630,14 @@ echo "$ac_t""$gt_cv_func_gnugettext1_libc" 1>&6
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;
@ -2649,7 +2646,7 @@ bindtextdomain ("", "");
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
@ -2682,12 +2679,12 @@ EOF
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. */
@ -2710,7 +2707,7 @@ $ac_func();
; 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
@ -2739,7 +2736,7 @@ done
# 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
@ -2773,7 +2770,7 @@ fi
# 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
@ -2810,7 +2807,7 @@ fi
# 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
@ -2860,7 +2857,7 @@ fi
# 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
@ -2894,7 +2891,7 @@ fi
# 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
@ -2930,7 +2927,7 @@ fi
# 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
@ -3001,7 +2998,7 @@ do
# 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
@ -3034,7 +3031,7 @@ done
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;;
@ -3081,7 +3078,7 @@ echo "configure:3038: checking version of bison" >&5
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
@ -3133,7 +3130,7 @@ echo "configure:3085: checking for catalogs to be installed" >&5
# 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
@ -3215,7 +3212,7 @@ case "x${target_os}" in
# 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
@ -3247,7 +3244,7 @@ if test -n "$ac_tool_prefix"; then
# 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
@ -3292,6 +3289,9 @@ fi
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}"
@ -9199,7 +9199,7 @@ EOF
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

View File

@ -1816,7 +1816,7 @@ AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version ${VERSION} ${CO
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"

View File

@ -183,3 +183,13 @@ the Boston strangler is to the woman home alone.
-- 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
%

View File

@ -2,7 +2,7 @@
* 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>
@ -31,6 +31,8 @@ struct dm_par_t
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);

View File

@ -2,7 +2,7 @@
* 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>
@ -32,6 +32,8 @@ struct complex_t
struct imdct_t
{
VLC_COMMON_MEMBERS
complex_t * buf;
void * buf_orig; /* pointer before memalign */

View File

@ -2,7 +2,7 @@
* 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>
@ -120,11 +120,9 @@ struct aout_thread_t
/* 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
@ -185,7 +183,7 @@ struct aout_thread_t
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 );

View File

@ -4,7 +4,7 @@
* 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>
*
@ -49,6 +49,7 @@
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 */
@ -89,16 +90,16 @@ VLC_EXPORT( void, config_Duplicate, ( module_t *, module_config_t * ) );
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.
@ -113,61 +114,43 @@ VLC_EXPORT( void, config_UnsetCallbacks, ( module_config_t * ) );
* 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 ) \
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_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_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++

View File

@ -2,7 +2,7 @@
* 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>
@ -118,6 +118,10 @@ struct decoder_fifo_t
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 * );
};
/*****************************************************************************

View File

@ -4,7 +4,7 @@
* 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>
*
@ -65,13 +65,9 @@ struct es_descriptor_t
/* 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
@ -274,9 +270,7 @@ struct input_thread_t
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 * );
@ -285,9 +279,7 @@ struct input_thread_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 *
@ -347,19 +339,19 @@ struct input_thread_t
/*****************************************************************************
* 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 * ) );
@ -370,6 +362,5 @@ VLC_EXPORT( int, input_ChangeProgram, ( input_thread_t *, u16 ) );
int input_ToggleGrayscale( input_thread_t * );
int input_ToggleMute ( input_thread_t * );
int input_SetSMP ( input_thread_t *, int );
#endif /* "input_ext-intf.h" */

View File

@ -3,7 +3,7 @@
* 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>
*
@ -79,7 +79,7 @@ int input_DelInfo( input_thread_t * p_input ); /* no need to export this */
/*****************************************************************************
* 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 * ) );
@ -282,8 +282,10 @@ struct input_socket_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 ) );

View File

@ -4,7 +4,7 @@
* 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>
*
@ -40,23 +40,20 @@ struct intf_thread_t
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 * ) );

View File

@ -2,7 +2,7 @@
* 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>
*
@ -21,6 +21,6 @@
* 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 * ) );

View File

@ -3,7 +3,7 @@
* 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>
*
@ -44,7 +44,7 @@ struct vlc_t
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 ? */
@ -58,7 +58,7 @@ struct vlc_t
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;

View File

@ -2,7 +2,7 @@
* 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>
*
@ -36,53 +36,6 @@ typedef int module_handle_t;
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
*****************************************************************************
@ -90,11 +43,14 @@ typedef void * module_handle_t;
*****************************************************************************/
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;
};
/*****************************************************************************
@ -113,14 +69,18 @@ struct module_t
* 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
@ -132,25 +92,12 @@ struct module_t
/*
* Variables used internally by the module manager
*/
/* Plugin-specific stuff */
module_handle_t handle; /* Unique handle */
char * psz_filename; /* Module filename */
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;
struct
{
int ( *pf_deactivate ) ( module_t * );
} builtin;
} is;
int i_usage; /* Reference counter */
int i_unused_delay; /* Delay until module is unloaded */
@ -163,178 +110,26 @@ struct module_t
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 * ) );

View File

@ -2,7 +2,7 @@
* 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>
*
@ -48,22 +48,28 @@
#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 )
/*
@ -72,86 +78,112 @@
* 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; \
}
return 0 && i_shortcut; \
} \
int __VLC_SYMBOL(vlc_entry) ( module_t * ) /* the ; gets added */
#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_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_PROGRAM( program ) \
p_module->psz_program = program;
#define add_requirement( cap ) \
p_module->i_cpu |= CPU_CAPABILITY_##cap
#define ADD_SHORTCUT( shortcut ) \
p_module->pp_shortcuts[ i_shortcut ] = shortcut; \
i_shortcut++;
#define add_shortcut( shortcut ) \
p_submodule->pp_shortcuts[ i_shortcut ] = shortcut; \
i_shortcut++
#define SET_DESCRIPTION( desc ) \
p_module->psz_longname = desc;
#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 )

View File

@ -4,7 +4,7 @@
* 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>
@ -33,8 +33,8 @@
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 * ) );

View File

@ -4,7 +4,7 @@
* 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>
*
@ -43,8 +43,6 @@ struct stream_ctrl_t
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 : */

View File

@ -5,7 +5,7 @@
* 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>
@ -47,8 +47,6 @@ typedef struct vout_chroma_t
/* 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;
@ -102,10 +100,8 @@ struct vout_thread_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 * );
@ -170,7 +166,7 @@ struct vout_thread_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 * ) );

View File

@ -3,7 +3,7 @@
* 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>
@ -254,6 +254,9 @@ VLC_DECLARE_STRUCT(input_info_category_t)
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; \
@ -263,8 +266,8 @@ struct vlc_object_t
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
/*****************************************************************************

View File

@ -2,7 +2,7 @@
* 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>
*
@ -21,6 +21,6 @@
* 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 * );

View File

@ -4,7 +4,7 @@
* 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>
@ -61,6 +61,8 @@ struct msg_bank_t
{
/* 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 */
@ -98,19 +100,19 @@ VLC_EXPORT( void, __msg_Dbg, ( void *, const char *, ... ) );
#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 */
@ -122,15 +124,15 @@ VLC_EXPORT( void, __msg_Dbg, ( void *, const char *, ... ) );
#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 * ) );

View File

@ -2,7 +2,7 @@
* 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>
*
@ -31,7 +31,7 @@
#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
@ -40,6 +40,9 @@
#define FIND_STRICT 0x0010
/* Object cast */
/*****************************************************************************
* Prototypes
*****************************************************************************/
@ -58,35 +61,35 @@ VLC_EXPORT( void, __vlc_object_attach, ( vlc_object_t *, vlc_object_t * ) );
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) )

View File

@ -2,7 +2,7 @@
* 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>
*
@ -54,7 +54,7 @@ struct playlist_t
/*****************************************************************************
* 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 * );

View File

@ -3,8 +3,8 @@
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 ) ;
@ -24,7 +24,16 @@ struct module_symbols_t
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 * ) ;
@ -35,21 +44,12 @@ struct module_symbols_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 ) ;
@ -69,17 +69,39 @@ struct module_symbols_t
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 (* __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 (* 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 (* 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 (* input_AccessEnd_inner) ( input_thread_t * ) ;
void (* input_AccessReinit_inner) ( input_thread_t * ) ;
void (* input_BuffersEnd_inner) ( input_thread_t *, input_buffers_t * ) ;
@ -87,46 +109,22 @@ struct module_symbols_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 * ) ;
@ -137,17 +135,26 @@ struct module_symbols_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
@ -156,15 +163,49 @@ struct module_symbols_t
# 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
@ -181,15 +222,13 @@ struct module_symbols_t
# 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
@ -200,8 +239,8 @@ struct module_symbols_t
# 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
@ -209,65 +248,26 @@ struct module_symbols_t
# 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

View File

@ -3,7 +3,7 @@
* 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>
@ -191,19 +191,19 @@ VLC_EXPORT( void, __vlc_thread_join, ( vlc_object_t *, char *, int ) );
* 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
@ -344,7 +344,7 @@ static inline int __vlc_mutex_unlock( char * psz_file, int i_line,
* 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
@ -731,21 +731,21 @@ static inline int __vlc_cond_wait( char * psz_file, int i_line,
* 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

View File

@ -4,7 +4,7 @@
* (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>
*
@ -63,8 +63,8 @@ static vlc_bool_t b_liba52_initialized = 0;
/*****************************************************************************
* 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 * );
@ -74,16 +74,7 @@ static void float2s16_2 ( float *, int16_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_( \
@ -93,38 +84,37 @@ void _M( adec_getfunctions )( function_list_t * p_function_list )
"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;

View File

@ -2,7 +2,7 @@
* 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>
*
@ -42,54 +42,25 @@
/*****************************************************************************
* 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 * );
static int Init ( 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( _("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
/*****************************************************************************
* 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 = 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;
@ -100,6 +71,9 @@ static int Init( input_thread_t * p_input )
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 )
{
@ -141,13 +115,6 @@ static int Init( input_thread_t * p_input )
return( 0 );
}
/*****************************************************************************
* End: frees unused data
*****************************************************************************/
static void End( input_thread_t * p_input )
{
}
/*****************************************************************************
* Demux: reads and demuxes data packets
*****************************************************************************

View File

@ -2,7 +2,7 @@
* 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>
*
@ -35,31 +35,28 @@
#include <vlc/intf.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 Display ( vout_thread_t *, picture_t * );
static void SetPalette ( vout_thread_t *, u16 *, u16 *, u16 * );
/*****************************************************************************
* Build configuration tree.
* Module descriptor
*****************************************************************************/
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
MODULE_ACTIVATE_START
vout_getfunctions( &p_module->p_functions->vout );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
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
@ -76,40 +73,14 @@ struct vout_sys_t
};
/*****************************************************************************
* 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 )
@ -127,6 +98,12 @@ static int vout_Create( vout_thread_t *p_vout )
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 );
@ -136,9 +113,9 @@ static int vout_Create( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -185,31 +162,33 @@ static int vout_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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 );
@ -241,9 +220,9 @@ static int vout_Manage( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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 ),
@ -251,9 +230,9 @@ static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
}
/*****************************************************************************
* 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;

View File

@ -2,7 +2,7 @@
* 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>
*
@ -44,67 +44,51 @@
/*****************************************************************************
* 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 */
@ -246,57 +230,43 @@ static int InitThread( ac3dec_t * p_ac3dec )
/*
* 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) );
@ -333,7 +303,7 @@ static int InitThread( ac3dec_t * p_ac3dec )
16, 64 * sizeof(complex_t) );
#undef IMDCT
_M( ac3_init )( p_ac3dec );
E_( ac3_init )( p_ac3dec );
/*
* Initialize the output properties
@ -366,7 +336,7 @@ static void EndThread (ac3dec_t * p_ac3dec)
}
/* 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 );
@ -387,8 +357,11 @@ static void EndThread (ac3dec_t * p_ac3dec)
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 );

View File

@ -2,7 +2,7 @@
* 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>
@ -40,7 +40,7 @@ typedef struct ac3_sync_info_s {
/**** 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);
@ -394,7 +394,7 @@ struct ac3dec_s
bit_allocate_t bit_allocate;
mantissa_t mantissa;
downmix_t downmix;
downmix_t * p_downmix;
/*
* Output properties
@ -403,7 +403,7 @@ struct ac3dec_s
float * samples;
void * samples_orig; /* pointer before memalign */
imdct_t * imdct;
imdct_t * p_imdct;
void * imdct_orig; /* pointer before memalign */
};

View File

@ -2,7 +2,7 @@
* 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>
@ -40,10 +40,10 @@
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;
}

View File

@ -2,7 +2,7 @@
* 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>
@ -35,7 +35,7 @@ typedef struct ac3_sync_info_s {
/**** 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);

View File

@ -2,7 +2,7 @@
* 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>
@ -42,7 +42,7 @@
# 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;
@ -69,11 +69,11 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
/* 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
@ -93,19 +93,19 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
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;
@ -114,17 +114,17 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
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
@ -135,13 +135,13 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
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 );
}
}
@ -154,13 +154,13 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
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++;
@ -176,12 +176,12 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
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++;
@ -197,12 +197,12 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
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;
@ -217,11 +217,11 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
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;
@ -236,11 +236,11 @@ void imdct (ac3dec_t * p_ac3dec, s16 * buffer)
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;

View File

@ -2,7 +2,7 @@
* 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>
*
@ -40,7 +40,7 @@ void bit_allocate (ac3dec_t *);
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 */

View File

@ -2,7 +2,7 @@
* 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>
@ -42,10 +42,11 @@
#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 );
@ -98,52 +99,41 @@ static const frame_size_t p_frame_size_code[64] =
};
/*****************************************************************************
* 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( _("SPDIF pass-through AC3 decoder") );
set_capability( "decoder", 0 );
set_callbacks( OpenDecoder, NULL );
add_shortcut( "pass_through" );
add_shortcut( "pass" );
vlc_module_end();
/*****************************************************************************
* 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
/*****************************************************************************
* 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;

View File

@ -2,7 +2,7 @@
* 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>
*
@ -41,51 +41,11 @@
#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;
@ -103,6 +63,11 @@ static int FileOpen( input_thread_t * p_input )
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 ) )
@ -173,3 +138,14 @@ static int FileOpen( input_thread_t * p_input )
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();

View File

@ -2,7 +2,7 @@
* 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>
*
@ -55,47 +55,22 @@
/*****************************************************************************
* 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 * );
static int SetProgram ( input_thread_t *, pgrm_descriptor_t * );
static void Seek ( input_thread_t *, off_t );
/*****************************************************************************
* Build configuration tree.
* Module descriptor
*****************************************************************************/
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
/*****************************************************************************
* 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 = 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
@ -124,14 +99,13 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell )
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;
@ -166,7 +140,9 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell )
/* 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 ) )
@ -270,10 +246,11 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell )
}
/*****************************************************************************
* 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;
@ -459,6 +436,11 @@ static int HTTPOpen( input_thread_t * p_input )
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;
@ -484,10 +466,11 @@ static int HTTPOpen( input_thread_t * p_input )
}
/*****************************************************************************
* 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;
@ -496,18 +479,18 @@ static void HTTPClose( input_thread_t * p_input )
}
/*****************************************************************************
* 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 );

View File

@ -2,7 +2,7 @@
* 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>
*
@ -45,51 +45,26 @@
/*****************************************************************************
* 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 = "";
@ -217,6 +192,11 @@ static int UDPOpen( input_thread_t * p_input )
}
}
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;
@ -248,14 +228,14 @@ static int UDPOpen( input_thread_t * p_input )
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 )

View File

@ -2,7 +2,7 @@
* 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
@ -36,35 +36,27 @@
#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
@ -95,25 +87,14 @@ struct aout_sys_t
};
/*****************************************************************************
* 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;
@ -127,6 +108,10 @@ static int aout_Open( aout_thread_t *p_aout )
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" );
@ -179,12 +164,12 @@ static int aout_Open( aout_thread_t *p_aout )
}
/*****************************************************************************
* 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;
@ -317,12 +302,12 @@ static int aout_SetFormat( aout_thread_t *p_aout )
}
/*****************************************************************************
* 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;
@ -339,14 +324,14 @@ static void aout_HandleXrun(aout_thread_t *p_aout)
/*****************************************************************************
* 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;
@ -366,7 +351,7 @@ static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
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:
@ -384,11 +369,11 @@ static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
}
/*****************************************************************************
* 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;
@ -415,10 +400,11 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
}
/*****************************************************************************
* 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 );

View File

@ -46,51 +46,30 @@ struct aout_sys_t
};
/*****************************************************************************
* 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 * );
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( _("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
vlc_module_begin();
set_description( _("aRts audio module") );
set_capability( "audio output", 50 );
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 arts connection to server
*****************************************************************************/
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: 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 */
@ -110,6 +89,10 @@ static int aout_Open( aout_thread_t *p_aout )
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" );
@ -117,9 +100,9 @@ static int aout_Open( aout_thread_t *p_aout )
}
/*****************************************************************************
* 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);*/
@ -131,20 +114,20 @@ static int aout_SetFormat( aout_thread_t *p_aout )
}
/*****************************************************************************
* 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 );
@ -155,10 +138,12 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int 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 );
}

View File

@ -2,7 +2,7 @@
* 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
@ -39,43 +39,20 @@
/*****************************************************************************
* 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 * );
#define AVIEnd(a) __AVIEnd(VLC_OBJECT(a))
/*****************************************************************************
* Build configuration tree.
* Module descriptor
*****************************************************************************/
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
/*****************************************************************************
* 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 = 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
@ -544,8 +521,9 @@ static void __AVI_UpdateIndexOffset( input_thread_t *p_input )
/*****************************************************************************
* 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 ;
@ -580,8 +558,9 @@ static void AVIEnd( input_thread_t *p_input )
/*****************************************************************************
* 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;
@ -589,6 +568,8 @@ static int AVIInit( input_thread_t *p_input )
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) ) ) )
{
@ -1039,7 +1020,7 @@ static int __AVI_SeekAndGetChunk( input_thread_t *p_input,
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,
@ -1049,10 +1030,9 @@ static int __AVI_SeekAndGetChunk( input_thread_t *p_input,
(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 );
}
@ -1532,6 +1512,7 @@ static pes_packet_t *AVI_ReadStreamBytesInPES( input_thread_t *p_input,
{
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 );

View File

@ -2,7 +2,7 @@
* 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>
@ -37,11 +37,8 @@
#include <malloc.h>
#include <string.h>
extern "C"
{
#include <vlc/vlc.h>
#include <vlc/aout.h>
}
/*****************************************************************************
* aout_sys_t: BeOS audio output method descriptor
@ -58,37 +55,20 @@ struct aout_sys_t
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 )
@ -114,6 +94,10 @@ static int aout_Open( aout_thread_t *p_aout )
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,
@ -143,17 +127,17 @@ static int aout_Open( aout_thread_t *p_aout )
}
/*****************************************************************************
* 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();
@ -168,11 +152,11 @@ static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
}
/*****************************************************************************
* 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;
@ -202,10 +186,12 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
}
/*****************************************************************************
* 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;
@ -213,5 +199,3 @@ static void aout_Close( aout_thread_t *p_aout )
free( p_aout->p_sys );
}
} /* extern "C" */

View File

@ -2,7 +2,7 @@
* 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>
@ -30,35 +30,31 @@
#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 * );
int E_(OpenAudio) ( vlc_object_t * );
void E_(CloseAudio) ( vlc_object_t * );
int E_(OpenVideo) ( vlc_object_t * );
void E_(CloseVideo) ( vlc_object_t * );
/*****************************************************************************
* Build configuration tree.
* Module descriptor
*****************************************************************************/
MODULE_CONFIG_START
MODULE_CONFIG_STOP
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();
MODULE_INIT_START
SET_DESCRIPTION( _("BeOS standard API module") )
ADD_CAPABILITY( INTF, 100 )
ADD_CAPABILITY( VOUT, 100 )
ADD_CAPABILITY( AOUT, 100 )
MODULE_INIT_STOP
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
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
} /* extern "C" */

View File

@ -2,7 +2,7 @@
* 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>
@ -38,32 +38,17 @@
#include "intf_vlc_wrapper.h"
#include "InterfaceWindow.h"
extern "C"
{
/*****************************************************************************
* Local prototype
*****************************************************************************/
static void Run ( intf_thread_t *p_intf );
/*****************************************************************************
* Local prototypes.
* OpenIntf: initialize interface
*****************************************************************************/
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;
}
/*****************************************************************************
* intf_Open: 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();
@ -83,6 +68,7 @@ static int intf_Open( intf_thread_t *p_intf )
// 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 =
@ -99,10 +85,12 @@ static int intf_Open( intf_thread_t *p_intf )
}
/*****************************************************************************
* 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 );
@ -120,9 +108,9 @@ static void intf_Close( intf_thread_t *p_intf )
/*****************************************************************************
* 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 )
{
@ -153,5 +141,3 @@ static void intf_Run( intf_thread_t *p_intf )
}
} /* extern "C" */

View File

@ -2,7 +2,7 @@
* 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>
@ -460,46 +460,26 @@ void VLCView::Draw(BRect updateRect)
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 )
@ -511,13 +491,19 @@ int vout_Create( vout_thread_t *p_vout )
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;
@ -583,50 +569,32 @@ int vout_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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 )
{
vout_thread_t * p_vout = (vout_thread_t *)p_this;
free( p_vout->p_sys );
}
/*****************************************************************************
* 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 )
{
;
}
/*****************************************************************************
* 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;
@ -683,6 +651,3 @@ static void BeosCloseDisplay( vout_thread_t *p_vout )
p_win = NULL;
}
} /* extern "C" */

View File

@ -2,7 +2,7 @@
* 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>
*
@ -40,10 +40,8 @@
/*****************************************************************************
* 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 );
@ -52,48 +50,30 @@ static void Set8bppPalette ( vout_thread_t *, u8 * );
#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
set_callbacks( Activate, Deactivate );
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 defined (MODULE_NAME_IS_chroma_i420_rgb)
size_t i_tables_size;
#endif
@ -112,20 +92,20 @@ static int chroma_Init( vout_thread_t *p_vout )
{
#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:
@ -214,12 +194,14 @@ static int chroma_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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

View File

@ -2,7 +2,7 @@
* 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>
*
@ -45,11 +45,11 @@ struct chroma_sys_t
* 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

View File

@ -2,7 +2,7 @@
* 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>
*
@ -50,8 +50,8 @@ static void SetOffset( int, int, int, int, vlc_bool_t *, int *, int * );
* - 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;
@ -178,8 +178,8 @@ void _M( I420_RGB15 )( vout_thread_t *p_vout, picture_t *p_src,
* - 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;
@ -306,8 +306,8 @@ void _M( I420_RGB16 )( vout_thread_t *p_vout, picture_t *p_src,
* - 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;

View File

@ -2,7 +2,7 @@
* 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>
*
@ -39,8 +39,7 @@ static void SetOffset( int, int, int, int, vlc_bool_t *, int *, int * );
/*****************************************************************************
* 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;

View File

@ -2,7 +2,7 @@
* 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>
*
@ -37,54 +37,33 @@
/*****************************************************************************
* 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;
@ -113,16 +92,6 @@ static int chroma_Init( vout_thread_t *p_vout )
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 */
/*****************************************************************************

View File

@ -2,7 +2,7 @@
* 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>
*
@ -44,10 +44,7 @@
/*****************************************************************************
* 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 * );
@ -64,49 +61,32 @@ static unsigned long long i_80w;
#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
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;
@ -160,16 +140,6 @@ static int chroma_Init( vout_thread_t *p_vout )
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 */
/*****************************************************************************

View File

@ -2,7 +2,7 @@
* 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>
*
@ -43,10 +43,7 @@
/*****************************************************************************
* 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 * );
@ -58,46 +55,29 @@ static void I422_Y211 ( 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
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;
@ -149,16 +129,6 @@ static int chroma_Init( vout_thread_t *p_vout )
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 */
/*****************************************************************************

View File

@ -2,7 +2,7 @@
* 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>
*
@ -45,68 +45,50 @@
#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
* Module descriptor
*****************************************************************************/
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;
}
vlc_module_begin();
set_description( "Cinepak video decoder" );
set_capability( "decoder", 70 );
set_callbacks( OpenDecoder, NULL );
vlc_module_end();
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
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
/*****************************************************************************
* 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;

View File

@ -2,7 +2,7 @@
* 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>
*
@ -93,11 +93,9 @@ struct aout_sys_t
/*****************************************************************************
* 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 * );
@ -106,29 +104,17 @@ static int DirectxInitDSound ( 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 ) );
@ -148,6 +134,9 @@ static int aout_Open( aout_thread_t *p_aout )
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 ) )
@ -201,19 +190,19 @@ static int aout_Open( aout_thread_t *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 */
@ -272,19 +261,19 @@ static int aout_SetFormat( aout_thread_t *p_aout )
}
/*****************************************************************************
* 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 );
}
@ -292,7 +281,7 @@ static int aout_GetBufInfo( aout_thread_t *p_aout, int 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 );
}
@ -302,18 +291,18 @@ static int aout_GetBufInfo( aout_thread_t *p_aout, int 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;
@ -336,7 +325,7 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
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;
@ -382,7 +371,7 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
}
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;
}
@ -420,19 +409,20 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
}
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 );
@ -742,7 +732,7 @@ static void DirectSoundThread( notification_thread_t *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;
}

View File

@ -2,7 +2,7 @@
* 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>
*
@ -30,13 +30,16 @@
#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_( \
@ -49,27 +52,24 @@ void _M( vout_getfunctions )( function_list_t * p_function_list );
"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
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_INIT_START
SET_DESCRIPTION( _("DirectX extension module") )
ADD_CAPABILITY( AOUT, 150 )
ADD_CAPABILITY( VOUT, 150 )
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
#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

View File

@ -2,7 +2,7 @@
* 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>
*
@ -60,13 +60,10 @@ DEFINE_GUID( IID_IDirectDrawSurface2, 0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x
/*****************************************************************************
* 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 );
@ -85,27 +82,14 @@ static void DirectXGetDDrawCaps ( vout_thread_t *p_vout );
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 )
@ -115,6 +99,12 @@ static int vout_Create( vout_thread_t *p_vout )
}
/* 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;
@ -182,18 +172,18 @@ static int vout_Create( vout_thread_t *p_vout )
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;
@ -268,25 +258,27 @@ static int vout_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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 );
@ -315,12 +307,12 @@ static void vout_Destroy( vout_thread_t *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;
@ -412,20 +404,12 @@ static int vout_Manage( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -828,7 +812,7 @@ static int DirectXCreateSurface( vout_thread_t *p_vout,
*****************************************************************************
* 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 )
{

View File

@ -1,3 +1,3 @@
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

View File

@ -2,7 +2,7 @@
* 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>
*
@ -30,7 +30,7 @@
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"
@ -76,7 +76,7 @@ void _M( downmix_3f_2r_to_2ch ) (float * samples, dm_par_t * dm_par)
: "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"
@ -115,7 +115,7 @@ void _M( downmix_2f_2r_to_2ch ) (float *samples, dm_par_t * dm_par)
: "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"
@ -159,7 +159,7 @@ void _M( downmix_3f_1r_to_2ch ) (float *samples, dm_par_t * dm_par)
: "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"
@ -196,7 +196,7 @@ void _M( downmix_2f_1r_to_2ch ) (float *samples, dm_par_t * dm_par)
: "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"
@ -233,7 +233,7 @@ void _M( downmix_3f_0r_to_2ch ) (float *samples, dm_par_t * dm_par)
: "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"
@ -268,7 +268,7 @@ void _M( stream_sample_1ch_to_s16 ) (s16 *s16_samples, float *left)
: "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__ (

View File

@ -2,7 +2,7 @@
* 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>
@ -31,7 +31,7 @@
#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;
@ -51,7 +51,7 @@ void _M( downmix_3f_2r_to_2ch ) (float *samples, dm_par_t *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)
{
int i;
float *left, *right, *left_sur, *right_sur;
@ -70,7 +70,7 @@ void _M( downmix_2f_2r_to_2ch ) (float *samples, dm_par_t *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)
{
int i;
float *left, *right, *center, *right_sur;
@ -90,7 +90,7 @@ void _M( downmix_3f_1r_to_2ch ) (float *samples, dm_par_t *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)
{
int i;
float *left, *right, *right_sur;
@ -109,7 +109,7 @@ void _M( downmix_2f_1r_to_2ch ) (float *samples, dm_par_t *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)
{
int i;
float *left, *right, *center;
@ -128,7 +128,7 @@ void _M( downmix_3f_0r_to_2ch ) (float *samples, dm_par_t *dm_par)
}
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++) {
@ -138,7 +138,7 @@ void _M( stream_sample_2ch_to_s16 ) (s16 *out_buf, float *left, float *right)
}
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;

View File

@ -2,7 +2,7 @@
* 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>
@ -22,11 +22,11 @@
* 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 * );

View File

@ -2,7 +2,7 @@
* 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>
@ -31,7 +31,7 @@
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"
@ -76,7 +76,7 @@ void _M( downmix_3f_2r_to_2ch ) (float * samples, dm_par_t * dm_par)
: "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"
@ -114,7 +114,7 @@ void _M( downmix_2f_2r_to_2ch ) (float *samples, dm_par_t * dm_par)
: "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"
@ -157,7 +157,7 @@ void _M( downmix_3f_1r_to_2ch ) (float *samples, dm_par_t * dm_par)
: "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"
@ -193,7 +193,7 @@ void _M( downmix_2f_1r_to_2ch ) (float *samples, dm_par_t * dm_par)
: "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"
@ -229,7 +229,7 @@ void _M( downmix_3f_0r_to_2ch ) (float *samples, dm_par_t * dm_par)
: "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"
@ -268,7 +268,7 @@ void _M( stream_sample_1ch_to_s16 ) (s16 *s16_samples, float *left)
: "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"

View File

@ -2,7 +2,7 @@
* 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>
*
@ -33,45 +33,41 @@
#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
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 )
static int Open ( vlc_object_t *p_this )
{
#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
downmix_t *p_downmix = (downmix_t *)p_this;
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 );
return VLC_SUCCESS;
}
/*****************************************************************************
* Module descriptor
*****************************************************************************/
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();

View File

@ -1,79 +0,0 @@
/*****************************************************************************
* 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
}

View File

@ -1,78 +0,0 @@
/*****************************************************************************
* 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
}

View File

@ -2,7 +2,7 @@
* 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>
@ -61,60 +61,36 @@ struct aout_sys_t
};
/*****************************************************************************
* 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 * );
static int SetFormat ( aout_thread_t * );
static int GetBufInfo ( aout_thread_t *, int );
static void Play ( aout_thread_t *, byte_t *, int );
/*****************************************************************************
* Capabilities defined in the other files.
* Module descriptor
*****************************************************************************/
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();
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
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
/*****************************************************************************
* 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 )
@ -131,6 +107,10 @@ static int aout_Open( aout_thread_t *p_aout )
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 )
@ -146,14 +126,14 @@ static int aout_Open( aout_thread_t *p_aout )
}
/*****************************************************************************
* 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;
@ -219,7 +199,7 @@ static int aout_SetFormat( aout_thread_t *p_aout )
}
/*****************************************************************************
* 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)
@ -228,7 +208,7 @@ static int aout_SetFormat( aout_thread_t *p_aout )
* - 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 );
@ -240,11 +220,11 @@ static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
}
/*****************************************************************************
* 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 );
@ -256,10 +236,12 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int 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 );
}

View File

@ -2,7 +2,7 @@
* 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>
*
@ -29,77 +29,47 @@
#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;
p_aout->pf_setformat = SetFormat;
p_aout->pf_getbufinfo = GetBufInfo;
p_aout->pf_play = Play;
return VLC_SUCCESS;
}
/*****************************************************************************
* aout_Open: opens a dummy audio device
* SetFormat: pretends to set the dsp output format
*****************************************************************************/
static int aout_Open( aout_thread_t *p_aout )
static int SetFormat( aout_thread_t *p_aout )
{
return( 0 );
}
/*****************************************************************************
* aout_SetFormat: pretends to set the dsp output format
* GetBufInfo: returns available bytes in buffer
*****************************************************************************/
static int aout_SetFormat( aout_thread_t *p_aout )
{
return( 0 );
}
/*****************************************************************************
* aout_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
* 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
*****************************************************************************/
static void aout_Close( aout_thread_t *p_aout )
static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
;
}

View File

@ -2,7 +2,7 @@
* 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>
*
@ -40,26 +40,18 @@
/*****************************************************************************
* 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;
}
/*****************************************************************************

View File

@ -2,7 +2,7 @@
* 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>
*
@ -29,18 +29,10 @@
#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_( \
@ -48,36 +40,28 @@ void _M( dec_getfunctions ) ( function_list_t * p_function_list );
"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();

39
plugins/dummy/dummy.h Normal file
View File

@ -0,0 +1,39 @@
/*****************************************************************************
* 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 * );

View File

@ -2,7 +2,7 @@
* 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>
*
@ -36,11 +36,7 @@
/*****************************************************************************
* 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
@ -60,61 +56,34 @@ struct demux_sys_t
#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
}
input_thread_t *p_input = (input_thread_t *)p_this;
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
}
/*****************************************************************************
* 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;
return VLC_SUCCESS;
}
/*****************************************************************************
* DummyClose: close the target, ie. do nothing
* OpenDemux: initialize the target, ie. parse the command
*****************************************************************************/
static void DummyClose( input_thread_t * p_input )
{
}
/*****************************************************************************
* DummyInit: 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 )
@ -168,17 +137,19 @@ static int DummyInit( input_thread_t *p_input )
}
/*****************************************************************************
* 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;

View File

@ -2,7 +2,7 @@
* 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>
*
@ -30,45 +30,17 @@
#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 );
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.
* Open: 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_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 );
};
intf_thread_t *p_intf = (intf_thread_t*) p_this;
#ifdef WIN32
AllocConsole();
freopen( "CONOUT$", "w", stdout );
@ -78,23 +50,15 @@ static int intf_Open( intf_thread_t *p_intf )
msg_Info( p_intf, _("\nUsing the dummy interface plugin...") );
#endif
return( 0 );
p_intf->pf_run = Run;
return VLC_SUCCESS;
}
/*****************************************************************************
* intf_Close: destroy dummy interface
* Run: main loop
*****************************************************************************/
static void intf_Close( intf_thread_t *p_intf )
{
/* Destroy structure */
free( p_intf->p_sys );
}
/*****************************************************************************
* intf_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 )
{

View File

@ -2,7 +2,7 @@
* 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>
*
@ -24,41 +24,12 @@
/*****************************************************************************
* 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();

View File

@ -2,7 +2,7 @@
* 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>
*
@ -35,68 +35,37 @@
#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 * );
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 * );
/*****************************************************************************
* 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 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;
@ -184,9 +153,9 @@ static int vout_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -199,38 +168,28 @@ static void vout_End( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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 */
}

View File

@ -2,7 +2,7 @@
* 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>
*
@ -44,15 +44,14 @@
# 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 );
@ -60,38 +59,33 @@ static void UnprobeLibDVDCSS( 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 */

View File

@ -8,7 +8,7 @@
* -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>
*
@ -69,8 +69,6 @@
*****************************************************************************/
/* 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 );
@ -78,22 +76,6 @@ static void DVDSeek ( input_thread_t *, off_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
*/
@ -104,8 +86,9 @@ void _M( access_getfunctions)( function_list_t * p_function_list )
/*****************************************************************************
* 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;
@ -119,6 +102,11 @@ static int DVDOpen( input_thread_t *p_input )
}
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 ) ) )
{
@ -247,8 +235,9 @@ static int DVDOpen( input_thread_t *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 );
@ -465,7 +454,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
DVDReadAudio( p_input );
DVDReadSPU ( p_input );
if( p_input->p_demux_module )
if( p_input->p_demux )
{
DVDLaunchDecoders( p_input );
}

View File

@ -1,7 +1,7 @@
/* 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>
*
@ -50,29 +50,10 @@
/*****************************************************************************
* 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
*/
@ -80,13 +61,18 @@ void _M( demux_getfunctions)( function_list_t * p_function_list )
/*****************************************************************************
* 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 );
@ -96,13 +82,6 @@ static int DVDInit( input_thread_t * p_input )
return 0;
}
/*****************************************************************************
* DVDEnd: frees unused data
*****************************************************************************/
static void DVDEnd( input_thread_t * p_input )
{
}
/*****************************************************************************
* DVDDemux
*****************************************************************************/
@ -131,11 +110,3 @@ static int DVDDemux( input_thread_t * p_input )
return i;
}
/*****************************************************************************
* DVDRewind : reads a stream backward
*****************************************************************************/
static int DVDRewind( input_thread_t * p_input )
{
return( -1 );
}

View File

@ -2,7 +2,7 @@
* 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>
*
@ -62,44 +62,23 @@
* 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.
* OpenDVD: open libdvdplay
*****************************************************************************/
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
*****************************************************************************/
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;
@ -118,6 +97,11 @@ static int dvdplay_Open( input_thread_t *p_input )
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 )
@ -208,13 +192,12 @@ static int dvdplay_Open( input_thread_t *p_input )
}
/*****************************************************************************
* 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 );

View File

@ -2,7 +2,7 @@
* 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>
*
@ -56,36 +56,14 @@
/*****************************************************************************
* 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 * );
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.
* InitDVD: initializes dvdplay structures
*****************************************************************************/
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
*/
/*****************************************************************************
* dvdplay_Init: 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;
@ -97,6 +75,9 @@ static int dvdplay_Init( input_thread_t * p_input )
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 );
@ -112,10 +93,11 @@ static int dvdplay_Init( input_thread_t * 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;
@ -133,9 +115,9 @@ static void dvdplay_End( input_thread_t * p_input )
}
/*****************************************************************************
* 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;
@ -188,10 +170,3 @@ static int dvdplay_Demux( input_thread_t * p_input )
return i_data_nb;
}
/*****************************************************************************
* dvdplay_Rewind : reads a stream backward
*****************************************************************************/
static int dvdplay_Rewind( input_thread_t * p_input )
{
return( -1 );
}

View File

@ -7,7 +7,7 @@
*****************************************************************************
*
* 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>
*
@ -35,32 +35,30 @@
#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

View File

@ -2,7 +2,7 @@
* 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>
*
@ -59,27 +59,15 @@ struct intf_sys_t
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 )
@ -87,6 +75,8 @@ static int intf_Open( intf_thread_t *p_intf )
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;
@ -95,19 +85,21 @@ static int intf_Open( intf_thread_t *p_intf )
}
/*****************************************************************************
* 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;

View File

@ -2,7 +2,7 @@
* 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>
*
@ -30,29 +30,24 @@
#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
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_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
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP

View File

@ -6,7 +6,7 @@
* 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>
*
@ -79,13 +79,9 @@
* 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 );
@ -96,46 +92,25 @@ static void DvdReadLauchDecoders( input_thread_t * p_input );
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 );
@ -145,13 +120,6 @@ static int DvdReadInit( input_thread_t * p_input )
return 0;
}
/*****************************************************************************
* DvdReadEnd: frees unused data
*****************************************************************************/
static void DvdReadEnd( input_thread_t * p_input )
{
}
/*****************************************************************************
* DvdReadDemux
*****************************************************************************/
@ -232,10 +200,11 @@ static int DvdReadRewind( input_thread_t * p_input )
*/
/*****************************************************************************
* 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;
@ -255,6 +224,11 @@ static int DvdReadOpen( input_thread_t *p_input )
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++;
@ -420,13 +394,12 @@ static int DvdReadOpen( input_thread_t *p_input )
}
/*****************************************************************************
* 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 );
@ -772,7 +745,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
/* 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 );
}

View File

@ -2,7 +2,7 @@
* 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>
*
@ -48,52 +48,32 @@ struct aout_sys_t
};
/*****************************************************************************
* 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 * );
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( _("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
vlc_module_begin();
set_description( _("EsounD audio module") );
set_capability( "audio output", 50 );
set_callbacks( Open, Close );
add_shortcut( "esound" );
vlc_module_end();
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
* Open: open an esd socket
*****************************************************************************/
static void aout_getfunctions( function_list_t * p_function_list )
static int Open( 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: open an esd socket
*****************************************************************************/
static int aout_Open( aout_thread_t *p_aout )
{
/* mpg123 does it this way */
int i_bits = ESD_BITS16;
int i_mode = ESD_STREAM;
@ -136,13 +116,17 @@ static int aout_Open( aout_thread_t *p_aout )
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;
@ -155,20 +139,20 @@ static int aout_SetFormat( aout_thread_t *p_aout )
}
/*****************************************************************************
* 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;
@ -199,10 +183,12 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int 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;
close( p_aout->p_sys->i_fd );
}

View File

@ -2,7 +2,7 @@
* 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>
*
@ -90,47 +90,27 @@ void g_atexit( GVoidFunc func )
/*****************************************************************************
* 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 * );
/*****************************************************************************
* Building configuration tree
* Module descriptor
*****************************************************************************/
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
vlc_module_begin();
set_description( _("Familiar Linux Gtk+ interface module") );
set_capability( "interface", 70 );
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 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 )
@ -142,14 +122,18 @@ static int intf_Open( intf_thread_t *p_intf )
/* 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 );
@ -160,14 +144,14 @@ static void intf_Close( intf_thread_t *p_intf )
}
/*****************************************************************************
* 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 */

View File

@ -2,7 +2,7 @@
* 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>
*
@ -43,17 +43,15 @@
#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 * );
@ -62,26 +60,17 @@ static void TextMode ( int i_tty );
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
@ -119,27 +108,14 @@ struct vout_sys_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 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;
@ -151,6 +127,12 @@ static int vout_Create( vout_thread_t *p_vout )
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 */
@ -240,9 +222,9 @@ static int vout_Create( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -339,21 +321,23 @@ static int vout_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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 */
@ -374,12 +358,12 @@ static void vout_Destroy( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -407,10 +391,10 @@ static int vout_Manage( vout_thread_t *p_vout )
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 );
@ -430,20 +414,12 @@ static int vout_Manage( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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 )
@ -461,7 +437,7 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
}
#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 };

View File

@ -2,7 +2,7 @@
* 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>
*
@ -49,8 +49,8 @@
/*
* 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 * );
@ -59,16 +59,7 @@ 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 \
@ -82,50 +73,47 @@ void _M( vdec_getfunctions )( function_list_t * p_function_list )
"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" );
@ -598,7 +586,7 @@ static void ffmpeg_ConvertPicture( picture_t *p_pic,
/*****************************************************************************
* 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.
*****************************************************************************/

View File

@ -2,7 +2,7 @@
* 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>
*
@ -34,36 +34,32 @@
#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
@ -78,40 +74,13 @@ struct vout_sys_t
};
/*****************************************************************************
* 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 ) );
@ -121,6 +90,12 @@ static int vout_Create( vout_thread_t *p_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_clones = config_GetInt( p_vout, "clone-count" );
@ -141,9 +116,9 @@ static int vout_Create( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -181,9 +156,9 @@ static int vout_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -196,12 +171,14 @@ static void vout_End( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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 );
@ -209,24 +186,13 @@ static void vout_Destroy( vout_thread_t *p_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;
@ -277,18 +243,6 @@ static void vout_Render( vout_thread_t *p_vout, picture_t *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 )
{
;
}
/*****************************************************************************
* RemoveAllVout: destroy all the child video output threads
*****************************************************************************/

View File

@ -2,7 +2,7 @@
* 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>
*
@ -34,12 +34,20 @@
#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")
@ -47,26 +55,15 @@ static void vout_getfunctions( function_list_t * p_function_list );
#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
@ -89,40 +86,14 @@ struct vout_sys_t
};
/*****************************************************************************
* 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 )
@ -131,13 +102,19 @@ static int vout_Create( vout_thread_t *p_vout )
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;
@ -272,9 +249,9 @@ static int vout_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -287,23 +264,25 @@ static void vout_End( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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 )
{
@ -329,13 +308,13 @@ static int vout_Manage( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -397,18 +376,6 @@ static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
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;

View File

@ -2,7 +2,7 @@
* 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>
*
@ -40,9 +40,14 @@
#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 * );
@ -52,33 +57,22 @@ static void RenderLinear ( vout_thread_t *, picture_t *, picture_t *, int );
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
@ -98,38 +92,13 @@ struct vout_sys_t
};
/*****************************************************************************
* 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 */
@ -140,6 +109,12 @@ static int vout_Create( vout_thread_t *p_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;
p_vout->p_sys->i_mode = DEINTERLACE_DISCARD;
p_vout->p_sys->b_double_rate = 0;
p_vout->p_sys->last_date = 0;
@ -193,9 +168,9 @@ static int vout_Create( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -275,9 +250,9 @@ static int vout_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -290,36 +265,27 @@ static void vout_End( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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];
@ -399,16 +365,6 @@ static void vout_Render ( vout_thread_t *p_vout, picture_t *p_pic )
}
}
/*****************************************************************************
* 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
*****************************************************************************/

View File

@ -2,7 +2,7 @@
* 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>
*
@ -39,37 +39,35 @@
#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
@ -88,41 +86,13 @@ struct vout_sys_t
};
/*****************************************************************************
* 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 */
@ -132,6 +102,13 @@ static int vout_Create( vout_thread_t *p_vout )
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" )) )
@ -189,9 +166,9 @@ static int vout_Create( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -229,9 +206,9 @@ static int vout_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -244,36 +221,27 @@ static void vout_End( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -307,18 +275,6 @@ static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
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
*****************************************************************************/

View File

@ -2,7 +2,7 @@
* 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>
*
@ -34,30 +34,24 @@
#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
@ -71,38 +65,14 @@ struct vout_sys_t
};
/*****************************************************************************
* 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 )
@ -111,13 +81,19 @@ static int vout_Create( vout_thread_t *p_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;
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;
@ -152,9 +128,9 @@ static int vout_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -167,36 +143,27 @@ static void vout_End( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -252,15 +219,3 @@ static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
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 )
{
;
}

View File

@ -2,7 +2,7 @@
* 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>
*
@ -40,37 +40,32 @@
#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
@ -86,38 +81,13 @@ struct vout_sys_t
};
/*****************************************************************************
* 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 */
@ -128,6 +98,12 @@ static int vout_Create( vout_thread_t *p_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 */
psz_method = config_GetPsz( p_vout, "transform-type" );
@ -179,9 +155,9 @@ static int vout_Create( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -227,9 +203,9 @@ static int vout_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -242,36 +218,27 @@ static void vout_End( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -417,14 +384,3 @@ static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
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 )
{
;
}

View File

@ -2,7 +2,7 @@
* 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>
*
@ -34,12 +34,19 @@
#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 " \
@ -53,27 +60,16 @@ static void vout_getfunctions( function_list_t * p_function_list );
#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
@ -96,40 +92,13 @@ struct vout_sys_t
};
/*****************************************************************************
* 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;
@ -141,6 +110,12 @@ static int vout_Create( vout_thread_t *p_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" );
@ -215,9 +190,9 @@ static int vout_Create( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -297,9 +272,9 @@ static int vout_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -312,12 +287,14 @@ static void vout_End( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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 );
@ -325,24 +302,13 @@ static void vout_Destroy( vout_thread_t *p_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;
@ -438,18 +404,6 @@ static void vout_Render( vout_thread_t *p_vout, picture_t *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 )
{
;
}
/*****************************************************************************
* RemoveAllVout: destroy all the child video output threads
*****************************************************************************/

View File

@ -2,7 +2,7 @@
* 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>
*
@ -44,61 +44,38 @@
*****************************************************************************/
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
vlc_module_begin();
set_description( _("scope effect") );
set_capability( "audio output", 0 );
set_callbacks( Open, Close );
add_shortcut( "scope" );
vlc_module_end();
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
* Open: open a scope effect plugin
*****************************************************************************/
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 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 */
@ -136,83 +113,83 @@ static int aout_Open( aout_thread_t *p_aout )
}
/* 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->p_aout = vlc_object_create( p_aout, VLC_OBJECT_AOUT );
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->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;
@ -220,7 +197,7 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *p_buffer, int i_size )
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++ )
{
@ -303,13 +280,20 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *p_buffer, int i_size )
}
/*****************************************************************************
* 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 );
}

View File

@ -2,7 +2,7 @@
* 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>
@ -36,46 +36,35 @@
#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
@ -99,29 +88,16 @@ struct vout_sys_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: 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 )
@ -138,15 +114,21 @@ int vout_Create( vout_thread_t *p_vout )
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;
@ -251,11 +233,11 @@ int vout_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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 */
@ -267,24 +249,26 @@ void vout_End( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -344,17 +328,9 @@ int vout_Manage( vout_thread_t *p_vout )
}
/*****************************************************************************
* vout_Render: displays previously rendered output
* Display: displays previously rendered output
*****************************************************************************/
void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
{
;
}
/*****************************************************************************
* vout_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;

View File

@ -2,7 +2,7 @@
* 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>
*
@ -44,39 +44,28 @@
#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
@ -93,27 +82,14 @@ struct vout_sys_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 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 )
@ -130,13 +106,19 @@ int vout_Create( vout_thread_t *p_vout )
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;
@ -187,31 +169,32 @@ int vout_Init( vout_thread_t *p_vout )
}
/*****************************************************************************
* 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;
@ -235,17 +218,9 @@ int vout_Manage( vout_thread_t *p_vout )
}
/*****************************************************************************
* vout_Render: renders previously calculated output
* Display: displays previously rendered output
*****************************************************************************/
void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
{
;
}
/*****************************************************************************
* vout_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 );

View File

@ -2,7 +2,7 @@
* 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>
*
@ -43,12 +43,11 @@
/*****************************************************************************
* 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).
@ -56,7 +55,7 @@ static gint GnomeManage ( gpointer p_data );
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.")
@ -69,38 +68,27 @@ static void ** pp_global_data = NULL;
"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
@ -146,21 +134,12 @@ void g_atexit( GVoidFunc func )
}
/*****************************************************************************
* 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 )
@ -169,6 +148,8 @@ static int intf_Open( intf_thread_t *p_intf )
return( 1 );
}
p_intf->pf_run = Run;
p_intf->p_sys->p_sub = msg_Subscribe( p_intf );
/* Initialize Gnome thread */
@ -189,10 +170,12 @@ static int intf_Open( intf_thread_t *p_intf )
}
/*****************************************************************************
* 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 );
@ -205,14 +188,14 @@ static void intf_Close( intf_thread_t *p_intf )
}
/*****************************************************************************
* 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 */
@ -327,7 +310,7 @@ static void intf_Run( intf_thread_t *p_intf )
/* 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();
@ -350,12 +333,12 @@ static void intf_Run( intf_thread_t *p_intf )
/* 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;

View File

@ -2,7 +2,7 @@
* 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>
*
@ -44,12 +44,11 @@
/*****************************************************************************
* 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).
@ -57,7 +56,7 @@ static gint GtkManage ( gpointer p_data );
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.")
@ -67,34 +66,25 @@ static void ** pp_global_data = NULL;
"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
@ -140,21 +130,12 @@ void g_atexit( GVoidFunc func )
}
/*****************************************************************************
* 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 )
@ -163,6 +144,8 @@ static int intf_Open( intf_thread_t *p_intf )
return( 1 );
}
p_intf->pf_run = Run;
p_intf->p_sys->p_sub = msg_Subscribe( p_intf );
/* Initialize Gtk+ thread */
@ -183,10 +166,12 @@ static int intf_Open( intf_thread_t *p_intf )
}
/*****************************************************************************
* 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 );
@ -199,14 +184,14 @@ static void intf_Close( intf_thread_t *p_intf )
}
/*****************************************************************************
* 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 */
@ -314,7 +299,7 @@ static void intf_Run( intf_thread_t *p_intf )
/* 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();
@ -337,12 +322,12 @@ static void intf_Run( intf_thread_t *p_intf )
/* 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;

Some files were not shown because too many files have changed in this diff Show More