完善目录结构

完善了目录结构,添加了以前的web段com组件调用的代码(在/测试目录下)(部署没有使用到)
This commit is contained in:
yanshui177
2017-05-17 20:43:16 +08:00
parent ad754709a5
commit 6dcd378738
1246 changed files with 671388 additions and 517 deletions

View File

@@ -0,0 +1,3 @@
SUBDIRS = include src
EXTRA_DIST = make_win sample

View File

@@ -0,0 +1,523 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = otherlibs/cvcam
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in TODO
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/autotools/aclocal/az_python.m4 \
$(top_srcdir)/autotools/aclocal/pkg.m4 \
$(top_srcdir)/autotools/aclocal/swig_complete.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/autotools/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/cvconfig.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-exec-recursive install-info-recursive \
install-recursive installcheck-recursive installdirs-recursive \
pdf-recursive ps-recursive uninstall-info-recursive \
uninstall-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BUILD_APPS_FALSE = @BUILD_APPS_FALSE@
BUILD_APPS_TRUE = @BUILD_APPS_TRUE@
BUILD_DC1394_FALSE = @BUILD_DC1394_FALSE@
BUILD_DC1394_TRUE = @BUILD_DC1394_TRUE@
BUILD_FFMPEG_FALSE = @BUILD_FFMPEG_FALSE@
BUILD_FFMPEG_TRUE = @BUILD_FFMPEG_TRUE@
BUILD_PYTHON_WRAPPERS_FALSE = @BUILD_PYTHON_WRAPPERS_FALSE@
BUILD_PYTHON_WRAPPERS_TRUE = @BUILD_PYTHON_WRAPPERS_TRUE@
BUILD_QUICKTIME_FALSE = @BUILD_QUICKTIME_FALSE@
BUILD_QUICKTIME_TRUE = @BUILD_QUICKTIME_TRUE@
BUILD_V4L_FALSE = @BUILD_V4L_FALSE@
BUILD_V4L_TRUE = @BUILD_V4L_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEBUG = @DEBUG@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FFMPEGLIBS = @FFMPEGLIBS@
GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
GTHREAD_LIBS = @GTHREAD_LIBS@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
IEEE1394LIBS = @IEEE1394LIBS@
IMAGELIBS = @IMAGELIBS@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_VERSION = @LT_VERSION@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MMAJOR = @MMAJOR@
MMINOR = @MMINOR@
MSUBMINOR = @MSUBMINOR@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PYTHON = @PYTHON@
PYTHON_CSPEC = @PYTHON_CSPEC@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LSPEC = @PYTHON_LSPEC@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
QUICKTIME_CFLAGS = @QUICKTIME_CFLAGS@
QUICKTIME_LIBS = @QUICKTIME_LIBS@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SWIG = @SWIG@
SWIG_PYTHON_LIBS = @SWIG_PYTHON_LIBS@
SWIG_PYTHON_OPT = @SWIG_PYTHON_OPT@
SWIG_RUNTIME_LIBS_DIR = @SWIG_RUNTIME_LIBS_DIR@
SWIG_VERSION = @SWIG_VERSION@
UPDATE_SWIG_WRAPPERS_FALSE = @UPDATE_SWIG_WRAPPERS_FALSE@
UPDATE_SWIG_WRAPPERS_TRUE = @UPDATE_SWIG_WRAPPERS_TRUE@
VERSION = @VERSION@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
SUBDIRS = include src
EXTRA_DIST = make_win sample
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign otherlibs/cvcam/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign otherlibs/cvcam/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(mkdir_p) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool \
distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
info: info-recursive
info-am:
install-data-am:
install-exec-am:
install-info: install-info-recursive
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
clean clean-generic clean-libtool clean-recursive ctags \
ctags-recursive distclean distclean-generic distclean-libtool \
distclean-recursive distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-exec install-exec-am install-info \
install-info-am install-man install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic maintainer-clean-recursive \
mostlyclean mostlyclean-generic mostlyclean-libtool \
mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -0,0 +1,2 @@
libhighguiincludedir = $(includedir)/opencv
libhighguiinclude_HEADERS = cvcam.h

View File

@@ -0,0 +1,444 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = otherlibs/cvcam/include
DIST_COMMON = $(libhighguiinclude_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/autotools/aclocal/az_python.m4 \
$(top_srcdir)/autotools/aclocal/pkg.m4 \
$(top_srcdir)/autotools/aclocal/swig_complete.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/autotools/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/cvconfig.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(libhighguiincludedir)"
libhighguiincludeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(libhighguiinclude_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BUILD_APPS_FALSE = @BUILD_APPS_FALSE@
BUILD_APPS_TRUE = @BUILD_APPS_TRUE@
BUILD_DC1394_FALSE = @BUILD_DC1394_FALSE@
BUILD_DC1394_TRUE = @BUILD_DC1394_TRUE@
BUILD_FFMPEG_FALSE = @BUILD_FFMPEG_FALSE@
BUILD_FFMPEG_TRUE = @BUILD_FFMPEG_TRUE@
BUILD_PYTHON_WRAPPERS_FALSE = @BUILD_PYTHON_WRAPPERS_FALSE@
BUILD_PYTHON_WRAPPERS_TRUE = @BUILD_PYTHON_WRAPPERS_TRUE@
BUILD_QUICKTIME_FALSE = @BUILD_QUICKTIME_FALSE@
BUILD_QUICKTIME_TRUE = @BUILD_QUICKTIME_TRUE@
BUILD_V4L_FALSE = @BUILD_V4L_FALSE@
BUILD_V4L_TRUE = @BUILD_V4L_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEBUG = @DEBUG@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FFMPEGLIBS = @FFMPEGLIBS@
GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
GTHREAD_LIBS = @GTHREAD_LIBS@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
IEEE1394LIBS = @IEEE1394LIBS@
IMAGELIBS = @IMAGELIBS@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_VERSION = @LT_VERSION@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MMAJOR = @MMAJOR@
MMINOR = @MMINOR@
MSUBMINOR = @MSUBMINOR@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PYTHON = @PYTHON@
PYTHON_CSPEC = @PYTHON_CSPEC@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LSPEC = @PYTHON_LSPEC@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
QUICKTIME_CFLAGS = @QUICKTIME_CFLAGS@
QUICKTIME_LIBS = @QUICKTIME_LIBS@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SWIG = @SWIG@
SWIG_PYTHON_LIBS = @SWIG_PYTHON_LIBS@
SWIG_PYTHON_OPT = @SWIG_PYTHON_OPT@
SWIG_RUNTIME_LIBS_DIR = @SWIG_RUNTIME_LIBS_DIR@
SWIG_VERSION = @SWIG_VERSION@
UPDATE_SWIG_WRAPPERS_FALSE = @UPDATE_SWIG_WRAPPERS_FALSE@
UPDATE_SWIG_WRAPPERS_TRUE = @UPDATE_SWIG_WRAPPERS_TRUE@
VERSION = @VERSION@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
libhighguiincludedir = $(includedir)/opencv
libhighguiinclude_HEADERS = cvcam.h
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign otherlibs/cvcam/include/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign otherlibs/cvcam/include/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-libhighguiincludeHEADERS: $(libhighguiinclude_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(libhighguiincludedir)" || $(mkdir_p) "$(DESTDIR)$(libhighguiincludedir)"
@list='$(libhighguiinclude_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(libhighguiincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(libhighguiincludedir)/$$f'"; \
$(libhighguiincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(libhighguiincludedir)/$$f"; \
done
uninstall-libhighguiincludeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(libhighguiinclude_HEADERS)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(libhighguiincludedir)/$$f'"; \
rm -f "$(DESTDIR)$(libhighguiincludedir)/$$f"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(libhighguiincludedir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-libhighguiincludeHEADERS
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-libhighguiincludeHEADERS
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool ctags distclean distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-exec install-exec-am install-info \
install-info-am install-libhighguiincludeHEADERS install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-info-am \
uninstall-libhighguiincludeHEADERS
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -0,0 +1,196 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __CVCAM_H__
#define __CVCAM_H__
#ifdef __cplusplus
#define CVCAM_EXTERN_C extern "C"
extern "C" {
#else
#define CVCAM_EXTERN_C
#endif /* __cplusplus */
#ifdef CVCAM_EXPORTS
#define CVCAM_API CVCAM_EXTERN_C __declspec(dllexport)
#else
#define CVCAM_API CVCAM_EXTERN_C
#endif /* CVCAM_DLLEXPORT */
/* Returns the actual number of currently available cameras */
CVCAM_API int cvcamGetCamerasCount();
/* get/set the property of the camera. returns 0 if the property is not supported */
CVCAM_API int cvcamGetProperty(int camera, const char* property, void* value);
CVCAM_API int cvcamSetProperty(int camera, const char* property, void* value);
/* gets all property names. the actual number of properties is returned. */
CVCAM_API int cvcamGetPropertiesList(int camera, const char** properties, int count);
CVCAM_API int cvcamBuildStereo(void);
/* Prepares the currently enabled cameras for work */
CVCAM_API int cvcamInit(void);
/* Start the video */
CVCAM_API int cvcamStart(void);
/* Stop the video */
CVCAM_API int cvcamStop(void);
/* Pause the video; should be used for preventing data changes during frame reading
using "frame" and other properties */
CVCAM_API int cvcamPause(void);
/* Resume the video */
CVCAM_API int cvcamResume(void);
/* Frees all resources */
CVCAM_API int cvcamExit(void);
/*Pops up a camera(s) selection dialog
Return value - number of cameras selected (0,1 or 2);
Argument: an array of selected cameras numbers
NULL if none selected. Should be released with free() when not needed.
if NULL passed, not used.
*/
CVCAM_API int cvcamSelectCamera(int** out);
/*Plays a specified avi file into a specified window
if file is NULL, file browser is opened. if window is 0,
it is created. width and height mean output size's 0 means
those of avi file are used. __cdecl (*callback)(IplImage*) would be
called on every frame. NULL means no callback*/
CVCAM_API int cvcamPlayAVI(const char* file,
void* window,
int width,
int height,
void* callback);
/*Advanced API for dealing with AVI files*/
typedef unsigned int cvcamAVIFILE;
/*Opens a given file or pops up a dialog if file is NULL
returns a handle to the file opened for success or -1 for failure*/
CVCAM_API cvcamAVIFILE cvcamAVIOpenFile(char* file);
/*The next functions just do what they say and return 0
for success, anything other for failure*/
CVCAM_API int cvcamAVICloseFile(cvcamAVIFILE file);
CVCAM_API int cvcamAVISetWindow(cvcamAVIFILE file, void* window);
CVCAM_API int cvcamAVISetCallback(cvcamAVIFILE file, void* callback);
CVCAM_API int cvcamAVISetSize(cvcamAVIFILE file, int width, int height);
CVCAM_API int cvcamAVIRun(cvcamAVIFILE file);
CVCAM_API int cvcamAVIStop(cvcamAVIFILE file);
CVCAM_API int cvcamAVIPause(cvcamAVIFILE file);
CVCAM_API int cvcamAVIResume(cvcamAVIFILE file);
CVCAM_API int cvcamAVIWaitCompletion(cvcamAVIFILE file);
CVCAM_API int cvcamAVIIsRunning(cvcamAVIFILE file);
static const char CVCAM_PROP_ENABLE[] = "enable";
static const char CVCAM_PROP_RENDER[] = "render";
static const char CVCAM_PROP_WINDOW[] = "window";
static const char CVCAM_PROP_CALLBACK[] = "callback";
static const char CVCAM_DESCRIPTION[] = "description";
static const char CVCAM_VIDEOFORMAT[] = "video_pp";
static const char CVCAM_CAMERAPROPS[] = "camera_pp";
static const char CVCAM_RNDWIDTH[] = "rendering_width";
static const char CVCAM_RNDHEIGHT[] = "rendering_height";
static const char CVCAM_SRCWIDTH[] = "source_width";
static const char CVCAM_SRCHEIGHT[] = "source_height";
static const char CVCAM_STEREO_CALLBACK[] = "stereo_callback";
static const char CVCAM_STEREO3_CALLBACK[] = "stereo3_callback";
static const char CVCAM_STEREO4_CALLBACK[] = "stereo4_callback";
static const char CVCAM_PROP_SETFORMAT[] = "set_video_format";
static const char CVCAM_PROP_RAW[] = "raw_image";
static const char CVCAM_PROP_TIME_FORMAT[] = "time_format";
static const char CVCAM_PROP_DURATION[] = "duration";
static const char CVCAM_PROP_POSITION[] = "current_position";
extern const int FRAMES_FORMAT ;
extern const int TIME_FORMAT ;
typedef struct
{
char DeviceDescription[100];
char device[100];
int channel;
char ChannelDescription[100];
int maxwidth;
int maxheight;
int minwidth;
int minheight;
}CameraDescription;
typedef struct
{
int width;
int height;
double framerate;
}VidFormat;
#define CVCAMTRUE (void*)1
#define CVCAMFALSE (void*)0
typedef int cvcamWindow;
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif //__CVCAM_H__

View File

@@ -0,0 +1,109 @@
# Microsoft Developer Studio Project File - Name="cvcamdemo" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=cvcamdemo - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "cvcamdemo.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "cvcamdemo.mak" CFG="cvcamdemo - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "cvcamdemo - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "cvcamdemo - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "cvcamdemo - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../_temp/cvcamdemo_Release"
# PROP Intermediate_Dir "../../../_temp/cvcamdemo_Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
F90=df.exe
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\cv\include" /I "..\..\..\cxcore\include" /I "..\..\highgui" /I "..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x419 /d "NDEBUG"
# ADD RSC /l 0x419 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 cv.lib cxcore.lib highgui.lib cvcam.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../../../bin/cvcamdemo.exe" /libpath:"../../../lib"
!ELSEIF "$(CFG)" == "cvcamdemo - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../_temp/cvcamdemo_Debug"
# PROP Intermediate_Dir "../../../_temp/cvcamdemo_Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
F90=df.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\cv\include" /I "..\..\..\cxcore\include" /I "..\..\highgui" /I "..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x419 /d "_DEBUG"
# ADD RSC /l 0x419 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 cvd.lib cxcored.lib highguid.lib cvcamd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /entry:"mainCRTStartup" /subsystem:windows /debug /machine:I386 /out:"../../../bin/cvcamdemod.exe" /pdbtype:sept /libpath:"../../../lib"
# SUBTRACT LINK32 /pdb:none
!ENDIF
# Begin Target
# Name "cvcamdemo - Win32 Release"
# Name "cvcamdemo - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\vidformat_sample.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\demo.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,70 @@
#include "cvcam.h"
#include "highgui.h"
/**************************************************************************\
How to set video resolution programatically
\**************************************************************************/
void callback(IplImage* image)
{
}
#if 1
int ShowCamVideo(HWND hwnd, int width, int height)
{
VidFormat vidFmt={ width, height, 30.0};
int ncams = cvcamGetCamerasCount( );
cvcamSetProperty(0, CVCAM_PROP_ENABLE, CVCAMTRUE);
cvcamSetProperty(0, CVCAM_PROP_CALLBACK,callback);
cvcamSetProperty(0, CVCAM_PROP_WINDOW, &hwnd);
//Set Video Format Property
cvcamSetProperty( 0, CVCAM_PROP_SETFORMAT, &vidFmt);
if( !cvcamInit() )
return 0;
cvcamStart();
return 1;
}
int main( int argc, char** argv )
{
cvNamedWindow("cvcam window", CV_WINDOW_AUTOSIZE);
if( ShowCamVideo((HWND)cvGetWindowHandle("cvcam window"), 640, 480) )
{
cvWaitKey(0);
cvcamStop();
}
cvcamExit();
}
#else
/**************************************************************************\
How To Play Media file by CvCam
\**************************************************************************/
void ShowAVIVideo(char* filename, HWND hwnd, int width, int height)
{
cvcamAVIFILE f = cvcamAVIOpenFile(filename);
if( (int)f < 0 )
return;
cvcamAVISetWindow (f, hwnd);
cvcamAVISetCallback(f, callback);
cvcamAVISetSize(f, width, height);
cvcamAVIRun(f);
cvcamAVIWaitCompletion(f);
cvcamAVIStop(f);
cvcamAVICloseFile(f);
}
int main( int argc, char** argv )
{
if( argc > 1 )
{
cvNamedWindow("avi window", CV_WINDOW_AUTOSIZE);
ShowAVIVideo( argv[1], (HWND)cvGetWindowHandle("avi window"), 320, 240);
}
}
#endif

View File

@@ -0,0 +1,523 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = otherlibs/cvcam/src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/autotools/aclocal/az_python.m4 \
$(top_srcdir)/autotools/aclocal/pkg.m4 \
$(top_srcdir)/autotools/aclocal/swig_complete.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/autotools/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/cvconfig.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-exec-recursive install-info-recursive \
install-recursive installcheck-recursive installdirs-recursive \
pdf-recursive ps-recursive uninstall-info-recursive \
uninstall-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BUILD_APPS_FALSE = @BUILD_APPS_FALSE@
BUILD_APPS_TRUE = @BUILD_APPS_TRUE@
BUILD_DC1394_FALSE = @BUILD_DC1394_FALSE@
BUILD_DC1394_TRUE = @BUILD_DC1394_TRUE@
BUILD_FFMPEG_FALSE = @BUILD_FFMPEG_FALSE@
BUILD_FFMPEG_TRUE = @BUILD_FFMPEG_TRUE@
BUILD_PYTHON_WRAPPERS_FALSE = @BUILD_PYTHON_WRAPPERS_FALSE@
BUILD_PYTHON_WRAPPERS_TRUE = @BUILD_PYTHON_WRAPPERS_TRUE@
BUILD_QUICKTIME_FALSE = @BUILD_QUICKTIME_FALSE@
BUILD_QUICKTIME_TRUE = @BUILD_QUICKTIME_TRUE@
BUILD_V4L_FALSE = @BUILD_V4L_FALSE@
BUILD_V4L_TRUE = @BUILD_V4L_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEBUG = @DEBUG@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FFMPEGLIBS = @FFMPEGLIBS@
GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
GTHREAD_LIBS = @GTHREAD_LIBS@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
IEEE1394LIBS = @IEEE1394LIBS@
IMAGELIBS = @IMAGELIBS@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_VERSION = @LT_VERSION@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MMAJOR = @MMAJOR@
MMINOR = @MMINOR@
MSUBMINOR = @MSUBMINOR@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PYTHON = @PYTHON@
PYTHON_CSPEC = @PYTHON_CSPEC@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LSPEC = @PYTHON_LSPEC@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
QUICKTIME_CFLAGS = @QUICKTIME_CFLAGS@
QUICKTIME_LIBS = @QUICKTIME_LIBS@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SWIG = @SWIG@
SWIG_PYTHON_LIBS = @SWIG_PYTHON_LIBS@
SWIG_PYTHON_OPT = @SWIG_PYTHON_OPT@
SWIG_RUNTIME_LIBS_DIR = @SWIG_RUNTIME_LIBS_DIR@
SWIG_VERSION = @SWIG_VERSION@
UPDATE_SWIG_WRAPPERS_FALSE = @UPDATE_SWIG_WRAPPERS_FALSE@
UPDATE_SWIG_WRAPPERS_TRUE = @UPDATE_SWIG_WRAPPERS_TRUE@
VERSION = @VERSION@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
SUBDIRS = unix
EXTRA_DIST = windows
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign otherlibs/cvcam/src/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign otherlibs/cvcam/src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(mkdir_p) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool \
distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
info: info-recursive
info-am:
install-data-am:
install-exec-am:
install-info: install-info-recursive
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
clean clean-generic clean-libtool clean-recursive ctags \
ctags-recursive distclean distclean-generic distclean-libtool \
distclean-recursive distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-exec install-exec-am install-info \
install-info-am install-man install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic maintainer-clean-recursive \
mostlyclean mostlyclean-generic mostlyclean-libtool \
mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -0,0 +1,35 @@
lib_LTLIBRARIES = libcvcam.la
libcvcam_la_SOURCES = convert.cpp cvvideo.cpp dialogs.cpp render.cpp
EXTRA_DIST =
SOMAJOR = @MMAJOR@
SOMINOR = @MMINOR@
SOSUBMINOR = @MSUBMINOR@
# here you should add all header files, which contains the functionality
# of your shared lib (published for the users)
include_HEADERS =
# here you should add all header files, which shouldn
noinst_HEADERS = convert.h cvvidtypes.h dialogs.h icvvideo.h render.h videodev.h
libcvcam_la_LDFLAGS = -no-undefined -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) @LDFLAGS@ $(X_LIBS) -L../../../highgui/.libs -L../../../../cv/src/.libs
# add here the libraries which have to be include
# for building the shared lib
#
# please consider also the usage of the make environment variables
# like
# $(LIB_KDEUI), $(LIB_QT), $(LIB_HTML), etc.
# instead of the hardcoded entries, which have placed
# in here.
# The following line is only a suggestion!
#
libcvcam_la_LIBADD = -lX11 -lXext -lXaw
INCLUDES = $(all_includes) -I../../include -I../../../../cv/include -I../../../highgui
AM_CXXFLAGS = @CXXFLAGS@ @DEBUG@ -D_XOPEN_SOURCE=500

View File

@@ -0,0 +1,556 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../../../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = otherlibs/cvcam/src/unix
DIST_COMMON = $(include_HEADERS) $(noinst_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/autotools/aclocal/az_python.m4 \
$(top_srcdir)/autotools/aclocal/pkg.m4 \
$(top_srcdir)/autotools/aclocal/swig_complete.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/autotools/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/cvconfig.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
libcvcam_la_DEPENDENCIES =
am_libcvcam_la_OBJECTS = convert.lo cvvideo.lo dialogs.lo render.lo
libcvcam_la_OBJECTS = $(am_libcvcam_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp
am__depfiles_maybe = depfiles
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libcvcam_la_SOURCES)
DIST_SOURCES = $(libcvcam_la_SOURCES)
includeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(include_HEADERS) $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BUILD_APPS_FALSE = @BUILD_APPS_FALSE@
BUILD_APPS_TRUE = @BUILD_APPS_TRUE@
BUILD_DC1394_FALSE = @BUILD_DC1394_FALSE@
BUILD_DC1394_TRUE = @BUILD_DC1394_TRUE@
BUILD_FFMPEG_FALSE = @BUILD_FFMPEG_FALSE@
BUILD_FFMPEG_TRUE = @BUILD_FFMPEG_TRUE@
BUILD_PYTHON_WRAPPERS_FALSE = @BUILD_PYTHON_WRAPPERS_FALSE@
BUILD_PYTHON_WRAPPERS_TRUE = @BUILD_PYTHON_WRAPPERS_TRUE@
BUILD_QUICKTIME_FALSE = @BUILD_QUICKTIME_FALSE@
BUILD_QUICKTIME_TRUE = @BUILD_QUICKTIME_TRUE@
BUILD_V4L_FALSE = @BUILD_V4L_FALSE@
BUILD_V4L_TRUE = @BUILD_V4L_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEBUG = @DEBUG@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FFMPEGLIBS = @FFMPEGLIBS@
GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
GTHREAD_LIBS = @GTHREAD_LIBS@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
IEEE1394LIBS = @IEEE1394LIBS@
IMAGELIBS = @IMAGELIBS@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_VERSION = @LT_VERSION@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MMAJOR = @MMAJOR@
MMINOR = @MMINOR@
MSUBMINOR = @MSUBMINOR@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PYTHON = @PYTHON@
PYTHON_CSPEC = @PYTHON_CSPEC@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_LSPEC = @PYTHON_LSPEC@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
QUICKTIME_CFLAGS = @QUICKTIME_CFLAGS@
QUICKTIME_LIBS = @QUICKTIME_LIBS@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SWIG = @SWIG@
SWIG_PYTHON_LIBS = @SWIG_PYTHON_LIBS@
SWIG_PYTHON_OPT = @SWIG_PYTHON_OPT@
SWIG_RUNTIME_LIBS_DIR = @SWIG_RUNTIME_LIBS_DIR@
SWIG_VERSION = @SWIG_VERSION@
UPDATE_SWIG_WRAPPERS_FALSE = @UPDATE_SWIG_WRAPPERS_FALSE@
UPDATE_SWIG_WRAPPERS_TRUE = @UPDATE_SWIG_WRAPPERS_TRUE@
VERSION = @VERSION@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
lib_LTLIBRARIES = libcvcam.la
libcvcam_la_SOURCES = convert.cpp cvvideo.cpp dialogs.cpp render.cpp
EXTRA_DIST =
SOMAJOR = @MMAJOR@
SOMINOR = @MMINOR@
SOSUBMINOR = @MSUBMINOR@
# here you should add all header files, which contains the functionality
# of your shared lib (published for the users)
include_HEADERS =
# here you should add all header files, which shouldn
noinst_HEADERS = convert.h cvvidtypes.h dialogs.h icvvideo.h render.h videodev.h
libcvcam_la_LDFLAGS = -no-undefined -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) @LDFLAGS@ $(X_LIBS) -L../../../highgui/.libs -L../../../../cv/src/.libs
# add here the libraries which have to be include
# for building the shared lib
#
# please consider also the usage of the make environment variables
# like
# $(LIB_KDEUI), $(LIB_QT), $(LIB_HTML), etc.
# instead of the hardcoded entries, which have placed
# in here.
# The following line is only a suggestion!
#
libcvcam_la_LIBADD = -lX11 -lXext -lXaw
INCLUDES = $(all_includes) -I../../include -I../../../../cv/include -I../../../highgui
AM_CXXFLAGS = @CXXFLAGS@ @DEBUG@ -D_XOPEN_SOURCE=500
all: all-am
.SUFFIXES:
.SUFFIXES: .cpp .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign otherlibs/cvcam/src/unix/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign otherlibs/cvcam/src/unix/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
done
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libcvcam.la: $(libcvcam_la_OBJECTS) $(libcvcam_la_DEPENDENCIES)
$(CXXLINK) -rpath $(libdir) $(libcvcam_la_LDFLAGS) $(libcvcam_la_OBJECTS) $(libcvcam_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvvideo.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dialogs.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/render.Plo@am__quote@
.cpp.o:
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
.cpp.obj:
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.cpp.lo:
@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
@list='$(include_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
$(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
done
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(include_HEADERS)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
rm -f "$(DESTDIR)$(includedir)/$$f"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-includeHEADERS
install-exec-am: install-libLTLIBRARIES
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-includeHEADERS uninstall-info-am \
uninstall-libLTLIBRARIES
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-exec \
install-exec-am install-includeHEADERS install-info \
install-info-am install-libLTLIBRARIES install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags uninstall uninstall-am \
uninstall-includeHEADERS uninstall-info-am \
uninstall-libLTLIBRARIES
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -0,0 +1,177 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include "convert.h"
#include <assert.h>
#include <string.h>
#define Assert assert
/* converting image from depths 8, 24, 32 to 8, 16, 24, 32 */
void icvvConvert( int w, int h, int src_s, int src_d, char* src,
int dst_s, int dst_d, char* dst )
{
int x;
int y;
int x3;
unsigned short val;
unsigned short v1;
unsigned short v2;
unsigned short v3;
Assert( w > 0 );
Assert( h > 0 );
Assert( src_s >= w * src_d / 8 );
Assert( dst_s >= w * dst_d / 8 );
Assert( src );
Assert( dst );
switch(src_d)
{
case 8:
switch(dst_d)
{
case 8:
for( y = 0; y < h; y++, src += src_s, dst+= dst_s )
memcpy( dst, src, w );
break;
case 16:
for( y = 0; y < h; y++, src += src_s, dst += dst_s )
for( x = 0; x < w; x++ )
{
val = (unsigned char)src[x];
*(unsigned short*)(dst + x * 2) = ((val & ~3) << 3) +
(val >> 3) +
((val & ~7) << 8);
}
break;
case 24:
for( y = 0; y < h; y++, src += src_s, dst += dst_s )
for( x = 0, x3 = 0; x < w; x++, x3 += 3 )
dst[x3] = dst[x3 + 1] = dst[x3 + 2] = src[x];
break;
case 32:
for( y = 0; y < h; y++, src += src_s, dst += dst_s )
for( x = 0; x < w; x++ )
{
dst[x * 4] = dst[x * 4 + 1] = dst[x * 4 + 2] = src[x];
dst[x * 4 + 3] = 0;
}
break;
}
break;
case 24:
switch(dst_d)
{
case 8:
for( y = 0; y < h; y++, src += src_s, dst+= dst_s )
for( x = 0, x3 = 0; x < w; x++, x3 += 3 )
dst[x] = (src[x3] + src[x3 + 1] + src[x3 + 2]) / 3;
break;
case 16:
for( y = 0; y < h; y++, src += src_s, dst += dst_s )
for( x = 0, x3 = 0; x < w; x++, x3 += 3 )
{
v1 = (unsigned char)src[x3];
v2 = (unsigned char)src[x3 + 1];
v3 = (unsigned char)src[x3 + 2];
((unsigned short*)(dst))[x] = (v1 >> 3) +
((v2 & ~3) << 3) +
((v3 & ~7) << 8);
}
break;
case 24:
for( y = 0; y < h; y++, src += src_s, dst+= dst_s )
memcpy( dst, src, w * 3 );
break;
case 32:
for( y = 0; y < h; y++, src += src_s, dst += dst_s )
for( x = 0, x3 = 0; x < w; x++, x3 += 3 )
{
dst[x * 4] = src[x3];
dst[x * 4 + 1] = src[x3 + 1];
dst[x * 4 + 2] = src[x3 + 2];
dst[x * 4 + 3] = 0;
}
break;
}
break;
case 32:
switch(dst_d)
{
case 8:
for( y = 0; y < h; y++, src += src_s, dst+= dst_s )
for( x = 0; x < w; x++ )
dst[x] = (src[x * 4] + src[x * 4 + 1] + src[x * 4 + 2]) / 3;
break;
case 16:
for( y = 0; y < h; y++, src += src_s, dst += dst_s )
for( x = 0; x < w; x++ )
{
v1 = (unsigned char)src[x * 4];
v2 = (unsigned char)src[x * 4 + 1];
v3 = (unsigned char)src[x * 4 + 2];
((unsigned short*)(dst))[x] = (v1 >> 3) + ((v2 & ~3) << 3) + ((v3 & ~7) << 8);
}
break;
case 24:
for( y = 0; y < h; y++, src += src_s, dst += dst_s )
for( x = 0, x3 = 0; x < w; x++, x3 += 3 )
{
dst[x3] = src[x * 4];
dst[x3 + 1] = src[x * 4 + 1];
dst[x3 + 2] = src[x * 4 + 2];
}
break;
case 32:
for( y = 0; y < h; y++, src += src_s, dst+= dst_s )
memcpy( dst, src, w * 4 );
break;
}
break;
default:
return;
}
}

View File

@@ -0,0 +1,54 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifdef __cplusplus
extern "C" {
#endif
/* converting image from depths 8, 24, 32 to 8, 16, 24, 32 */
void icvvConvert( int w, int h, int src_s, int src_d, char* src,
int dst_s, int dst_d, char* dst );
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,70 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __CVVID_TYPES_H__
#define __CVVID_TYPES_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "cv.h"
#include "videodev.h"
typedef struct
{
int width;
int height;
struct video_picture picture;
}VideoFormat;
#ifdef __cplusplus
}
#endif
#endif //__CVVID_TYPES_H__

View File

@@ -0,0 +1,610 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include <tcl.h>
#include <tk.h>
#include <pthread.h>
#include <stdio.h>
#include <assert.h>
#include "dialogs.h"
#include "cvcam.h"
#include "cvvidtypes.h"
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
#include <X11/Xaw/Paned.h>
#include <X11/Xaw/Scrollbar.h>
#include <X11/Xaw/Label.h>
#include <X11/Xaw/Toggle.h>
#include <stdlib.h>
#include "highgui.h"
////////////////////////////////////////////////////////////////////////////////
extern Widget cvvTopLevelWidget;
static int select_res = 1;
static int select_format = 0;
typedef struct
{
__u16* value;
Widget w;
} Tracker;
typedef struct
{
int n;
VideoFormat vf;
CameraDescription descr;
Tracker br;
Tracker con;
Tracker col;
Tracker hue;
int min_w;
int min_h;
int mid_w;
int mid_h;
int max_w;
int max_h;
Widget dialog;
Widget paned;
Widget label_res;
Widget paned_res;
Widget label_format;
Widget paned_format;
Widget res_min;
Widget res_middle;
Widget res_max;
Widget format_24;
Widget format_32;
Widget format_yuv420p;
Widget label_brightness;
Widget label_contrast;
Widget label_color;
Widget label_hue;
Widget brightness_w;
Widget contrast_w;
Widget color_w;
Widget hue_w;
Widget br_w;
Widget con_w;
Widget col_w;
Widget h_w;
Widget buttons;
Widget b_ok;
Widget b_apply;
Widget b_cancel;
} VideoWidget;
typedef struct
{
int n;
CameraDescription descr;
int enable;
int render;
Widget dialog;
Widget label;
Widget paned;
Widget enable_w;
Widget render_w;
Widget buttons;
Widget b_ok;
Widget b_apply;
Widget b_cancel;
} CameraWidget;
static void updatevalues(VideoWidget *vf);
static void on_apply( Widget w, VideoWidget* data )
{
cvcamSetProperty(data->n, "set_video_format", &data->vf);
XtVaSetValues( w, XtNstate, False, 0 );
updatevalues(data);
}
static void on_cancel( Widget w, VideoWidget* data )
{
XtDestroyWidget( data->dialog );
free( data );
}
static void on_ok( Widget w, VideoWidget* data )
{
on_apply( w, data );
on_cancel( w, data );
}
static void on_track( Widget w, Tracker* data, float* percent )
{
char s[100];
__u16 value = (__u16)(*percent * 0xFFFF);
*(data->value) = value;
sprintf( s, "%d", value );
XtVaSetValues( data->w, XtNlabel, s, 0 );
}
static void set_float( Widget w, char* name, float value )
{
Arg args[1];
if (sizeof(float) > sizeof(XtArgVal))
XtSetArg(args[0], name, &value);
else
{
union {
XtArgVal xt;
float fp;
} foo;
foo.fp = value;
XtSetArg(args[0], name, foo.xt);
}
XtSetValues(w,args,1);
}
static void on_24( Widget w, VideoWidget* v )
{
int state = 1;
XtVaGetValues( w, XtNstate, &state, 0 );
if( !state )
return;
v->vf.picture.palette = VIDEO_PALETTE_RGB24;
}
static void on_32( Widget w, VideoWidget* v )
{
int state = 1;
XtVaGetValues( w, XtNstate, &state, 0 );
if( !state )
return;
v->vf.picture.palette = VIDEO_PALETTE_RGB32;
}
static void on_yuv420p( Widget w, VideoWidget* v )
{
int state = 1;
XtVaGetValues( w, XtNstate, &state, 0 );
if( !state )
return;
v->vf.picture.palette = VIDEO_PALETTE_YUV420P;
}
static void on_min( Widget w, VideoWidget* v )
{
int state = 1;
XtVaGetValues( w, XtNstate, &state, 0 );
if( !state )
return;
v->vf.width = v->min_w;
v->vf.height = v->min_h;
}
static void on_mid( Widget w, VideoWidget* v )
{
int state = 1;
XtVaGetValues( w, XtNstate, &state, 0 );
if( !state )
return;
v->vf.width = v->mid_w;
v->vf.height = v->mid_h;
}
static void on_max( Widget w, VideoWidget* v )
{
int state = 1;
XtVaGetValues( w, XtNstate, &state, 0 );
if( !state )
return;
v->vf.width = v->max_w;
v->vf.height = v->max_h;
}
static void updatevalues(VideoWidget *vf)
{
int camera = vf->n;
float percent;
cvcamGetProperty(camera, "set_video_format", &vf->vf);
if( vf->vf.width == vf->descr.minwidth )
XtVaSetValues( vf->res_min, XtNstate, True, 0 );
else if( vf->vf.width == vf->descr.maxwidth )
XtVaSetValues( vf->res_max, XtNstate, True, 0 );
else
XtVaSetValues( vf->res_middle, XtNstate, True, 0 );
switch( vf->vf.picture.palette )
{
case VIDEO_PALETTE_RGB24:
XtVaSetValues( vf->format_24, XtNstate, True, 0 );
break;
case VIDEO_PALETTE_RGB32:
XtVaSetValues( vf->format_32, XtNstate, True, 0 );
break;
case VIDEO_PALETTE_YUV420P:
XtVaSetValues( vf->format_yuv420p, XtNstate, True, 0 );
break;
default:
XtDestroyWidget( vf->dialog );
free( vf );
printf( "supported only RGB24, RGB32 & YUV420P formats\n" );
return;
}
set_float( vf->br_w, XtNtopOfThumb, (float)vf->vf.picture.brightness / 0xFFFF );
percent = (float)vf->vf.picture.brightness / 0xFFFF;
vf->br.value = &vf->vf.picture.brightness;
on_track(vf->br_w, &vf->br, &percent );
set_float( vf->con_w, XtNtopOfThumb, (float)vf->vf.picture.contrast / 0xFFFF );
percent = (float)vf->vf.picture.contrast / 0xFFFF;
vf->con.value = &vf->vf.picture.contrast;
on_track(vf->con_w, &vf->con, &percent );
set_float( vf->col_w, XtNtopOfThumb, (float)vf->vf.picture.colour / 0xFFFF );
percent = (float)vf->vf.picture.colour / 0xFFFF;
vf->col.value = &vf->vf.picture.colour;
on_track(vf->col_w, &vf->col, &percent );
set_float( vf->h_w, XtNtopOfThumb, (float)vf->vf.picture.hue / 0xFFFF );
percent = (float)vf->vf.picture.hue / 0xFFFF;
vf->hue.value = &vf->vf.picture.hue;
on_track(vf->h_w, &vf->hue, &percent );
}
void icvVideoVideoPPDialog(int camera)
{
char title[100];
VideoWidget* vf = (VideoWidget*)malloc( sizeof(*vf) );
vf->n = camera;
cvcamGetProperty(camera, "description", &vf->descr);
snprintf( title, 100, "%s, %s (%s): Video format", vf->descr.device, vf->descr.DeviceDescription, vf->descr.ChannelDescription );
// snprintf( title, 100, "%d", camera);
cvvInitSystem(0, 0);
/* Creating main dialog window */
vf->dialog = XtVaAppCreateShell( title, "video", topLevelShellWidgetClass,
XtDisplay( /*(void*)*/cvvTopLevelWidget ),
XtNminWidth, 10, XtNminHeight, 10,
XtNinput, 1, 0 );
/* Creating main paned window... It will parent for all smaller elements */
vf->paned = XtVaCreateManagedWidget( "CvVisual_paned", panedWidgetClass, vf->dialog,
0 );
/* Resolution elements */
vf->label_res = XtVaCreateManagedWidget( "resolution", labelWidgetClass, vf->paned,
XtNshowGrip, False,
XtNlabel, "camera resolution",
XtNjustify, XtJustifyCenter, 0 );
vf->paned_res = XtVaCreateManagedWidget( "resolution_res", panedWidgetClass, vf->paned,
XtNshowGrip, False,
XtNorientation, XtorientHorizontal,
0 );
sprintf( title, "%dx%d", vf->descr.minwidth, vf->descr.minheight );
vf->res_min = XtVaCreateManagedWidget( "res min", toggleWidgetClass, vf->paned_res,
XtNlabel, title,
XtNshowGrip, False,
XtNradioData, &select_res,
0 );
XtAddCallback( vf->res_min, "callback", (XtCallbackProc)on_min, vf );
vf->min_w = vf->descr.minwidth;
vf->min_h = vf->descr.minheight;
vf->res_middle = XtVaCreateManagedWidget( "res middle", toggleWidgetClass, vf->paned_res,
XtNlabel, "320x240",
XtNshowGrip, False,
XtNradioData, &select_res,
XtNradioGroup, vf->res_min,
0 );
XtAddCallback( vf->res_middle, "callback", (XtCallbackProc)on_mid, vf );
vf->mid_w = 320;
vf->mid_h = 240;
sprintf( title, "%dx%d", vf->descr.maxwidth, vf->descr.maxheight );
vf->res_max = XtVaCreateManagedWidget( "res max", toggleWidgetClass, vf->paned_res,
XtNlabel, title,
XtNshowGrip, False,
XtNradioData, &select_res,
XtNradioGroup, vf->res_min,
0 );
XtAddCallback( vf->res_max, "callback", (XtCallbackProc)on_max, vf );
vf->max_w = vf->descr.maxwidth;
vf->max_h = vf->descr.maxheight;
/* Video format elements */
vf->label_format = XtVaCreateManagedWidget( "format", labelWidgetClass, vf->paned,
XtNshowGrip, False,
XtNlabel, "data format",
XtNjustify, XtJustifyCenter, 0 );
vf->paned_format = XtVaCreateManagedWidget( "format", panedWidgetClass, vf->paned,
XtNshowGrip, False,
XtNorientation, XtorientHorizontal,
0 );
vf->format_24 = XtVaCreateManagedWidget( "bpp24", toggleWidgetClass, vf->paned_format,
XtNlabel, "RGB24",
XtNshowGrip, False,
XtNradioData, &select_format,
0 );
XtAddCallback( vf->format_24, "callback", (XtCallbackProc)on_24, vf );
vf->format_32 = XtVaCreateManagedWidget( "bpp32", toggleWidgetClass, vf->paned_format,
XtNlabel, "RGB32",
XtNshowGrip, False,
XtNradioData, &select_format,
XtNradioGroup, vf->format_24,
0 );
XtAddCallback( vf->format_32, "callback", (XtCallbackProc)on_32, vf );
vf->format_yuv420p = XtVaCreateManagedWidget( "yuv420p", toggleWidgetClass, vf->paned_format,
XtNlabel, "YUV420P",
XtNshowGrip, False,
XtNradioData, &select_format,
XtNradioGroup, vf->format_24,
0 );
XtAddCallback( vf->format_yuv420p, "callback", (XtCallbackProc)on_yuv420p, vf );
/* Brightness, contrast, color & hue elements */
/* brightness */
vf->label_brightness = XtVaCreateManagedWidget( "brigthness", labelWidgetClass, vf->paned,
XtNshowGrip, False,
XtNlabel, "brigthness",
XtNjustify, XtJustifyCenter, 0 );
vf->brightness_w = XtVaCreateManagedWidget( "brigthness", labelWidgetClass, vf->paned,
XtNshowGrip, False,
XtNjustify, XtJustifyCenter, 0 );
vf->br.w = vf->brightness_w;
vf->br_w = XtVaCreateManagedWidget( "br", scrollbarWidgetClass, vf->paned,
XtNshowGrip, False,
XtNorientation, XtorientHorizontal, 0 );
XtAddCallback( vf->br_w, "jumpProc", (XtCallbackProc)on_track, &vf->br );
/* contrast */
vf->label_contrast = XtVaCreateManagedWidget( "contrast", labelWidgetClass, vf->paned,
XtNshowGrip, False,
XtNlabel, "contrast",
XtNjustify, XtJustifyCenter, 0 );
vf->contrast_w = XtVaCreateManagedWidget( "brigthness", labelWidgetClass, vf->paned,
XtNshowGrip, False,
XtNjustify, XtJustifyCenter, 0 );
vf->con.w = vf->contrast_w;
vf->con_w = XtVaCreateManagedWidget( "con", scrollbarWidgetClass, vf->paned,
XtNshowGrip, False,
XtNorientation, XtorientHorizontal, 0 );
XtAddCallback( vf->con_w, "jumpProc", (XtCallbackProc)on_track, &vf->con );
/* colour */
vf->label_color = XtVaCreateManagedWidget( "color", labelWidgetClass, vf->paned,
XtNshowGrip, False,
XtNlabel, "color",
XtNjustify, XtJustifyCenter, 0 );
vf->color_w = XtVaCreateManagedWidget( "brigthness", labelWidgetClass, vf->paned,
XtNshowGrip, False,
XtNjustify, XtJustifyCenter, 0 );
vf->col.w = vf->color_w;
vf->col_w = XtVaCreateManagedWidget( "col", scrollbarWidgetClass, vf->paned,
XtNshowGrip, False,
XtNorientation, XtorientHorizontal, 0 );
XtAddCallback( vf->col_w, "jumpProc", (XtCallbackProc)on_track, &vf->col );
/* hue */
vf->label_hue = XtVaCreateManagedWidget( "hue", labelWidgetClass, vf->paned,
XtNshowGrip, False,
XtNlabel, "hue",
XtNjustify, XtJustifyCenter, 0 );
vf->hue_w = XtVaCreateManagedWidget( "brigthness", labelWidgetClass, vf->paned,
XtNshowGrip, False,
XtNjustify, XtJustifyCenter, 0 );
vf->hue.w = vf->hue_w;
vf->h_w = XtVaCreateManagedWidget( "h", scrollbarWidgetClass, vf->paned,
XtNshowGrip, False,
XtNorientation, XtorientHorizontal, 0 );
XtAddCallback( vf->h_w, "jumpProc", (XtCallbackProc)on_track, &vf->hue );
updatevalues(vf);
/* Buttons */
vf->buttons = XtVaCreateManagedWidget( "buttons", panedWidgetClass, vf->paned,
XtNshowGrip, False,
XtNorientation, XtorientHorizontal,
0 );
vf->b_ok = XtVaCreateManagedWidget( "b_ok", toggleWidgetClass, vf->buttons,
XtNlabel, "Ok",
XtNshowGrip, False,
XtNstate, False,
0 );
XtAddCallback( vf->b_ok, XtNcallback, (XtCallbackProc)on_ok, (void*)vf );
vf->b_apply = XtVaCreateManagedWidget( "b_apply", toggleWidgetClass, vf->buttons,
XtNlabel, "Apply",
XtNshowGrip, False,
XtNstate, False,
0 );
XtAddCallback( vf->b_apply, XtNcallback, (XtCallbackProc)on_apply, (void*)vf );
vf->b_cancel = XtVaCreateManagedWidget( "b_cancel", toggleWidgetClass, vf->buttons,
XtNlabel, "Cancel",
XtNshowGrip, False,
XtNstate, False,
0 );
XtAddCallback( vf->b_cancel, XtNcallback, (XtCallbackProc)on_cancel, (void*)vf );
vf->n = camera;
XtRealizeWidget( vf->dialog );
{
/* fixating window size */
int width = 10;
int height = 10;
XtVaGetValues( vf->dialog, XtNwidth, &width, XtNheight, &height, 0 );
XtVaSetValues( vf->dialog, XtNminWidth, width, XtNminHeight, height,
XtNmaxWidth, width, XtNmaxHeight, height, 0 );
}
}
////////////////////////////////////////////////////////////////////////////////
static void on_enable( Widget w, CameraWidget* data )
{
int status = 1;
XtVaGetValues( w, XtNstate, &status, 0 );
data->enable = status;
}
static void on_render( Widget w, CameraWidget* data )
{
int status = 1;
XtVaGetValues( w, XtNstate, &status, 0 );
data->render = status;
}
static void on_cam_apply( Widget w, CameraWidget* data )
{
cvcamSetProperty( data->n, "enable", &data->enable );
cvcamSetProperty( data->n, "render", &data->render );
XtVaSetValues( w, XtNstate, False, 0 );
}
static void on_cam_cancel( Widget w, CameraWidget* data )
{
XtDestroyWidget( data->dialog );
free( data );
}
static void on_cam_ok( Widget w, CameraWidget* data )
{
on_cam_apply( w, data );
on_cam_cancel( w, data );
}
void icvVideoCameraPPDialog(int camera)
{
int res;
char title[100];
CameraWidget* vf = (CameraWidget*)malloc( sizeof(*vf) );
cvcamGetProperty(camera, "description", &vf->descr);
snprintf( title, 100, "%s, %s (%s): Camera options", vf->descr.device, vf->descr.DeviceDescription, vf->descr.ChannelDescription );
cvvInitSystem(0, 0);
/* Creating main dialog window */
vf->dialog = XtVaAppCreateShell( title, "camera", topLevelShellWidgetClass,
XtDisplay( cvvTopLevelWidget ),
XtNminWidth, 10, XtNminHeight, 10,
XtNinput, 1, 0 );
/* Creating main paned window... It will parent for all smaller elements */
vf->paned = XtVaCreateManagedWidget( "CvCamera_paned", panedWidgetClass, vf->dialog,
0 );
/* Resolution elements */
sprintf( title, "%s on %s", vf->descr.DeviceDescription, vf->descr.device );
vf->label = XtVaCreateManagedWidget( "desriprion", labelWidgetClass, vf->paned,
XtNshowGrip, False,
XtNlabel, title,
XtNjustify, XtJustifyCenter, 0 );
cvcamGetProperty(camera, "enable", &res);
vf->enable_w = XtVaCreateManagedWidget( "enable", toggleWidgetClass, vf->paned,
XtNlabel, "enable",
XtNshowGrip, False,
XtNradioData, &select_res,
XtNstate, res,
0 );
XtAddCallback( vf->enable_w, "callback", (XtCallbackProc)on_enable, vf );
cvcamGetProperty(camera, "render", &res);
vf->render_w = XtVaCreateManagedWidget( "render", toggleWidgetClass, vf->paned,
XtNlabel, "render",
XtNshowGrip, False,
XtNradioData, &select_res,
XtNstate, res,
0 );
XtAddCallback( vf->render_w, "callback", (XtCallbackProc)on_render, vf );
/* Buttons */
vf->buttons = XtVaCreateManagedWidget( "buttons", panedWidgetClass, vf->paned,
XtNshowGrip, False,
XtNorientation, XtorientHorizontal,
0 );
vf->b_ok = XtVaCreateManagedWidget( "b_ok", toggleWidgetClass, vf->buttons,
XtNlabel, "Ok",
XtNshowGrip, False,
XtNstate, False,
0 );
XtAddCallback( vf->b_ok, XtNcallback, (XtCallbackProc)on_cam_ok, (void*)vf );
vf->b_apply = XtVaCreateManagedWidget( "b_apply", toggleWidgetClass, vf->buttons,
XtNlabel, "Apply",
XtNshowGrip, False,
XtNstate, False,
0 );
XtAddCallback( vf->b_apply, XtNcallback, (XtCallbackProc)on_cam_apply, (void*)vf );
vf->b_cancel = XtVaCreateManagedWidget( "b_cancel", toggleWidgetClass, vf->buttons,
XtNlabel, "Cancel",
XtNshowGrip, False,
XtNstate, False,
0 );
XtAddCallback( vf->b_cancel, XtNcallback, (XtCallbackProc)on_cam_cancel, (void*)vf );
XtRealizeWidget( vf->dialog );
vf->n = camera;
{
/* fixating window size */
int width = 10;
int height = 10;
XtVaGetValues( vf->dialog, XtNwidth, &width, XtNheight, &height, 0 );
XtVaSetValues( vf->dialog, XtNminWidth, width, XtNminHeight, height,
XtNmaxWidth, width, XtNmaxHeight, height, 0 );
}
}

View File

@@ -0,0 +1,66 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __DIALOGS_H__
#define __DIALOGS_H__
#ifdef __cplusplus
extern "C" {
#endif
/*starts the dialog in a new thread*/
void icvVideoCameraPPDialog(int camera);
/*starts the dialog in a new thread*/
void icvVideoVideoPPDialog (int camera);
/*the real dialog*/
void _icvVideoCameraPPDialog(void* arg);
/*the real dialog*/
void _icvVideoVideoPPDialog (void* arg);
#ifdef __cplusplus
}
#endif
#endif //__DIALOGS_H__

View File

@@ -0,0 +1,130 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __ICVVIDEO_H__
#define __ICVVIDEO_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "cvcam.h"
#include "cvvidtypes.h"
#include "cv.h"
#include "pthread.h"
#include "X11/Xlib.h"
/* main video cycle for single camera*/
void* icvVideoCaptureProc(void* arg);
int icvVideoPauseCamera(int camera);
int icvVideoResumeCamera(int camera);
int icvVideoInit(int CurrentCamera);
int icvVideoStart(int camera);
int icvVideoStop(int camera);
/* returns depth in bits, 0 for unsupported formats */
int icvVideoFormat2Depth(int format);
/* Initializes most fields of CvVideoCamera struct */
int icvVideoSetDefaultValues(int camera, int device, int channel,
struct video_capability VidCap);
#define IF_GETTING_PROPERTY(someproperty) if(!strcmp(someproperty,property))
#define IF_SETTING_PROPERTY(someproperty) if(!strcmp(someproperty,property))
#define CAPTURING 0
#define STOPPING 1
#define FINISHED 2
#define READY 3
#define STARTING 4
typedef struct
{
int device;
int channel;
pthread_mutex_t ioctlmutex; /* protects access to the unix device for that camera */
int enabled;
int rendered;
int initialised;
int paused;
pthread_mutex_t pausemutex; /* to pause acquisition */
pthread_mutex_t capturestatemutex; /* protects the capturestate and renderstate fields (used in capture, main and render threads) */
pthread_cond_t capturestatecond;
volatile int capturestate; /* State of main loop for camera can be CAPTURING,
STOPPING, FINISHED or READY */
volatile int renderstate; /*non zero if rendering loop exists*/
void (*callback)(IplImage* frame);
CameraDescription description;
VideoFormat videopp;
struct video_mmap vid_mmap;
struct video_mbuf mbuf;
char* memorymap;
__u16 imagepalette; /* output image palette */
pthread_rwlock_t *framelock; /* protect each frame (1 rwlock per frame)*/
pthread_mutex_t lastframemutex; /* protects frame number */
volatile int lastframe;
pthread_cond_t updatedcond;
pthread_mutex_t updatedmutex;
int updated;
pthread_t thread;
Window window;
int renderwidth;
int renderheight;
}CvVideoCamera;
#ifdef __cplusplus
}
#endif
#endif //__ICVVIDEO_H__

View File

@@ -0,0 +1,390 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include "render.h"
#include "convert.h"
#include <pthread.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#define RENDER_FRAMERATE 1
#define Assert(exp) \
if( !(exp) ) \
{ \
printf("Assertion: %s %s: %d\n", #exp, __FILE__, __LINE__);\
assert(exp); \
}
static void icvvResizeImage( int src_w, int src_h, int src_s, char* src,
int dst_w, int dst_h, int dst_s, char* dst,
int depth )
{
int x, y;
int* x_array = (int*)malloc(sizeof(int) * dst_w);
int* y_array = (int*)malloc(sizeof(int) * dst_h);
float x_step = (float)(src_w - 1) / (dst_w - 1);
float y_step = (float)(src_h - 1) / (dst_h - 1);
char* _src;
Assert( src );
Assert( dst );
Assert( src_w > 0 && src_h > 0 && src_s >= src_w * depth / 8 );
Assert( dst_w > 0 && dst_h > 0 && dst_s >= dst_w * depth / 8 );
if( src_w == dst_w && src_h == dst_h && src_s == dst_s )
{
memcpy( dst, src, src_s * src_h );
return;
}
for( x = 0; x < dst_w; x++ )
x_array[x] = (int)(x_step * x + 0.5);
for( y = 0; y < dst_h; y++ )
y_array[y] = (int)(y_step * y + 0.5);
Assert(x_array[dst_w - 1] == src_w - 1);
Assert(y_array[dst_h - 1] == src_h - 1);
switch( depth )
{
case 8:
for( y = 0; y < dst_h; y++, dst += dst_s )
{
_src = src + y_array[y] * src_s;
for( x = 0; x < dst_w; x++ )
{
int offset = x_array[x];
dst[x] = _src[offset];
}
}
break;
case 16:
for( y = 0; y < dst_h; y++, dst += dst_s )
{
_src = src + y_array[y] * src_s;
for( x = 0; x < dst_w; x++ )
{
int offset = x_array[x];
((short*)dst)[x] = ((short*)_src)[offset];
}
}
break;
case 24:
for( y = 0; y < dst_h; y++, dst += dst_s )
{
_src = src + y_array[y] * src_s;
for( x = 0; x < dst_w; x++ )
{
int offset = x_array[x] * 3;
dst[x * 3] = _src[offset];
dst[x * 3 + 1] = _src[offset + 1];
dst[x * 3 + 2] = _src[offset + 2];
}
}
break;
case 32:
for( y = 0; y < dst_h; y++, dst += dst_s )
{
_src = src + y_array[y] * src_s;
for( x = 0; x < dst_w; x++ )
{
int offset = x_array[x];
((int*)dst)[x] = ((int*)_src)[offset];
}
}
break;
}
free(x_array);
free(y_array);
}
int icvVideoRenderStart(int cameraid)
{
pthread_t thread;
if( !cameras[cameraid].rendered)
return 0;
if( !cameras[cameraid].window)
return 0;
if(pthread_create(&thread, NULL, icvVideoRender, (void*)cameraid))
{
fprintf(stderr, "icvVideoRenderStart: failed create thread for rendering");
return 0;
}
return 1;
}
////////////////////////////////////////////////////////////////////////////////
void* icvVideoRender(void* data)
{
int cameraid = (int)data;
CvVideoCamera *const camera = &(cameras[cameraid]);
Display* display;
int screen_num;
GC gc;
char* display_name = NULL;
Window window = camera->window;
XWindowAttributes windowattr;
Visual* visual;
int windowdepth;
XImage* image;
XShmSegmentInfo xshmseg;
int width = (camera->renderwidth>0)?camera->renderwidth:camera->videopp.width;
int height = camera->renderheight?camera->renderheight:camera->videopp.height;
int picturedepth = camera->videopp.picture.depth;
int pixelsize;
XGCValues values;
IplImage* iplimage;
time_t start, now;
int frames = 0;
float rate = 0;
Status XShm;
uchar* imgdata = NULL;
uchar* tmpbuff = NULL;
pthread_mutex_lock(&(camera->capturestatemutex));
if(camera->capturestate != CAPTURING)
{
pthread_mutex_unlock(&(camera->capturestatemutex));
pthread_exit( NULL );
}
camera->renderstate=1;
pthread_cond_signal(&(camera->capturestatecond));
pthread_mutex_unlock(&(camera->capturestatemutex));
XInitThreads();
if ( (display=XOpenDisplay(display_name)) == NULL )
{
fprintf( stderr, "cvVideo: cannot connect to X server %s\n",
XDisplayName(display_name));
pthread_exit( NULL );
}
screen_num = DefaultScreen(display);
if (XGetWindowAttributes(display, window,
&windowattr) == 0)
{
fprintf(stderr, "icvVideoRender: failed to get window attributes.\n" );
pthread_exit(NULL);
}
if(windowattr.map_state == IsUnmapped)
{
fprintf(stderr, "icvVideoRender: window is not mapped \n" );
pthread_exit(NULL);
}
windowdepth = windowattr.depth;
visual = windowattr.visual;
pixelsize = icvVideoWindowPixelsize(windowdepth);
XShm = XShmQueryExtension(display);
if(XShm)
{
image = XShmCreateImage(display, visual, windowdepth, ZPixmap, NULL,
&xshmseg, width, height );
assert(image);
xshmseg.shmid = shmget (IPC_PRIVATE,
width*height*pixelsize, IPC_CREAT|0777);
assert(xshmseg.shmid != -1);
xshmseg.shmaddr = image->data=(char*)shmat (xshmseg.shmid, 0, 0) ;
xshmseg.readOnly = False;
XShmAttach (display, &xshmseg);
}
else
{
imgdata = (uchar*)malloc(width*height*icvVideoWindowPixelsize(windowdepth)) ;
image = XCreateImage(display, visual, windowdepth, ZPixmap, 0,
(char*)imgdata, width,
height, 8,
icvVideoWindowPixelsize(windowdepth)
*width);
assert(image);
XInitImage(image);
}
gc = XCreateGC(display,window,0, &values );
#ifdef RENDER_FRAMERATE
start = time(NULL);
#endif
pthread_mutex_lock(&(camera->capturestatemutex));
while((camera->capturestate == CAPTURING) && (camera->rendered))
{
pthread_mutex_unlock(&(camera->capturestatemutex));
pthread_mutex_lock(&(camera->updatedmutex));
while(camera->updated == 0)
pthread_cond_wait(&(camera->updatedcond), &(camera->updatedmutex));
camera->updated = 0;
pthread_mutex_unlock(&(camera->updatedmutex));
if(cvcamGetProperty(cameraid, "raw_image",&iplimage ))
{
assert(image->data);
if(camera->callback != NULL)
camera->callback(iplimage);
if((width==camera->videopp.width)&&
(height==camera->videopp.height))
{
icvvConvert(width, height, width*picturedepth/8, picturedepth,
iplimage->imageData, width*pixelsize, pixelsize*8, image->data
);
cvReleaseImage(&iplimage);
}
else
{
tmpbuff = (uchar*)malloc(camera->videopp.width*camera->videopp.height*
pixelsize) ;
icvvConvert(camera->videopp.width, camera->videopp.height,
camera->videopp.width*picturedepth/8, picturedepth,
iplimage->imageData, camera->videopp.width*pixelsize,
pixelsize*8, (char*)tmpbuff);
cvReleaseImage(&iplimage);
icvvResizeImage(camera->videopp.width,
camera->videopp.height,
(camera->videopp.width)*pixelsize, (char*)tmpbuff,
width, height,width*pixelsize, image->data, pixelsize*8);
free(tmpbuff);
}
//fprintf(stdout, "cvVideoRendering:image converted!!!!\n");
if(XShm)
{
XShmPutImage(display, window, gc,
image,0,0,0,0, width,
height, False);
}
else
{
XPutImage(display, window, gc,
image,0,0,0,0, width,
height);
}
XSync(display, False);
#ifdef RENDER_FRAMERATE
now = time(NULL);
frames++;
if (now-start)
rate = frames/(float)(now-start);
if((frames%30) == 0)
fprintf(stdout, "camera %d fps = %f\n", cameraid, rate);
#endif
}//if(cvcamGetProperty(CAMERA, "raw_image",&image ))
// stop here if we're paused
pthread_mutex_lock(&(camera->pausemutex));
pthread_mutex_unlock(&(camera->pausemutex));
pthread_mutex_lock(&(camera->capturestatemutex));
}//while (camera->state == CAPTURING && camera->rendered)
pthread_mutex_unlock(&(camera->capturestatemutex));
pthread_mutex_lock(&(camera->capturestatemutex));
#if 0
if(camera->state != CAPTURING) {
// we ended because the camera is not capturing anymore
while (camera->capturestate != FINISHED )
{
pthread_cond_wait(&(camera->capturestatecond),&(camera->capturestatemutex));
}
}
#endif
camera->renderstate=0;
pthread_cond_signal(&(camera->capturestatecond));
pthread_mutex_unlock(&(camera->capturestatemutex));
XShmDetach (display, &xshmseg);
XDestroyImage (image);
XFreeGC(display,gc);
shmdt (xshmseg.shmaddr);
shmctl (xshmseg.shmid, IPC_RMID, 0);
if(imgdata)
free(imgdata);
pthread_exit(NULL);
}
////////////////////////////////////////////////////////////////////////////////
int icvVideoWindowPixelsize(int depth)
{
switch (depth)
{
case 32:
return 4;
case 24:
return 4;
case 16:
return 2;
case 8:
return 1;
default:
return 0;
}
return 0;
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,76 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __RENDER_H__
#define __RENDER_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "icvvideo.h"
#include "cvvidtypes.h"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include<X11/extensions/XShm.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <icvvideo.h>
extern CvVideoCamera* cameras;
/*starts the rendering cycle*/
int icvVideoRenderStart(int camera);
/* rendering cycle for single camera*/
void* icvVideoRender(void* data);
/*depth in bits, returns pixelsize in bytes*/
int icvVideoWindowPixelsize(int depth);
#ifdef __cplusplus
}
#endif
#endif //__RENDER_H__

View File

@@ -0,0 +1,342 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __LINUX_VIDEODEV_H
#define __LINUX_VIDEODEV_H
#ifdef __cplusplus
extern "C" {
#endif
#include <linux/types.h>
#include <linux/version.h>
#ifdef __KERNEL__
#if LINUX_VERSION_CODE >= 0x020100
#include <linux/poll.h>
#endif
struct video_device
{
char name[32];
int type;
int hardware;
int (*open)(struct video_device *, int mode);
void (*close)(struct video_device *);
long (*read)(struct video_device *, char *, unsigned long, int noblock);
/* Do we need a write method ? */
long (*write)(struct video_device *, const char *, unsigned long, int noblock);
#if LINUX_VERSION_CODE >= 0x020100
unsigned int (*poll)(struct video_device *, struct file *, poll_table *);
#endif
int (*ioctl)(struct video_device *, unsigned int , void *);
int (*mmap)(struct video_device *, const char *, unsigned long);
int (*initialize)(struct video_device *);
void *priv; /* Used to be 'private' but that upsets C++ */
int busy;
int minor;
};
extern int videodev_init(void);
#define VIDEO_MAJOR 81
extern int video_register_device(struct video_device *, int type);
#define VFL_TYPE_GRABBER 0
#define VFL_TYPE_VBI 1
#define VFL_TYPE_RADIO 2
#define VFL_TYPE_VTX 3
extern void video_unregister_device(struct video_device *);
#endif
#define VID_TYPE_CAPTURE 1 /* Can capture */
#define VID_TYPE_TUNER 2 /* Can tune */
#define VID_TYPE_TELETEXT 4 /* Does teletext */
#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
#define VID_TYPE_CLIPPING 32 /* Can clip */
#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
#define VID_TYPE_SCALES 128 /* Scalable */
#define VID_TYPE_MONOCHROME 256 /* Monochrome only */
#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
struct video_capability
{
char name[32];
int type;
int channels; /* Num channels */
int audios; /* Num audio devices */
int maxwidth; /* Supported width */
int maxheight; /* And height */
int minwidth; /* Supported width */
int minheight; /* And height */
};
struct video_channel
{
int channel;
char name[32];
int tuners;
__u32 flags;
#define VIDEO_VC_TUNER 1 /* Channel has a tuner */
#define VIDEO_VC_AUDIO 2 /* Channel has audio */
__u16 type;
#define VIDEO_TYPE_TV 1
#define VIDEO_TYPE_CAMERA 2
__u16 norm; /* Norm set by channel */
};
struct video_tuner
{
int tuner;
char name[32];
__u32 rangelow, rangehigh; /* Tuner range */
__u32 flags;
#define VIDEO_TUNER_PAL 1
#define VIDEO_TUNER_NTSC 2
#define VIDEO_TUNER_SECAM 4
#define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */
#define VIDEO_TUNER_NORM 16 /* Tuner can set norm */
#define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */
#define VIDEO_TUNER_RDS_ON 256 /* Tuner is seeing an RDS datastream */
#define VIDEO_TUNER_MBS_ON 512 /* Tuner is seeing an MBS datastream */
__u16 mode; /* PAL/NTSC/SECAM/OTHER */
#define VIDEO_MODE_PAL 0
#define VIDEO_MODE_NTSC 1
#define VIDEO_MODE_SECAM 2
#define VIDEO_MODE_AUTO 3
__u16 signal; /* Signal strength 16bit scale */
};
struct video_picture
{
__u16 brightness;
__u16 hue;
__u16 colour;
__u16 contrast;
__u16 whiteness; /* Black and white only */
__u16 depth; /* Capture depth */
__u16 palette; /* Palette in use */
#define VIDEO_PALETTE_GREY 1 /* Linear greyscale */
#define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */
#define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */
#define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */
#define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */
#define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */
#define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */
#define VIDEO_PALETTE_YUYV 8
#define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */
#define VIDEO_PALETTE_YUV420 10
#define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */
#define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */
#define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */
#define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */
#define VIDEO_PALETTE_YUV420P 15 /* YUV 4:2:0 Planar */
#define VIDEO_PALETTE_YUV410P 16 /* YUV 4:1:0 Planar */
#define VIDEO_PALETTE_PLANAR 13 /* start of planar entries */
#define VIDEO_PALETTE_COMPONENT 7 /* start of component entries */
};
struct video_audio
{
int audio; /* Audio channel */
__u16 volume; /* If settable */
__u16 bass, treble;
__u32 flags;
#define VIDEO_AUDIO_MUTE 1
#define VIDEO_AUDIO_MUTABLE 2
#define VIDEO_AUDIO_VOLUME 4
#define VIDEO_AUDIO_BASS 8
#define VIDEO_AUDIO_TREBLE 16
char name[16];
#define VIDEO_SOUND_MONO 1
#define VIDEO_SOUND_STEREO 2
#define VIDEO_SOUND_LANG1 4
#define VIDEO_SOUND_LANG2 8
__u16 umode;
__u16 balance; /* Stereo balance */
__u16 step; /* Step actual volume uses */
};
struct video_clip
{
__s32 x,y;
__s32 width, height;
struct video_clip *next; /* For user use/driver use only */
};
struct video_window
{
__u32 x,y; /* Position of window */
__u32 width,height; /* Its size */
__u32 chromakey;
__u32 flags;
struct video_clip *clips; /* Set only */
int clipcount;
#define VIDEO_WINDOW_INTERLACE 1
#define VIDEO_CLIP_BITMAP -1
/* bitmap is 1024x625, a '1' bit represents a clipped pixel */
#define VIDEO_CLIPMAP_SIZE (128 * 625)
};
struct video_capture
{
__u32 x,y; /* Offsets into image */
__u32 width, height; /* Area to capture */
__u16 decimation; /* Decimation divder */
__u16 flags; /* Flags for capture */
#define VIDEO_CAPTURE_ODD 0 /* Temporal */
#define VIDEO_CAPTURE_EVEN 1
};
struct video_buffer
{
void *base;
int height,width;
int depth;
int bytesperline;
};
struct video_mmap
{
unsigned int frame; /* Frame (0 - n) for double buffer */
int height,width;
unsigned int format; /* should be VIDEO_PALETTE_* */
};
struct video_key
{
__u8 key[8];
__u32 flags;
};
#define VIDEO_MAX_FRAME 32
struct video_mbuf
{
int size; /* Total memory to map */
int frames; /* Frames */
int offsets[VIDEO_MAX_FRAME];
};
#define VIDEO_NO_UNIT (-1)
struct video_unit
{
int video; /* Video minor */
int vbi; /* VBI minor */
int radio; /* Radio minor */
int audio; /* Audio minor */
int teletext; /* Teletext minor */
};
#define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */
#define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */
#define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */
#define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */
#define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */
#define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */
#define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */
#define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */
#define VIDIOCGWIN _IOR('v',9, struct video_window) /* Get the video overlay window */
#define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */
#define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */
#define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */
#define VIDIOCKEY _IOR('v',13, struct video_key) /* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */
#define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */
#define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */
#define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */
#define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */
#define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */
#define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */
#define VIDIOCGMBUF _IOR('v', 20, struct video_mbuf) /* Memory map buffer info */
#define VIDIOCGUNIT _IOR('v', 21, struct video_unit) /* Get attached units */
#define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get frame buffer */
#define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set frame buffer - root only */
#define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */
#define VID_HARDWARE_BT848 1
#define VID_HARDWARE_QCAM_BW 2
#define VID_HARDWARE_PMS 3
#define VID_HARDWARE_QCAM_C 4
#define VID_HARDWARE_PSEUDO 5
#define VID_HARDWARE_SAA5249 6
#define VID_HARDWARE_AZTECH 7
#define VID_HARDWARE_SF16MI 8
#define VID_HARDWARE_RTRACK 9
#define VID_HARDWARE_ZOLTRIX 10
#define VID_HARDWARE_SAA7146 11
#define VID_HARDWARE_VIDEUM 12 /* Reserved for Winnov videum */
#define VID_HARDWARE_RTRACK2 13
#define VID_HARDWARE_PERMEDIA2 14 /* Reserved for Permedia2 */
#define VID_HARDWARE_RIVA128 15 /* Reserved for RIVA 128 */
#define VID_HARDWARE_PLANB 16 /* PowerMac motherboard video-in */
#define VID_HARDWARE_BROADWAY 17 /* Broadway project */
#define VID_HARDWARE_GEMTEK 18
#define VID_HARDWARE_TYPHOON 19
#define VID_HARDWARE_VINO 20 /* Reserved for SGI Indy Vino */
#define VID_HARDWARE_CADET 21 /* Cadet radio */
#define VID_HARDWARE_TRUST 22 /* Trust FM Radio */
/*
* Initialiser list
*/
struct video_init
{
char *name;
int (*init)(struct video_init *);
};
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,30 @@
#include <conio.h>
#include <stdio.h>
#include "cvcam.h"
#include "..\\highgui\\highgui.h"
#include "cv.h"
void __cdecl callback(void* _image)
{
IplImage* image = (IplImage*)_image;
cvLine(image, cvPoint(0, 0), cvPoint(image->width, image->height), CV_RGB(255, 0, 0), 1);
}
int main()
{
int cameras = cvcamGetCamerasCount();
if(cameras == -1)
{
printf("\nNo cameras available on the system. Exiting...");
return -1;
}
cvcamSetProperty(0, CVCAM_PROP_CALLBACK, &callback);
cvcamInit();
cvcamStart();
wait_key(0);
cvcamStop();
cvcamExit();
return 0;
}

View File

@@ -0,0 +1,126 @@
# Microsoft Developer Studio Project File - Name="cvcam" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=cvcam - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "cvcam.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "cvcam.mak" CFG="cvcam - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "cvcam - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "cvcam - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=xicl6.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "cvcam - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "..\..\..\..\_temp\cvcam_rls"
# PROP Intermediate_Dir "..\..\..\..\_temp\cvcam_rls"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
LIB32=link.exe -lib
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CVCAM_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../../cxcore/include" /I "../../include" /I "../../../highgui" /I "../../../../filters\proxytrans" /I "../../../../filters\syncfilter" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "CVCAM_EXPORTS" /FD /c
# SUBTRACT CPP /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x419 /d "NDEBUG"
# ADD RSC /l 0x419 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 cxcore.lib highgui.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib quartz.lib STRMBASE.LIB /nologo /dll /machine:I386 /nodefaultlib:"libmmd.lib" /out:"..\..\..\..\bin\cvcam100.dll" /implib:"../../../../lib/cvcam.lib" /libpath:"../../../../lib"
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "cvcam - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "..\..\..\..\_temp\cvcam_dbg"
# PROP Intermediate_Dir "..\..\..\..\_temp\cvcam_dbg"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
LIB32=link.exe -lib
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CVCAM_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../../../cxcore/include" /I "../../include" /I "../../../highgui" /I "../../../../filters\proxytrans" /I "../../../../filters\syncfilter" /D "WIN32" /D "DEBUG" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "CVCAM_EXPORTS" /FD /GZ /c
# SUBTRACT CPP /YX /Yc /Yu
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x419 /d "_DEBUG"
# ADD RSC /l 0x419 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 highguid.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib quartz.lib advapi32.lib winmm.lib STRMBASD.LIB /nologo /dll /debug /machine:I386 /nodefaultlib:"libcmtd" /nodefaultlib:"libmmdd.lib" /out:"..\..\..\..\bin\cvcam100d.dll" /implib:"..\..\..\..\lib\cvcamd.lib" /libpath:"../../../../lib"
# SUBTRACT LINK32 /pdb:none /incremental:no /nodefaultlib /force
!ENDIF
# Begin Target
# Name "cvcam - Win32 Release"
# Name "cvcam - Win32 Debug"
# Begin Group "Src"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\cvcam.cpp
# SUBTRACT CPP /YX
# End Source File
# Begin Source File
SOURCE=.\cvcam.rc
# End Source File
# Begin Source File
SOURCE=.\cvcamavi.cpp
# End Source File
# End Group
# Begin Group "Include"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\cvcam.h
# End Source File
# Begin Source File
SOURCE=.\cvcamavi.h
# End Source File
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,117 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Russian resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
#ifdef _WIN32
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#pragma code_page(1251)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // Russian resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_DIALOGBAR DIALOG DISCARDABLE 0, 0, 378, 151
STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP |
WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Select camera(s)"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "The main camera",IDC_STATIC,126,4,56,8
COMBOBOX IDC_COMBO1,19,22,326,45,CBS_DROPDOWN | WS_VSCROLL |
WS_TABSTOP
CONTROL "Second camera",IDC_CHECK1,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,17,46,70,14
COMBOBOX IDC_COMBO2,19,71,326,48,CBS_DROPDOWN | WS_DISABLED |
WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "OK",IDOK,20,98,51,21
PUSHBUTTON "Cancel",IDCANCEL,303,98,51,21
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_DIALOGBAR, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 371
TOPMARGIN, 7
BOTTOMMARGIN, 144
END
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -0,0 +1,289 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="cvcam"
ProjectGUID="{11D109B7-D9BB-4491-B100-F7A5D3B50402}"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\..\..\..\..\_temp\cvcam_rls.net"
IntermediateDirectory=".\..\..\..\..\_temp\cvcam_rls.net"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\..\..\..\..\_temp\cvcam_rls.net/cvcam.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../../../../cxcore/include;../../include;../../../highgui;../../../../filters\proxytrans;../../../../filters\syncfilter;../../../../filters\SyncFilter3"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;CVCAM_EXPORTS"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\..\..\..\..\_temp\cvcam_rls.net/cvcam.pch"
AssemblerListingLocation=".\..\..\..\..\_temp\cvcam_rls.net/"
ObjectFile=".\..\..\..\..\_temp\cvcam_rls.net/"
ProgramDataBaseFileName=".\..\..\..\..\_temp\cvcam_rls.net/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1049"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="cxcore.lib highgui.lib quartz.lib STRMBASE.LIB"
OutputFile="..\..\..\..\bin\cvcam100.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="../../../../lib"
ProgramDatabaseFile=".\..\..\..\..\_temp\cvcam_rls.net/cvcam.pdb"
ImportLibrary="../../../../lib/cvcam.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\..\..\..\..\_temp\cvcam_dbg.net"
IntermediateDirectory=".\..\..\..\..\_temp\cvcam_dbg.net"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\..\..\..\..\_temp\cvcam_dbg.net/cvcam.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../../../cxcore/include;../../include;../../../highgui;../../../../filters\proxytrans;../../../../filters\syncfilter;../../../../filters\SyncFilter3"
PreprocessorDefinitions="WIN32;DEBUG;_DEBUG;_WINDOWS;CVCAM_EXPORTS"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderFile=".\..\..\..\..\_temp\cvcam_dbg.net/cvcam.pch"
AssemblerListingLocation=".\..\..\..\..\_temp\cvcam_dbg.net/"
ObjectFile=".\..\..\..\..\_temp\cvcam_dbg.net/"
ProgramDataBaseFileName=".\..\..\..\..\_temp\cvcam_dbg.net/"
BrowseInformation="1"
BrowseInformationFile=".\..\..\..\..\_temp\cvcam_dbg.net/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1049"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
AdditionalDependencies="highguid.lib quartz.lib winmm.lib STRMBASD.LIB"
OutputFile="..\..\..\..\bin\cvcam100d.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="../../../../lib"
IgnoreDefaultLibraryNames="libcmtd"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\..\..\..\..\_temp\cvcam_dbg.net/cvcamd.pdb"
ImportLibrary="..\..\..\..\lib\cvcamd.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Src"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="cvcam.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;CVCAM_EXPORTS;$(NoInherit)"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;DEBUG;_DEBUG;_WINDOWS;_MBCS;CVCAM_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"
/>
</FileConfiguration>
</File>
<File
RelativePath="cvcam.rc"
>
</File>
<File
RelativePath="cvcamavi.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;CVCAM_EXPORTS;$(NoInherit)"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;DEBUG;_DEBUG;_WINDOWS;_MBCS;CVCAM_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Include"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\..\include\cvcam.h"
>
</File>
<File
RelativePath="cvcamavi.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,393 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#define WM_GRAPHNOTIFY WM_USER+13
#include <objbase.h>
#include <streams.h>
#include "iProxyTrans.h"
#include "ProxyTransuids.h"
#include "highgui.h"
#include "cvcamavi.h"
IPin* get_pin( IBaseFilter* pFilter, PIN_DIRECTION dir );
HWND _cvcamCreateWindow();
const int FRAMES_FORMAT = 0;
const int TIME_FORMAT = 1;
cvcamSourceFile::cvcamSourceFile(const char* file , void (*callback)(void*) ):
Iusecom(),
m_pGraph(NULL),
m_pMediaControl(NULL),
m_pEvent(NULL),
m_pVideoWindow(NULL),
m_pPin(NULL),
m_pBasicVideo(NULL),
m_pSFilter(NULL),
m_pProxyTrans(NULL),
m_pSourceOut(NULL),
m_pProxyIn(NULL),
m_pProxyOut(NULL),
m_pEnumPins(NULL),
m_pProxyBase(NULL),
m_file(),
m_pcallback(NULL),
m_width(0),
m_height(0),
IsValid(true),
m_hr(),
m_hWnd(NULL),
m_pMediaSeeking(NULL)
{
try
{
//Get the file
if (file)
{
m_file = file;
}
else
{
char path[256];
memset(path,0,256);
OPENFILENAME fn;
fn.lStructSize = sizeof(OPENFILENAME);
fn.hwndOwner = NULL;
fn.lpstrFilter = NULL;
fn.lpstrFile = path;
fn.nMaxFile = 256;
fn.lpstrFileTitle = NULL;
fn.lpstrInitialDir = NULL;
fn.lpstrTitle = NULL;
fn.Flags = NULL;
fn.lpstrDefExt = "avi";
fn.hInstance = DLLhinst;
fn.lpfnHook = NULL;
fn.lpstrCustomFilter = NULL;
fn.lCustData = NULL;
if(!GetOpenFileName(&fn))
throw 1;
m_file = path;
}//else after if(file)
// Create the filter graph manager and query for interfaces.
CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
IID_IGraphBuilder, (void **)&m_pGraph);
// Build the graph.
wchar_t wpath[256];
mbstowcs(wpath, m_file.c_str(), strlen(m_file.c_str())+1);
m_hr = m_pGraph->AddSourceFilter(wpath,L"source",&m_pSFilter);
// Create a proxy transform filter
if(FAILED(CoCreateInstance(CLSID_ProxyTransform, NULL, CLSCTX_INPROC_SERVER,
IID_IProxyTransform, (void**)&m_pProxyTrans)))
{
throw 1;
}
//set callback
m_hr = m_pProxyTrans->set_transform((void(__cdecl*)(void*))m_pcallback, 0);
//Get Source output pin
m_hr = m_pSFilter->EnumPins(&m_pEnumPins);
unsigned long fetched(0);
m_hr = m_pEnumPins->Next(1,&m_pSourceOut,&fetched);
if(!fetched)
throw 1 ;
m_pEnumPins = NULL;
//Put ProxyTrans into graph
m_hr = m_pProxyTrans->QueryInterface(IID_IBaseFilter,(void**)&m_pProxyBase);
m_hr = m_pGraph->AddFilter(m_pProxyBase.value(),L"proxy");
//Get ProxyTrans Pins
m_pProxyIn = get_pin( m_pProxyBase.value(), PINDIR_INPUT );
m_pProxyOut= get_pin( m_pProxyBase.value(), PINDIR_OUTPUT );
m_hr = m_pGraph->Connect(m_pSourceOut.value(),m_pProxyIn.value());
m_hr = m_pGraph->Render(m_pProxyOut.value());
//Gain additional interfaces
m_hr = m_pGraph->QueryInterface(IID_IMediaControl, (void **)&m_pMediaControl);
m_hr = m_pGraph->QueryInterface(IID_IMediaEventEx, (void **)&m_pEvent);
m_hr = m_pGraph->QueryInterface(IID_IVideoWindow, (void **)&m_pVideoWindow);
m_hr = m_pGraph->QueryInterface(IID_IMediaSeeking, (void**)&m_pMediaSeeking);
if(!m_pMediaControl.is_valid() ||!m_pEvent.is_valid() ||!m_pVideoWindow.is_valid())
throw 1;
}//try
catch (...)
{
IsValid = false;
return;
}//catch
}//cvcamSourceFile()
bool cvcamSourceFile::IsRunning()
{
long evCode;
HRESULT hr = m_pEvent->WaitForCompletion(0, &evCode);
if(SUCCEEDED(hr))
{
if(!evCode)
return true;
}
return false;
}
HRESULT cvcamSourceFile::SetWindow(const HWND window)
{
if(IsRunning())
return E_FAIL;
m_hWnd = window;
if (!m_hWnd)
{
m_hWnd = _cvcamCreateWindow();
}
return S_OK;
}
HRESULT cvcamSourceFile::Start()
{
try
{
if (IsRunning())
{
return NOERROR;
}
//Set up the window
m_hr = m_pVideoWindow->put_Owner((OAHWND)m_hWnd);
long flags;
m_hr = m_pEvent->SetNotifyWindow((OAHWND)m_hWnd, WM_GRAPHNOTIFY, 0);
m_hr = m_pEvent->SetNotifyFlags(0x00);
m_hr = m_pEvent->CancelDefaultHandling(EC_COMPLETE);
m_hr = m_pVideoWindow->get_WindowStyle(&flags);
m_hr = m_pVideoWindow->put_WindowStyle(flags & (~WS_CAPTION) | WS_CHILD);
m_hr = m_pVideoWindow->put_MessageDrain((OAHWND)m_hWnd);
// Get the rectangle dimensions and resize the client window
m_hr = m_pGraph->QueryInterface(IID_IBasicVideo,(void**)&m_pBasicVideo);
long left, top, w, h;
m_pBasicVideo->GetSourcePosition(&left, &top,&w,&h);
m_pBasicVideo->SetDestinationPosition(0, 0, m_width?m_width:w, m_height?m_height:h);
m_pVideoWindow->SetWindowPosition(0,0,m_width?m_width:w,m_height?m_height:h);
const char* name = cvGetWindowName(m_hWnd);
cvResizeWindow(name, m_width?m_width:w, m_height?m_height:h);
// Run the graph.
m_hr = m_pMediaControl->Run();
return S_OK;
}//try
catch(HrExeption exp)
{
return exp.hr;
}//catch
}
HRESULT cvcamSourceFile::Stop()
{
if( m_pMediaControl.is_valid() )
{
OAFilterState fs;
m_pMediaControl->GetState(0,&fs);
if(fs == State_Stopped)
return NOERROR;
m_pMediaControl->StopWhenReady();
if(m_pVideoWindow.is_valid() )
{
m_pVideoWindow->put_Visible(OAFALSE);
m_pVideoWindow->put_Owner(NULL);
m_pVideoWindow->put_MessageDrain(0);
}
}
return S_OK;
}
HRESULT cvcamSourceFile::Pause()
{
if( m_pMediaControl.is_valid() )
{
OAFilterState fs;
m_pMediaControl->GetState(0,&fs);
if(fs == State_Stopped)
return S_OK;
m_pMediaControl->Pause();
}
return S_OK;
}
HRESULT cvcamSourceFile::Resume()
{
if( m_pMediaControl.is_valid() )
{
OAFilterState fs;
m_pMediaControl->GetState(0,&fs);
if(fs == State_Stopped)
return S_OK;
m_pMediaControl->Run();
}
return S_OK;
}
HRESULT cvcamSourceFile::SetCallBack(void (__cdecl *callback)(void *))
{
if(IsRunning())
return E_FAIL;
m_pcallback = callback;
m_pProxyTrans->set_transform((void(__cdecl*)(void*))m_pcallback, 0);
return S_OK;
}
HRESULT cvcamSourceFile::SetHeight(const int height)
{
m_height = height;
return S_OK;
}
HRESULT cvcamSourceFile::SetWidth(const int width)
{
m_width = width;
return S_OK;
}
HRESULT cvcamSourceFile::WaitForCompletion()
{
long evCode;
return m_pEvent->WaitForCompletion(INFINITE, &evCode);
}
HRESULT cvcamSourceFile::SetTimeFormat(const int format)
{
if (format == FRAMES_FORMAT)
{
return m_pMediaSeeking->SetTimeFormat(&TIME_FORMAT_FRAME );
}else
if (format == TIME_FORMAT)
{
return m_pMediaSeeking->SetTimeFormat(&TIME_FORMAT_MEDIA_TIME);
}else
return E_FAIL;
}
HRESULT cvcamSourceFile::GetDuration(LONGLONG *pDuration)
{
return m_pMediaSeeking->GetDuration(pDuration);
}
HRESULT cvcamSourceFile::GetCurrentPosition(LONGLONG *pCurrent)
{
return m_pMediaSeeking->GetCurrentPosition(pCurrent);
}
HRESULT cvcamSourceFile::SetPosition(LONGLONG *pCurrent)
{
return m_pMediaSeeking->SetPositions(pCurrent,AM_SEEKING_AbsolutePositioning,NULL,
AM_SEEKING_NoPositioning);
}

View File

@@ -0,0 +1,284 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __CVCAMAVI_H__
#define __CVCAMAVI_H__
#include <string>
using namespace std ;
/////////////////////////////////////////////////////////////////////////////////////////
template <class T> class SafePointer
{
protected:
T* m_pointer;
public:
SafePointer() : m_pointer(0) {};
SafePointer(T* pointer) {m_pointer = pointer;};
SafePointer(const SafePointer& p)
{
m_pointer = p.m_pointer;
if(m_pointer)
{
m_pointer->AddRef();
}
};
~SafePointer()
{
if(m_pointer)
{
m_pointer->Release();
m_pointer = NULL;
}//if(m_pointer)
};
T* value() {return m_pointer;};
T* operator ->() {return m_pointer;};
T** operator &()
{
if(m_pointer)
{
m_pointer->Release();
m_pointer = NULL;
}//if(m_pointer)
return &m_pointer;
};
void operator =(T* pointer)
{
if(m_pointer) m_pointer->Release();
m_pointer = pointer;
};
int is_valid() {return int(m_pointer);};
};
/////////////////////////////////////////////////////////////////////////////////////////
class cvcamUseCom
{
public:
cvcamUseCom()
{
CoInitialize(0);
}
~cvcamUseCom()
{
CoUninitialize();;
}
};
/////////////////////////////////////////////////////////////////////////////////////////
class HrExeption
{
public:
HRESULT hr;
int occasion;
};
/////////////////////////////////////////////////////////////////////////////////////////
class SafeHr
{
public:
SafeHr():
m_occasion(0)
{
}
HRESULT operator=(HRESULT res)
{
++m_occasion;
if (FAILED(res))
{
HrExeption excpt;
excpt.hr = res;
excpt.occasion = m_occasion;
throw excpt;
}
return res;
}
protected:
int m_occasion;
};
/////////////////////////////////////////////////////////////////////////////////////////
class cvcamSourceFile
{
public:
HRESULT WaitForCompletion();
HRESULT SetWindow(const HWND window);
cvcamSourceFile(const char* file = NULL, void (*callback)(void*) = NULL);
//Media controlling methods
HRESULT Start();
HRESULT Stop();
HRESULT Pause();
HRESULT Resume();
//Property settings
HRESULT SetCallBack(void (*callback)(void*));
HRESULT SetWidth(const int width);
HRESULT SetHeight(const int height);
bool IsRunning();
bool IsValid;
//Seeking methods
HRESULT SetTimeFormat(const int format);
HRESULT GetDuration(LONGLONG *pDuration);
HRESULT GetCurrentPosition(LONGLONG *pCurrent);
HRESULT SetPosition(LONGLONG *pCurrent);
protected:
HWND m_hWnd;
//Initialise/Release COM
cvcamUseCom Iusecom;
//DirectShow Interfaces
SafePointer<IGraphBuilder> m_pGraph;
SafePointer<IMediaControl> m_pMediaControl;
SafePointer<IMediaEventEx> m_pEvent;
SafePointer<IVideoWindow> m_pVideoWindow;
SafePointer<IPin> m_pPin;
SafePointer<IBasicVideo> m_pBasicVideo;
SafePointer<IBaseFilter> m_pSFilter;
SafePointer<IProxyTransform> m_pProxyTrans;
SafePointer<IPin> m_pSourceOut;
SafePointer<IPin> m_pProxyIn;
SafePointer<IPin> m_pProxyOut;
SafePointer<IEnumPins> m_pEnumPins;
SafePointer<IBaseFilter> m_pProxyBase;
SafePointer<IMediaSeeking> m_pMediaSeeking;
//Data
string m_file;
void (*m_pcallback)(void*);
int m_width;
int m_height;
SafeHr m_hr;
private:
};
/////////////////////////////////////////////////////////////////////////////////////////
#define MAX_AVIS 100
#define AVIS_START 1000
typedef unsigned int uint;
class cvcamAVIs
{
public:
cvcamAVIs()
{
memset(files,0,MAX_AVIS);
};
uint AddSource( char* path, void (*callback)(void*) )
{
cvcamSourceFile* tmp = new cvcamSourceFile(path, callback);
if (!tmp)
return -1;
if(!tmp->IsValid)
return -1;
uint i=0;
while (files[i])
i++;
if(i>= MAX_AVIS)
return (uint)-1;
files[i] = tmp;
return i+AVIS_START;
}
bool ReleaseSource(uint source)
{
// source -= AVIS_START;
if (files[source])
{
delete files[source];
files[source] = NULL;
return true;
}
return false;
}
cvcamSourceFile* operator[](uint source)
{
// source -= AVIS_START;
if( source < MAX_AVIS )
return files[source];
return NULL;
}
~cvcamAVIs()
{
// for(uint i = AVIS_START; i < AVIS_START+MAX_AVIS; i++)
for(uint i = 0; i < MAX_AVIS; i++)
ReleaseSource(i);
}
protected:
cvcamSourceFile* files[MAX_AVIS];
private:
};
/////////////////////////////////////////////////////////////////////////////////////////
extern HINSTANCE DLLhinst;
#endif //__CVCAMAVI_H__

View File

@@ -0,0 +1,19 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by cvcam.rc
//
#define IDD_DIALOGBAR 103
#define IDC_COMBO1 1000
#define IDC_CHECK1 1001
#define IDC_COMBO2 1002
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1005
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif