YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
FakeFrameGrabber_ControlsDC1394.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025-2025 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#include "FakeFrameGrabber.h"
7
9#include <yarp/os/LogStream.h>
10
11#include <cstdio>
12#include <thread>
13#include <random>
14
15using namespace yarp::os;
16using namespace yarp::dev;
17
18struct
19{
20 unsigned int VideoModeMaskDC1394 = 10;
21 unsigned int VideoModeDC1394 = 11;
22 unsigned int fpsmask = 12;
23 unsigned int fps = 13;
24 unsigned int iso = 14;
25 unsigned int colorcoding = 15;
26 unsigned int colorcodingmask = 16;
27 bool operation = false;
28 bool transmission = false;
29 unsigned int bpp = 100;
30
32
33//namespace {
34//YARP_LOG_COMPONENT(FAKEFRAMEGRABBER, "yarp.device.fakeFrameGrabber")
35//}
36
38{
39 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
40 val = m_controlsDC1394.VideoModeMaskDC1394;
41 return ReturnValue_ok;
42}
43
45{
46 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
47 val = m_controlsDC1394.VideoModeDC1394;
48 return ReturnValue_ok;
49}
50
52{
53 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
54 m_controlsDC1394.VideoModeDC1394 = video_mode;
55 return ReturnValue_ok;
56}
57
59{
60 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
61 val = m_controlsDC1394.fpsmask;
62 return ReturnValue_ok;
63}
64
66{
67 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
68 val = m_controlsDC1394.fps;
69 return ReturnValue_ok;
70}
71
73{
74 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
76 return ReturnValue_ok;
77}
78
80{
81 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
82 val = m_controlsDC1394.iso;
83 return ReturnValue_ok;
84}
85
87{
88 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
89 m_controlsDC1394.iso = speed;
90 return ReturnValue_ok;
91}
92
94{
95 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
96 val = m_controlsDC1394.colorcodingmask;
97 return ReturnValue_ok;
98}
99
101{
102 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
103 val = m_controlsDC1394.colorcoding;
104 return ReturnValue_ok;
105}
106
108{
109 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
110 m_controlsDC1394.colorcoding = coding;
111 return ReturnValue_ok;
112}
113
114ReturnValue FakeFrameGrabber::getFormat7MaxWindowDC1394(unsigned int &xdim,unsigned int &ydim,unsigned int &xstep,unsigned int &ystep,unsigned int &xoffstep,unsigned int &yoffstep)
115{
116 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
117 return ReturnValue_ok;
118}
119
120ReturnValue FakeFrameGrabber::getFormat7WindowDC1394(unsigned int &xdim,unsigned int &ydim,int &x0,int &y0)
121{
122 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
123 return ReturnValue_ok;
124}
125
126ReturnValue FakeFrameGrabber::setFormat7WindowDC1394(unsigned int xdim,unsigned int ydim,int x0,int y0)
127{
128 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
129 return ReturnValue_ok;
130}
131
133{
134 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
135 m_controlsDC1394.operation = b1394b;
136 return ReturnValue_ok;
137}
138
140{
141 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
142 b1394 = m_controlsDC1394.operation;
143 return ReturnValue_ok;
144}
145
147{
148 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
149 m_controlsDC1394.transmission = bTxON;
150 return ReturnValue_ok;
151}
152
154{
155 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
156 bTxON = m_controlsDC1394.transmission;
157 return ReturnValue_ok;
158}
159
161{
162 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
163 return ReturnValue_ok;
164}
165
167{
168 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
169 return ReturnValue_ok;
170}
171
173{
174 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
175 return ReturnValue_ok;
176}
177
179{
180 return ReturnValue_ok;
181 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
182}
183
185{
186 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
187 return ReturnValue_ok;
188}
189
191{
192 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
193 bpp = m_controlsDC1394.bpp;
194 return ReturnValue_ok;
195}
196
198{
199 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
200 m_controlsDC1394.bpp = bpp;
201 return ReturnValue_ok;
202}
unsigned int VideoModeMaskDC1394
unsigned int colorcodingmask
unsigned int VideoModeDC1394
unsigned int fpsmask
unsigned int colorcoding
struct @91 m_controlsDC1394
#define ReturnValue_ok
Definition ReturnValue.h:80
yarp::dev::ReturnValue setResetDC1394() override
yarp::dev::ReturnValue setPowerDC1394(bool onoff) override
yarp::dev::ReturnValue getTransmissionDC1394(bool &bTxON) override
yarp::dev::ReturnValue getColorCodingDC1394(unsigned int &val) override
yarp::dev::ReturnValue setBytesPerPacketDC1394(unsigned int bpp) override
yarp::dev::ReturnValue setTransmissionDC1394(bool bTxON) override
yarp::dev::ReturnValue getISOSpeedDC1394(unsigned int &val) override
yarp::dev::ReturnValue setFPSDC1394(int fps) override
yarp::dev::ReturnValue getVideoModeDC1394(unsigned int &val) override
yarp::dev::ReturnValue setFormat7WindowDC1394(unsigned int xdim, unsigned int ydim, int x0, int y0) override
yarp::dev::ReturnValue getOperationModeDC1394(bool &b1394) override
yarp::dev::ReturnValue setDefaultsDC1394() override
yarp::dev::ReturnValue getColorCodingMaskDC1394(unsigned int video_mode, unsigned int &val) override
yarp::dev::ReturnValue setOperationModeDC1394(bool b1394b) override
yarp::dev::ReturnValue getVideoModeMaskDC1394(unsigned int &val) override
yarp::dev::ReturnValue setISOSpeedDC1394(int speed) override
yarp::dev::ReturnValue setVideoModeDC1394(int video_mode) override
yarp::dev::ReturnValue getFPSMaskDC1394(unsigned int &val) override
yarp::dev::ReturnValue getBytesPerPacketDC1394(unsigned int &bpp) override
yarp::dev::ReturnValue getFPSDC1394(unsigned int &val) override
yarp::dev::ReturnValue setCaptureDC1394(bool bON) override
yarp::dev::ReturnValue getFormat7WindowDC1394(unsigned int &xdim, unsigned int &ydim, int &x0, int &y0) override
yarp::dev::ReturnValue setBroadcastDC1394(bool onoff) override
yarp::dev::ReturnValue getFormat7MaxWindowDC1394(unsigned int &xdim, unsigned int &ydim, unsigned int &xstep, unsigned int &ystep, unsigned int &xoffstep, unsigned int &yoffstep) override
yarp::dev::ReturnValue setColorCodingDC1394(int coding) override
A mini-server for performing network communication in the background.
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.