Update of /cvsroot/artoolkit/artoolkit/lib/SRC/VideoWin32DirectShow
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16534
Modified Files:
videoWin32DirectShow.cpp
Log Message:
Add support for passing XML directly in config string.
Index: videoWin32DirectShow.cpp
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/lib/SRC/VideoWin32DirectShow/videoWin32DirectShow.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** videoWin32DirectShow.cpp 22 May 2006 22:17:46 -0000 1.6
--- videoWin32DirectShow.cpp 8 Jun 2006 21:35:58 -0000 1.7
***************
*** 144,148 ****
{
AR2VideoParamT *vid = NULL;
!
// Allocate the parameters structure and fill it in.
arMalloc(vid, AR2VideoParamT, 1);
--- 144,150 ----
{
AR2VideoParamT *vid = NULL;
! char config_default[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><dsvl_input><camera show_format_dialog=\"true\" friendly_name=\"\"><pixel_format><RGB32 flip_h=\"false\" flip_v=\"true\"/></pixel_format></camera></dsvl_input>";
!
!
// Allocate the parameters structure and fill it in.
arMalloc(vid, AR2VideoParamT, 1);
***************
*** 152,157 ****
vid->graphManager = new DSVL_VideoSource();
!
! if(FAILED(vid->graphManager->BuildGraphFromXMLFile(config))) return(NULL);
if(FAILED(vid->graphManager->EnableMemoryBuffer())) return(NULL);
--- 154,166 ----
vid->graphManager = new DSVL_VideoSource();
! if (!config) {
! if(FAILED(vid->graphManager->BuildGraphFromXMLString(config_default))) return(NULL);
! } else {
! if (strncmp(config, "<?xml", 5) == 0) {
! if(FAILED(vid->graphManager->BuildGraphFromXMLString(config))) return(NULL);
! } else {
! if(FAILED(vid->graphManager->BuildGraphFromXMLFile(config))) return(NULL);
! }
! }
if(FAILED(vid->graphManager->EnableMemoryBuffer())) return(NULL);
|