ifdefed one sem_getvalue in gl_sdl on MacOSX

moved some stuff from display_kona_probe to display_kona init so that ultragrid is
not reporting on kona when probing all displays

Sill playing with DecompressSequenceBeginS and DecompressSequenceFrameS
- DecompressSequenceFrameS returns codecNothingToBlitErr
This commit is contained in:
xliska
2008-03-07 14:00:17 +00:00
parent 465ce77e04
commit d5e0019acc
2 changed files with 31 additions and 13 deletions

View File

@@ -125,7 +125,7 @@ void * display_gl_init(void)
s->magic = MAGIC_GL;
if (!(s->display = XOpenDisplay(NULL))) {
printf("Unable to open display.\n");
printf("Unable to open display GL: XOpenDisplay.\n");
return NULL;
}
@@ -435,12 +435,15 @@ static void * display_thread_gl(void *arg)
}
/* Check to see if we have data yet, if not, just chillax */
/* TODO: we need some solution (TM) for sem_getvalue on MacOS X */
#ifndef HAVE_MACOSX
sem_getvalue(&s->semaphore,&i);
while(i<1) {
display_gl_handle_events(s);
usleep(1000);
sem_getvalue(&s->semaphore,&i);
}
#endif /* HAVE_MACOSX */
while(1) {
GLubyte *line1, *line2;

View File

@@ -37,6 +37,7 @@ struct state_kona {
uint32_t magic;
};
static void*
display_thread_kona(void *arg)
{
@@ -51,8 +52,19 @@ display_thread_kona(void *arg)
imageDesc = (ImageDescriptionHandle)NewHandle(0);
ret = DecompressSequenceBegin(&(s->seqID), imageDesc, s->gworld, NULL, NULL,
NULL, srcCopy, NULL, 0, codecNormalQuality, bestSpeedCodec);
ret = DecompressSequenceBeginS(&(s->seqID),
imageDesc,
NULL,
NULL,
s->gworld,
NULL,
NULL,
NULL,
srcCopy,
NULL,
NULL,
codecNormalQuality,
anyCodec);
if (ret != noErr) {
fprintf(stderr, "Failed DecompressSequenceBeginS\n");
}
@@ -65,15 +77,14 @@ display_thread_kona(void *arg)
/* TODO */
// memcpy(GetPixBaseAddr(GetGWorldPixMap(s->gworld)), s->buffers[s->image_display], hd_size_x*hd_size_y*hd_color_bpp);
ret = DecompressSequenceFrameWhen(s->seqID,
s->buffers[s->image_display],
hd_size_x*hd_size_y*hd_color_bpp,
0,
&ignore,
NULL,
nil);
ret = DecompressSequenceFrameS(s->seqID,
s->buffers[s->image_display],
hd_size_x*hd_size_y*hd_color_bpp,
0,
&ignore,
nil);
if (ret != noErr) {
fprintf(stderr, "Failed DecompressSequenceFrameWhen\n");
fprintf(stderr, "Failed DecompressSequenceFrameS: %d\n", ret);
}
frames++;
@@ -158,9 +169,13 @@ display_kona_init(void)
DisposeHandle(componentNameHandle);
if (strcmp(cName, "AJA")) {
fprintf(stdout, "Found video output component: %s\n", cName);
s->videoDisplayComponent = c;
s->videoDisplayComponentInstance = OpenComponent(s->videoDisplayComponent);
break;
} else {
fprintf(stderr, "AJA Kona3 not found!\n");
return NULL;
}
}
@@ -288,6 +303,8 @@ display_kona_done(void *state)
if (ret != noErr) {
fprintf(stderr, "Failed to close the video output component.\n");
}
DisposeGWorld(s->gworld);
}
display_colour_t
@@ -325,13 +342,11 @@ display_kona_probe(void)
int len = *cName++;
cName[len] = 0;
fprintf(stdout, "Found video output component: %s\n", cName);
DisposeHandle(componentNameHandle);
}
if (!foundAJAKona) {
fprintf(stderr, "AJA Kona3 not found!\n");
return NULL;
}