20 #ifndef FREERDP_CLIENT_CAMERA_H
21 #define FREERDP_CLIENT_CAMERA_H
28 #if defined(WITH_INPUT_FORMAT_MJPG)
29 #include <libavcodec/avcodec.h>
32 #include <libswscale/swscale.h>
33 #include <libavutil/imgutils.h>
35 #include <winpr/wlog.h>
37 #include <freerdp/api.h>
38 #include <freerdp/types.h>
40 #include <freerdp/client/channels.h>
41 #include <freerdp/channels/log.h>
42 #include <freerdp/channels/rdpecam.h>
43 #include <freerdp/codecs.h>
44 #include <freerdp/primitives.h>
46 #define ECAM_PROTO_VERSION 0x02
48 #define ECAM_DEVICE_MAX_STREAMS 1
49 #define ECAM_MAX_MEDIA_TYPE_DESCRIPTORS 256
55 #define ECAM_MAX_SAMPLE_CREDITS 8
61 #define ECAM_SAMPLE_RESPONSE_BUFFER_SIZE (1024ULL * 4050ULL)
68 IWTSListener* listener;
85 CAM_MEDIA_FORMAT inputFormat;
86 CAM_MEDIA_FORMAT outputFormat;
102 #if defined(WITH_INPUT_FORMAT_MJPG)
103 AVCodecContext* avContext;
104 AVPacket* avInputPkt;
109 struct SwsContext* sws;
115 return stream->formats.inputFormat;
119 return stream->formats.outputFormat;
124 IWTSListener* listener;
138 const char* deviceId,
const char* deviceName);
141 typedef UINT (*ICamHalSampleCapturedCallback)(
CameraDevice* dev,
int streamIndex,
142 const BYTE* sample,
size_t size);
147 (ICamHal* ihal, ICamHalEnumCallback callback,
CameraPlugin* ecam,
149 INT16(*GetMediaTypeDescriptions)
150 (ICamHal* ihal,
const char* deviceId,
int streamIndex,
155 ICamHalSampleCapturedCallback callback);
156 UINT (*StopStream)(ICamHal* ihal,
const char* deviceId,
int streamIndex);
157 UINT (*Free)(ICamHal* hal);
160 typedef UINT (*PREGISTERCAMERAHAL)(IWTSPlugin* plugin, ICamHal* hal);
165 PREGISTERCAMERAHAL pRegisterCameraHal;
180 CAM_ERROR_CODE code);
182 wStream* out, BOOL freeStream);
187 WINPR_ATTR_MALLOC(ecam_dev_destroy, 1)
193 BOOL ecam_encoder_compress(
CameraDeviceStream* stream, const BYTE* srcData,
size_t srcSize,
194 BYTE** ppDstData,
size_t* pDstSize);