| 1 | /** |
| 2 | * FreeRDP: A Remote Desktop Protocol Implementation |
| 3 | * MS-RDPECAM Implementation, V4L Interface |
| 4 | * |
| 5 | * Copyright 2025 Oleg Turovski <[email protected]> |
| 6 | * |
| 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | * you may not use this file except in compliance with the License. |
| 9 | * You may obtain a copy of the License at |
| 10 | * |
| 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | * |
| 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the License for the specific language governing permissions and |
| 17 | * limitations under the License. |
| 18 | */ |
| 19 | |
| 20 | #ifndef CAMERA_V4L_H |
| 21 | #define CAMERA_V4L_H |
| 22 | |
| 23 | #include <winpr/synch.h> |
| 24 | #include <winpr/wtypes.h> |
| 25 | |
| 26 | #include "../camera.h" |
| 27 | |
| 28 | typedef struct |
| 29 | { |
| 30 | void* start; |
| 31 | size_t length; |
| 32 | |
| 33 | } CamV4lBuffer; |
| 34 | |
| 35 | typedef struct |
| 36 | { |
| 37 | CRITICAL_SECTION lock; |
| 38 | |
| 39 | /* members used to call the callback */ |
| 40 | CameraDevice* dev; |
| 41 | size_t streamIndex; |
| 42 | WINPR_ATTR_NODISCARD ICamHalSampleCapturedCallback sampleCallback; |
| 43 | |
| 44 | BOOL streaming; |
| 45 | int fd; |
| 46 | uint8_t h264UnitId; /* UVC H264 UnitId, if 0 then UVC H264 is not supported */ |
| 47 | |
| 48 | size_t nBuffers; |
| 49 | CamV4lBuffer* buffers; |
| 50 | HANDLE captureThread; |
| 51 | |
| 52 | } CamV4lStream; |
| 53 | |
| 54 | #endif /* CAMERA_V4L_H */ |