mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-17 12:58:11 +00:00
[client] implement support for RGB24 packed data
This commit is contained in:
@@ -149,10 +149,10 @@ typedef struct KVMFRFrame
|
||||
FrameType type; // the frame data type
|
||||
uint32_t screenWidth; // the client's screen width
|
||||
uint32_t screenHeight; // the client's screen height
|
||||
uint32_t dataWidth; // the packed width of the frame data
|
||||
uint32_t dataHeight; // the packed height of the frame data
|
||||
uint32_t frameWidth; // the frame width
|
||||
uint32_t frameHeight; // the frame height
|
||||
uint32_t dataWidth; // the packed frame width
|
||||
uint32_t dataHeight; // the packed frame height
|
||||
uint32_t frameWidth; // the unpacked frame width
|
||||
uint32_t frameHeight; // the unpacked frame height
|
||||
FrameRotation rotation; // the frame rotation
|
||||
uint32_t stride; // the row stride (zero if compressed data)
|
||||
uint32_t pitch; // the row pitch (stride in bytes or the compressed frame size)
|
||||
|
@@ -44,6 +44,12 @@ typedef bool (*FrameBufferReadFn)(void * opaque, const void * src, size_t size);
|
||||
*/
|
||||
bool framebuffer_wait(const FrameBuffer * frame, size_t size);
|
||||
|
||||
/**
|
||||
* Read `size` bytes from the KVMFRFrame into the dst buffer
|
||||
*/
|
||||
bool framebuffer_read_linear(const FrameBuffer * frame, void * restrict dst,
|
||||
size_t size);
|
||||
|
||||
/**
|
||||
* Read data from the KVMFRFrame into the dst buffer
|
||||
*/
|
||||
|
@@ -28,23 +28,23 @@
|
||||
#include "common/types.h"
|
||||
|
||||
inline static void rectCopyUnaligned(uint8_t * dest, const uint8_t * src,
|
||||
int ystart, int yend, int dx, int dstStride, int srcStride, int width)
|
||||
int ystart, int yend, int dx, int dstPitch, int srcPitch, int width)
|
||||
{
|
||||
for (int i = ystart; i < yend; ++i)
|
||||
{
|
||||
unsigned int srcOffset = i * srcStride + dx;
|
||||
unsigned int dstOffset = i * dstStride + dx;
|
||||
unsigned int srcOffset = i * srcPitch + dx;
|
||||
unsigned int dstOffset = i * dstPitch + dx;
|
||||
memcpy(dest + dstOffset, src + srcOffset, width);
|
||||
}
|
||||
}
|
||||
|
||||
void rectsBufferToFramebuffer(FrameDamageRect * rects, int count, int bpp,
|
||||
FrameBuffer * frame, int dstStride, int height,
|
||||
const uint8_t * src, int srcStride);
|
||||
FrameBuffer * frame, int dstPitch, int height,
|
||||
const uint8_t * src, int srcPitch);
|
||||
|
||||
void rectsFramebufferToBuffer(FrameDamageRect * rects, int count, int bpp,
|
||||
uint8_t * dst, int dstStride, int height,
|
||||
const FrameBuffer * frame, int srcStride);
|
||||
uint8_t * dst, int dstPitch, int height,
|
||||
const FrameBuffer * frame, int srcPitch);
|
||||
|
||||
int rectsMergeOverlapping(FrameDamageRect * rects, int count);
|
||||
int rectsRejectContained(FrameDamageRect * rects, int count);
|
||||
|
@@ -55,7 +55,7 @@ typedef enum FrameType
|
||||
FRAME_TYPE_RGBA , // RGBA interleaved: R,G,B,A 32bpp
|
||||
FRAME_TYPE_RGBA10 , // RGBA interleaved: R,G,B,A 10,10,10,2 bpp
|
||||
FRAME_TYPE_RGBA16F , // RGBA interleaved: R,G,B,A 16,16,16,16 bpp float
|
||||
FRAME_TYPE_BGR , // BGR interleaved: B,G,R 24bpp
|
||||
FRAME_TYPE_BGR , // BGR (DO NOT COMMIT THIS)
|
||||
FRAME_TYPE_MAX , // sentinel value
|
||||
}
|
||||
FrameType;
|
||||
|
@@ -38,4 +38,6 @@
|
||||
#define UPCAST(type, x) \
|
||||
(type *)((uintptr_t)(x) - offsetof(type, base))
|
||||
|
||||
#define ALIGN_TO(value, align) (((value) + (align) - 1) & -(align))
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user