summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/load_cache.c
diff options
context:
space:
mode:
authorenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-09-11 19:26:27 +0000
committerenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-09-11 19:26:27 +0000
commit7487ea601384016ed6185e9083ea3e0d1b71fa46 (patch)
tree96ae8bc30fb07f7b06372c2780eeb2671af24e02 /recordmydesktop/src/load_cache.c
parentf635b1be3ea9c3a3892936e95e9306b121d1bb5e (diff)
Started working towards a more clean include hierarchy and
distinguishable program modules. First step: move stuff from global headers that is only used in one source file to those source files. include/rmdfunc.h include/rmdmacro.h include/rmdtypes.h: Move stuff from here src/rmd_jack.c src/get_frame.c src/rmd_cache.c src/load_cache.c src/rectinsert.c src/cache_frame.c src/poll_events.c src/setbrwindow.c src/recordmydesktop.c: To here. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@508 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/load_cache.c')
-rw-r--r--recordmydesktop/src/load_cache.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/recordmydesktop/src/load_cache.c b/recordmydesktop/src/load_cache.c
index 6973770..020e90f 100644
--- a/recordmydesktop/src/load_cache.c
+++ b/recordmydesktop/src/load_cache.c
@@ -27,6 +27,43 @@
#include <recordmydesktop.h>
+
+//The number of bytes for every
+//sub-block of the y,u and v planes.
+//Since the blocks are square
+//these are obviously the squares
+//of the widths(specified above),
+//but the definitions bellow are only
+//for convenience anyway.
+#define Y_UNIT_BYTES 0x0100
+#define UV_UNIT_BYTES 0x0040
+
+#define INIT_FRAME(frame_t,fheader_t,yuv_t,\
+ YBlocks_t,UBlocks_t,VBlocks_t){\
+ (frame_t)->header=(fheader_t);\
+ (frame_t)->YBlocks=YBlocks_t;\
+ (frame_t)->UBlocks=UBlocks_t;\
+ (frame_t)->VBlocks=VBlocks_t;\
+ (frame_t)->YData=malloc((yuv_t)->y_width*(yuv_t)->y_height);\
+ (frame_t)->UData=malloc((yuv_t)->uv_width*(yuv_t)->uv_height);\
+ (frame_t)->VData=malloc((yuv_t)->uv_width*(yuv_t)->uv_height);\
+};
+
+
+//The frame after retrieval.
+//Based on the Header information
+//we can read the correct amount of bytes.
+typedef struct _CachedFrame{
+ FrameHeader *header;
+ u_int32_t *YBlocks, //identifying number on the grid,
+ *UBlocks, //starting at top left
+ *VBlocks; // >> >>
+ unsigned char *YData, //pointer to data for the blocks that have changed,
+ *UData, //which have to be remapped
+ *VData; //on the buffer when reading
+}CachedFrame;
+
+
void LoadBlock(unsigned char *dest,
unsigned char *source,
int blockno,
© All Rights Reserved