Page 5 of 5

Re: Camera Control needed for Tablet

PostPosted: Fri Jan 12, 2018 8:17 am
by Silvio.Falconi
Antonio Linares wrote:First steps using Borland (some changes are required for MSVC)

Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   DShowCamera()

return nil

#pragma BEGINDUMP

#include <dshow.h>
#include <uuids.h>

HB_FUNC( DSHOWCAMERA )
{
   HRESULT hr;
   ICreateDevEnum *pDevEnum = NULL;
   IEnumMoniker *pEnum = NULL;
   IMoniker *pMoniker = NULL;
   IPropertyBag *pPropBag = NULL;
   IGraphBuilder *pGraph = NULL;
   ICaptureGraphBuilder2 *pBuilder = NULL;
   IBaseFilter *pCap = NULL;
   IBaseFilter *pSampleGrabberFilter = NULL;
   IBaseFilter *pNullRenderer = NULL;
   IMediaControl *pMediaControl = NULL;
   char *pBuffer = NULL;

   hr = CoInitializeEx( NULL, COINIT_MULTITHREADED );

   if( hr != S_OK )
      MessageBox( 0, "CoInitializeEx error", "ok", 0 );

   hr = CoCreateInstance( &CLSID_FilterGraph, NULL,
              CLSCTX_INPROC_SERVER, &IID_IGraphBuilder,
              ( void ** ) &pGraph );
           
   if( hr != S_OK )
      MessageBox( 0, "CoCreateInstance error", "ok", 0 );
     
   if( pGraph != NULL )
      MessageBox( 0, "pGraph seems ok", "ok", 0 );
     
    hr = CoCreateInstance( &CLSID_CaptureGraphBuilder2, NULL,
            CLSCTX_INPROC_SERVER, &IID_ICaptureGraphBuilder2,
            ( void ** ) &pBuilder );      

   if( hr != S_OK )
      MessageBox( 0, "CoCreateInstance 2 error", "ok", 0 );

   if( pBuilder != NULL )
      MessageBox( 0, "pBuilder seems ok", "ok", 0 );
}

#pragma ENDDUMP


this first release of Linares can be compiled under borland and harbour and run on win10
only there are not the command play and save

Re: Camera Control needed for Tablet

PostPosted: Mon Jan 15, 2018 11:50 am
by Silvio.Falconi