summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/rmd_get_frame.c
AgeCommit message (Collapse)Author
2020-07-11*: drop {gtk,qt}-recordmydesktop subdirsVito Caputo
This restores the recordmydesktop/ subdir as root from the mirror I cloned by fork from. I have no particular interest in the gtk/qt frontends and it doesn't appear they were part of a single tree in the past. But I will probably preserve backwards compatibility of the cli so they can continue to work with this fork installed.
2020-07-11*: no more enc_data->[xy]_offsetVito Caputo
With no rrect alignment adjustment happening, there's no need for this fuckery anymore. The theora encoding offsets will always be left at 0, the frame_{width, height} will clip to rrect.{width,height}, and the yuv buffer dimensions are the only thing 16x16 aligned.
2020-07-11get_frame: more unfucking synchronizatoinVito Caputo
2020-07-11get_frame: s/blocknum_[xy]/blocks_[wh]/Vito Caputo
Minor cleanup
2020-07-11get_frame: consolidate [yuv]blocks reset as a funcVito Caputo
Eliminate some pointless duplication
2020-07-11get_frame: perform shmctl(IPC_RMID) after shmat()Vito Caputo
No need to duplicate this down at the teardown, it won't go away with outstanding references so you can basically queue the rm.
2020-07-11*: introduce Image typeVito Caputo
Baby step towards encapsulating the shmem and ximage state
2020-07-11*: more random minor cleanupsVito Caputo
Nothing significant
2020-07-11*: more random cleanupsVito Caputo
minor formatting/whitespace changes
2020-07-11get_frame: replace XCreateImage++ w/XGetImageVito Caputo
Remove more pointless code
2020-07-11get_frame: remove pointless XInitImage()Vito Caputo
XCreateImage() returns a fully initialized ready-to-use XImage, I have no idea why the author did this.
2020-07-11*: more small whitespace fixupsVito Caputo
nothing functionally changed
2020-07-11get_frame: more cleanupsVito Caputo
nothing functionally changed
2020-07-11*: more random formatting cleanupsVito Caputo
nothing functionally different
2020-07-11*: more random cleanups mostly formattingVito Caputo
nothing functionally different
2020-07-11get_frame: de-macroify CLIPPY_DUMMY_POINTER_AREAVito Caputo
Zero reason for this to be an unreadable macro, make function and try format sanely I didn't really change it other than passing the clip rect instead of brwin
2020-07-11get_frame: demacroify MARK_BUFFER_AREAVito Caputo
Convert macro to function and format retained macro portion
2020-07-11get_frame: pass rect to rmdMoveCaptureAreaVito Caputo
Just simplifying this function to not need brwin-> everywhere while cleaning up the formatting
2020-07-11*: more random formatting cleanupsVito Caputo
Nothing really changed here, but I suspect the {row,column}_end + 1 conditions in rmdBlocksFromList() are buggy and shouldn't have the +1. Left as-is for now.
2020-07-11*: more random formatting cleanupsVito Caputo
some theora init error checking fixups snuck in there as well
2020-07-11*: try restore some sanity to YUV macrosVito Caputo
The public macros didn't need to be macros, so they've been turned into functions. All the big ugly YUV macro stuff that can be justified as macros has been moved to rmd_yuv_utils.c where they're privately used. They've also had a first pass at formatting them sanely...
2020-06-23*: first attempt to unfuck thread synchronizationVito Caputo
I'm already regretting this... I don't think the author understood how condition variables work, that signal/broadcast is purely synchronous with blocked waiters - they don't queue a "signaled" state. So all these cond_waits littered everywhere without any explicit stateful condition being watched, if they didn't happen to be sitting in the wait when the signal occurred, that signal event was lost, and blocking would persist until the next one. Even if the wait only *just* missed the arrival due to scheduling, it was a very racy and broken use of condition variables. Not to mention the possibility of spurious wakeups... You *always* need some shared state to use condition variables properly, it's why they include a mutex; to protect the shared state. If you're not writing a while() loop to wait on a condition variable, you're almost certainly doing it wrong. This stuff will continue to evolve as I get around to it.
2020-06-20setbrwindow: yank nbytes out of BRWindow structVito Caputo
This only gets used in one place and isn't even relevant for shmem scenarios where the size in bytes depends on the bytes per row from the server. For now I'm just moving its simple computation to where it's used, as-is. It seems to be doing some 16-byte alignment dance as well which... seems very odd. If the sizes were already getting 16-byte aligned, why do this again? I fully expect to throw the alignment shit out at some point, as this all gets reworked. The way this was done seems completely misguided... the Theora alignment considerations should be handled in the YUV buffer, since the copy needs to be made from the XImage in all cases - shmem and non, to convert to YUV, the YUV buffer should have been sized to accomodate Theora, and the RGB->YUV conversion-copy should pad out the aligned target buffer as needed.
2020-06-20get_frame: simplify rmdBRWinCpyVito Caputo
There's no need to copy all the members of the nested rects, just copy the whole structs.
2020-06-20brwin: s/.rect/.winrect/Vito Caputo
Disambiguate this member name a bit from the other .rect uses, just to make things a bit easier to search for.
2020-06-20*: just some fast and nasty reformattingVito Caputo
If I'm going to actually be modifying this program substantially and possibly maintaining some fork of it, it's gotta be formmatted how I prefer. This is by no means done or perfect, rmd_types.h in particular is quite the mess, I will be revisiting this issue...
2020-06-20get_frame: eliminate pointless pxl_data pointersVito Caputo
Just cleaning up some junk while trying to make sense of this mess
2009-03-12Applied patch from Kevin Lo that fixes compilation on FreeBSD byenselic
addressing include and format string issues. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@599 f606c939-3180-4ac9-a4b8-4b8779d57d0a
2009-01-11src/rmd_get_frame.c: Work around issue with underflow inenselic
rmdBlocksFromList(). I call this a "workaround" because the whole code base needs to stop using unsigned so much IMO. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@592 f606c939-3180-4ac9-a4b8-4b8779d57d0a
2009-01-10src/*.c: Namescape all functions for consistency and general codebaseenselic
sanity (previously only a few rmd functions were namespaced). git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@590 f606c939-3180-4ac9-a4b8-4b8779d57d0a
2008-12-13Added missing stdio.h and errno.h headers in anyiovar
files that needed them (could cause compilation failure on some platforms). Also, rearranged the sequence with which include's happen, so that any missing headers will be more likely to show up as copilation errors, in the future. rmd_yuv_utils.[ch] and rmd_block_utils.[ch] have been merged within the former, as they deal with the same subject (converting rgb buffers to yuv ones, with the only difference that rmd_block_utils had the double-buffer convertions while rmd_yuv_utils dealt with the single-buffered ones). Their headers also had the a circular dependency (rmd_yuv_utils.h included rmd_block_utils.h and vice-versa). rmd_math.[ch] was added. This file holds now the rmdRoundf function which is a portable implementation of roundf (which depends on C99). The reasoning behind the addition of these files, is that they might hold more purely mathematical functions, in the future. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@583 f606c939-3180-4ac9-a4b8-4b8779d57d0a
2008-11-22 src/rmd_cache.c, src/rmd_cache_frame.c, src/rmd_get_frame.c, iovar
src/rmd_init_encoder.c, src/rmd_poll_events.c, src/rmd_rectinsert.c, src/rmd_rectinsert.h, src/rmd_rescue.c, src/rmd_setbrwindow.c, src/rmd_specsfile.c, src/rmd_types.h, src/rmd_update_image.c, src/test-rectinsert-data.c, src/test-rectinsert-types.h, src/test-rectinsert.c: Replaced the custom WGeometry struct-type with the Xlib-provided XRectangle type. Since XRectangle has unsigned width and height, any places in the code where -1 was used in these members of WGeometry to denote invalid rects, where changed to 0 ( zero width or height rects are also considered invalid, wherever met). Also, the following variable renames happened : wgeom => xrect, rgeom => rrect, geom => rect and so on. Some other minor changes in this commit are all related to this type change and also the fact that WGeometry had members of type int, while XRectangle is comprised of short members. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@580 f606c939-3180-4ac9-a4b8-4b8779d57d0a
2008-09-17src/rmd_get_frame.c : As Martin has found, we need to markiovar
both the new and the old area of the cursor, for it to render correctly. This changeset does that for the full-shots scenario, (which is always double-buffered) by making dirty the new area on the back buffer, before the Yuv convertion. Other changes are that the MARK_BACK_BUFFER macro has been renamed to MARK_BUFFER_AREA (as that is what it does and there is nothing intristically tying it to the back buffer) and also a non-sensical comment was removed (probably a thought I never got to finish). git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@558 f606c939-3180-4ac9-a4b8-4b8779d57d0a
2008-09-17src/rmd_get_frame.c: Make the cursor area be properly invalidated andenselic
captured. We need to add dirtiness not only for the old cursor position, but also for the new position. The cursor with --full-shots is still broken however. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@557 f606c939-3180-4ac9-a4b8-4b8779d57d0a
2008-09-16src/rmd_yuv_utils.c : Applied patch by Luca Bonavita, that correctsiovar
the rgb to yuv algorithm and provides near perfect colorspace conversion. src/rmd_get_frame.c : The sum of the chroma subcomponents, in the XFIXES_POINTER_TO_YUV macro, must wrap around the unsigned char type range, for the calculation to be correct. So, we take its modulo to that range. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@551 f606c939-3180-4ac9-a4b8-4b8779d57d0a
2008-09-14src/*.[ch]: Rename files so that the name becomesenselic
rmd_some_file.[ch]. The exceptions are recordmydesktop.c which is the main file and skeleton.[ch] which are external files. src/Makefile.am: Adapt. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@546 f606c939-3180-4ac9-a4b8-4b8779d57d0a
© All Rights Reserved