25 #ifndef __BIASVIDEOSOURCE_DSHOW_HH__
26 #define __BIASVIDEOSOURCE_DSHOW_HH__
29 #include <bias_config.h>
30 #include <Gui/StringConv.hh>
42 #include <VideoSource/VideoSource_Base.hh>
43 #include <VideoSource/VideoSourceCapabilities.hh>
44 #include <Image/Camera.hh>
57 #if !defined __MYSAMPLE_GRABBER_CB_H
58 #define __MYSAMPLE_GRABBER_CB_H
88 STDMETHODIMP
SampleCB(
double SampleTime, IMediaSample *pSample);
90 STDMETHODIMP
BufferCB(
double SampleTime, BYTE *pBuffer,
long BufferLen);
112 int GetAllDevices(std::vector<std::string> &devices);
114 int OpenDevice(
unsigned int width,
unsigned int height,
unsigned int channels,
116 int OpenDevice(
const char * device);
121 WaitForNew_=waitForNew;
123 FGCB->SetNewImageCheck(waitForNew);
128 void ResetPanTiltZoom(
void);
134 sCaptureDeviceName_ = sName;};
138 SetSize( width, height, bytesperpixel);
139 SetColorModel(model);
140 BIASColorModel_= model;
143 bool DisplayCameraProperties();
145 void DisplaySourcePinProperties();
147 bool DisplayFilterProperties( CComPtr<IBaseFilter> pFilter);
154 bool HasControlShutter();
157 int SetShutter(
float exptime);
158 void SetAutoShutter(
bool b);
159 bool GetAutoShutter();
171 bool HasControlBrightness();
173 float GetBrightness();
175 int SetBrightness(
float g);
176 void SetAutoBrightness(
bool b);
177 bool GetAutoBrightness();
180 bool HasControlContrast();
184 int SetContrast(
float g);
185 void SetAutoContrast(
bool b);
186 bool GetAutoContrast();
209 HRESULT InitVideoCapture_();
210 HRESULT GetInterfaces_(
void);
211 HRESULT FindCaptureDevice_(IBaseFilter ** ppSrcFilter);
212 HRESULT EnumFilters_(IFilterGraph *pGraph);
214 void InitCamControls_();
216 void DetermineColorModel_();
217 void DetermineBIASColorModel_();
219 void DeleteMediaType_(AM_MEDIA_TYPE *pmt);
221 bool DisplayPinProperties_( CComPtr<IPin> pSrcPin );
223 HRESULT SaveGraphFile_(IGraphBuilder *pGraph, WCHAR *wszPath);
STDMETHODIMP SampleCB(double SampleTime, IMediaSample *pSample)
EColorModel
These are the most often used color models.
CComPtr< IAMVideoProcAmp > pVideoProcControl_
bool GetCapabilitiesOnly_
Defines a common interface to different devices.
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
STDMETHODIMP BufferCB(double SampleTime, BYTE *pBuffer, long BufferLen)
CComPtr< IBaseFilter > pNullRenderer_
void SetSizeAndColorModel(int width, int height, int bytesperpixel=1, BIAS::ImageBase::EColorModel model=BIAS::ImageBase::CM_invalid)
BIAS::Camera< unsigned char > camera_
unsigned char * lastMemorySample_
CComPtr< IGraphBuilder > pGraphBuilder_
CComPtr< IAMCameraControl > pCameraControl_
CameraControl ControlExposure_
CComPtr< IBaseFilter > pSrcFilter_
CameraControl ControlTilt_
Image< unsigned char > & GetImage()
MySampleGrabberCB(int width, int height, int depth)
CComPtr< ICaptureGraphBuilder2 > pCaptureGraphBuilder2_
float GetGain()
Get gain in dB.
This class extends VideoSource for the use of DirectShow devices you need Microsoft Windows SDK versi...
void SetCaptureDeviceName(std::string sName)
void SetWaitForNew(bool waitForNew)
overwrites Base class function
BIAS::ImageBase::EColorModel BIASColorModel_
color values, 3 channels, order: red,green,blue
int SetGain(float g)
Set gain to g with g[dB].
CComPtr< ISampleGrabber > pGrabber_
CComPtr< IMediaEventEx > pMediaEvent_
BIAS::Camera< unsigned char > camera_
GUID MediaSubTypeColorModel_
unsigned char * pImageBuffer_
unsigned char * currentMemorySample_
STDMETHODIMP_(ULONG) AddRef()
CameraControl ControlBrightness_
invalid (not set) image format
Checks for VideoSource capabilities.
void SetNewImageCheck(bool check=true)
CComPtr< IPin > pSampleOutPin_
CameraControl ControlZoom_
std::string sCaptureDeviceName_
STDMETHODIMP_(ULONG) Release()
This is the base class for images in BIAS.
CameraControl ControlContrast_
CComPtr< IMediaControl > pMediaControl_
VideoSourceCapabilities Capabilities_
CameraControl ControlPan_