Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
vpDirectShowSampleGrabberI.h
1
/*
2
* ViSP, open source Visual Servoing Platform software.
3
* Copyright (C) 2005 - 2025 by Inria. All rights reserved.
4
*
5
* This software is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
9
* See the file LICENSE.txt at the root directory of this source
10
* distribution for additional information about the GNU GPL.
11
*
12
* For using ViSP with software that can not be combined with the GNU
13
* GPL, please contact Inria about acquiring a ViSP Professional
14
* Edition License.
15
*
16
* See https://visp.inria.fr for more information.
17
*
18
* This software was developed at:
19
* Inria Rennes - Bretagne Atlantique
20
* Campus Universitaire de Beaulieu
21
* 35042 Rennes Cedex
22
* France
23
*
24
* If you have questions regarding the use of this file, please contact
25
* Inria at visp@inria.fr
26
*
27
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29
*
30
* Description:
31
* DirectShow framegrabber callback.
32
*
33
* Authors:
34
* Bruno Renier
35
*/
36
37
#ifndef vpDirectShowSampleGrabberI_hh
38
#define vpDirectShowSampleGrabberI_hh
39
40
#ifndef DOXYGEN_SHOULD_SKIP_THIS
41
42
#include <visp3/core/vpConfig.h>
43
#if (defined(VISP_HAVE_DIRECTSHOW))
44
45
#include <dshow.h>
46
#include <qedit.h>
47
#include <stdio.h>
48
49
#include <visp3/core/vpImage.h>
50
#include <visp3/core/vpRGBa.h>
51
52
BEGIN_VISP_NAMESPACE
57
class
VISP_EXPORT vpDirectShowSampleGrabberI :
public
ISampleGrabberCB
58
{
59
vpDirectShowSampleGrabberI();
60
virtual
~vpDirectShowSampleGrabberI();
61
62
// needed by the interface
63
STDMETHODIMP_(ULONG) AddRef() {
return
1; }
64
STDMETHODIMP_(ULONG) Release() {
return
2; }
65
66
STDMETHODIMP QueryInterface(REFIID riid,
void
**ppvObject);
67
68
// not implemented
69
STDMETHODIMP SampleCB(
double
Time, IMediaSample *pSample) {
return
E_NOTIMPL; }
70
71
// our callback function
72
STDMETHODIMP BufferCB(
double
Time, BYTE *pBuffer,
long
BufferLen);
73
74
private
:
75
// the currently connected media type
76
AM_MEDIA_TYPE connectedMediaType;
77
78
// true if the source media type is not a standard one
79
bool
specialMediaType;
80
// true if the image needs to be flipped (only for special media types)
81
bool
invertedSource;
82
83
// booleans used to signal a demand from acquire
84
bool
acqGrayDemand;
85
bool
acqRGBaDemand;
86
87
// pointer on the image to fill during the next callback if there has been a
88
// demand
89
vpImage<vpRGBa> *rgbaIm;
90
vpImage<unsigned char> *grayIm;
91
92
// semaphore used to synchronize the productor (callback) and the consumer
93
// (acquire)
94
HANDLE copySem;
95
96
friend
class
vpDirectShowGrabberImpl;
97
};
98
END_VISP_NAMESPACE
99
#endif
100
#endif
101
#endif
BEGIN_VISP_NAMESPACE
Definition
vpMbtDistanceCircle.cpp:55
modules
sensor
include
visp3
sensor
vpDirectShowSampleGrabberI.h
Generated by
1.17.0