1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-15 07:43:50 +00:00

KVM Fixes

1. Added changes to support MacOS
2. Updated Linux KVM, so X11 is dynamically loaded at runtime
This commit is contained in:
Bryan Roe
2019-01-11 11:15:22 -08:00
parent 5bbdbf2e48
commit 83c1435512
7 changed files with 198 additions and 122 deletions

View File

@@ -18,6 +18,17 @@ limitations under the License.
unsigned char *jpeg_buffer = NULL;
int jpeg_buffer_length = 0;
char jpegLastError[JMSG_LENGTH_MAX];
JPEG_error_handler default_JPEG_error_handler = NULL;
void jpeg_error_handler(j_common_ptr ptr)
{
// Build the error string
(*(ptr->err->format_message)) (ptr, jpegLastError);
if (default_JPEG_error_handler != NULL) { default_JPEG_error_handler(jpegLastError); }
exit(1);
}
void init_destination(j_compress_ptr cinfo)
{
@@ -67,6 +78,8 @@ int write_JPEG_buffer (JSAMPLE * image_buffer, int image_width, int image_height
int row_stride;
cinfo.err = jpeg_std_error(&jerr);
if (default_JPEG_error_handler != NULL) { jerr.error_exit = jpeg_error_handler; }
jpeg_create_compress(&cinfo);
cinfo.dest = (struct jpeg_destination_mgr *) malloc (sizeof(struct jpeg_destination_mgr));
cinfo.dest->init_destination = &init_destination;