mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-22 09:40:30 +00:00
Portaudio fix on Mac X OS
* ship libraries according to portaudio.in * another small fixes (see log)
This commit is contained in:
@@ -306,6 +306,7 @@ case "$host_os" in
|
||||
AC_CHECK_LIB(DeckLinkAPI, main, FOUND_DECKLINK_L=yes, FOUND_DECKLINK_L=no)
|
||||
if test $FOUND_DECKLINK_H = yes -a $FOUND_DECKLINK_SRC = yes -a $FOUND_DECKLINK_L = yes; then
|
||||
FOUND_DECKLINK=yes
|
||||
LIBS+=" -ldl"
|
||||
else
|
||||
FOUND_DECKLINK=no
|
||||
fi
|
||||
@@ -319,7 +320,6 @@ then
|
||||
DECKLINK_OBJ="src/video_capture/DeckLinkAPIDispatch.o src/video_capture/decklink.o src/video_display/decklink.o"
|
||||
AC_DEFINE([HAVE_DECKLINK], [1], [Build with DeckLink support])
|
||||
LINKER=$CXX
|
||||
LIBS+=" -ldl"
|
||||
else
|
||||
DECKLINK_PATH=
|
||||
DECKLINK_INC=
|
||||
@@ -737,15 +737,11 @@ AC_CHECK_FILE(${PORTAUDIO_LIB}/libportaudio.a, IS_PORTAUDIO_STATIC=yes, IS_PORTA
|
||||
if test $FOUND_PORTAUDIO_H = yes -a $FOUND_PORTAUDIO_L = yes -a $IS_PORTAUDIO_STATIC = yes
|
||||
then
|
||||
PORTAUDIO_INC=-I${PORTAUDIO_INC}
|
||||
case "$host_os" in
|
||||
*darwin*)
|
||||
PORTAUDIO_LIB="${PORTAUDIO_LIB}/libportaudio.a -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework CoreServices"
|
||||
;;
|
||||
*)
|
||||
PORTAUDIO_LIB="${PORTAUDIO_LIB}/libportaudio.a"
|
||||
LIBS+=" -lasound"
|
||||
;;
|
||||
esac
|
||||
# we have now portaudio linked statically
|
||||
# TODO: consider linking it dynamically
|
||||
PORTAUDIO_LIB="${PORTAUDIO_LIB}/libportaudio.a"
|
||||
PORTAUDIO_LIB+="`cat ../portaudio/portaudio-2.0.pc|grep '^Libs: '|sed 's/^Libs: -L\${libdir} -lportaudio//'`"
|
||||
CFLAGS+="`cat ../portaudio/portaudio-2.0.pc|grep '^Cflags: '|sed 's/^Cflags: -I\${includedir}//'`"
|
||||
PORTAUDIO_OBJ="$PORTAUDIO_OBJ src/audio/portaudio.o"
|
||||
AC_DEFINE([HAVE_PORTAUDIO], [1], [Build with Portaudio support])
|
||||
else
|
||||
|
||||
@@ -404,6 +404,9 @@ void portaudio_put_frame(void *state)
|
||||
error = Pa_WriteStream(s->stream, s->frame.data, s->frame.data_len / (s->frame.bps * s->frame.ch_count));
|
||||
|
||||
if(error != paNoError) {
|
||||
if(error == paOutputUnderflowed) { /* put current frame once more */
|
||||
Pa_WriteStream(s->stream, s->frame.data, s->frame.data_len / (s->frame.bps * s->frame.ch_count));
|
||||
}
|
||||
printf("Pa write stream error: %s\n", Pa_GetErrorText(error));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1025,6 +1025,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
void cleanup_uv(void)
|
||||
{
|
||||
/* give threads time to exit gracefully
|
||||
* it is not ideal but rather good solution
|
||||
* to avoid segfaults.
|
||||
*/
|
||||
should_exit = 1;
|
||||
usleep(100000);
|
||||
|
||||
tx_done(uv_state->tx);
|
||||
destroy_devices(uv_state->network_devices);
|
||||
vidcap_done(uv_state->capture_device);
|
||||
|
||||
@@ -264,7 +264,7 @@ decklink_help()
|
||||
result = deckLink->GetModelName((STRING *) &deviceNameString);
|
||||
#ifdef HAVE_MACOSX
|
||||
deviceNameCString = (char *) malloc(128);
|
||||
CFStringGetCString(deviceNameString, deviceNameCString, 128, kCFStringEncodingMacRoman);
|
||||
CFStringGetCString(deviceNameString, (char *)deviceNameCString, 128, kCFStringEncodingMacRoman);
|
||||
#else
|
||||
deviceNameCString = deviceNameString;
|
||||
#endif
|
||||
@@ -937,7 +937,7 @@ print_output_modes (IDeckLink* deckLink)
|
||||
result = displayMode->GetName((STRING *) &displayModeString);
|
||||
#ifdef HAVE_MACOSX
|
||||
displayModeCString = (char *) malloc(128);
|
||||
CFStringGetCString(displayModeString, displayModeCString, 128, kCFStringEncodingMacRoman);
|
||||
CFStringGetCString(displayModeString, (char *) displayModeCString, 128, kCFStringEncodingMacRoman);
|
||||
#else
|
||||
displayModeCString = displayModeString;
|
||||
#endif
|
||||
|
||||
@@ -69,6 +69,8 @@
|
||||
|
||||
#define MAGIC_QT_GRABBER VIDCAP_QUICKTIME_ID
|
||||
|
||||
extern int should_exit;
|
||||
|
||||
struct qt_grabber_state {
|
||||
uint32_t magic;
|
||||
SeqGrabComponent grabber;
|
||||
@@ -869,7 +871,7 @@ void * vidcap_quicktime_thread(void *state)
|
||||
{
|
||||
struct qt_grabber_state *s = (struct qt_grabber_state *)state;
|
||||
|
||||
while(1) {
|
||||
while(!should_exit) {
|
||||
memset(s->abuffer[s->grab_buf_idx], 0, s->abuffer_len);
|
||||
s->abuffer_len = 0;
|
||||
/* Run the QuickTime sequence grabber idle function, which provides */
|
||||
|
||||
@@ -159,7 +159,7 @@ static void show_help(void)
|
||||
result = deckLink->GetModelName((STRING *) &deviceNameString);
|
||||
#ifdef HAVE_MACOSX
|
||||
deviceNameCString = (char *) malloc(128);
|
||||
CFStringGetCString(deviceNameString, deviceNameCString, 128, kCFStringEncodingMacRoman);
|
||||
CFStringGetCString(deviceNameString, (char *) deviceNameCString, 128, kCFStringEncodingMacRoman);
|
||||
#else
|
||||
deviceNameCString = deviceNameString;
|
||||
#endif
|
||||
@@ -319,7 +319,7 @@ reconfigure_screen_decklink(void *state, unsigned int width, unsigned int height
|
||||
{
|
||||
#ifdef HAVE_MACOSX
|
||||
modeNameCString = (char *) malloc(128);
|
||||
CFStringGetCString(modeNameString, modeNameCString, 128, kCFStringEncodingMacRoman);
|
||||
CFStringGetCString(modeNameString, (char *) modeNameCString, 128, kCFStringEncodingMacRoman);
|
||||
#else
|
||||
modeNameCString = modeNameString;
|
||||
#endif
|
||||
|
||||
@@ -67,6 +67,8 @@
|
||||
|
||||
#define HDSP_MAGIC 0x12345678
|
||||
|
||||
extern int should_exit;
|
||||
|
||||
/* TODO: set properties for commented-out formats (if known) */
|
||||
|
||||
const hdsp_mode_table_t hdsp_mode_table[] = {
|
||||
@@ -376,7 +378,7 @@ void display_dvs_run(void *arg)
|
||||
struct state_hdsp *s = (struct state_hdsp *)arg;
|
||||
int res;
|
||||
|
||||
while (1) {
|
||||
while (!should_exit) {
|
||||
pthread_mutex_lock(&s->lock);
|
||||
|
||||
while (s->work_to_do == FALSE) {
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
|
||||
/* defined in main.c */
|
||||
extern int uv_argc;
|
||||
extern int should_exit;
|
||||
extern char **uv_argv;
|
||||
|
||||
struct state_gl {
|
||||
@@ -689,6 +690,7 @@ void glut_key_callback(unsigned char key, int x, int y)
|
||||
platform_sem_post(&gl->semaphore);
|
||||
if(gl->window != -1)
|
||||
glutDestroyWindow(gl->window);
|
||||
should_exit = 1;
|
||||
exit(0);
|
||||
break;
|
||||
case 'd':
|
||||
|
||||
Reference in New Issue
Block a user