diff --git a/Makefile.common b/Makefile.common index 567632830c..ff53d6e711 100644 --- a/Makefile.common +++ b/Makefile.common @@ -116,7 +116,7 @@ OBJ += frontend/frontend.o \ input/keyboard_line.o \ input/overlay.o \ patch.o \ - fifo_buffer.o \ + libretro-sdk/queues/fifo_buffer.o \ core_options.o \ libretro-sdk/compat/compat.o \ cheats.o \ diff --git a/audio/alsathread.c b/audio/alsathread.c index ef7f92ae00..bdcb91caec 100644 --- a/audio/alsathread.c +++ b/audio/alsathread.c @@ -20,7 +20,7 @@ #include #include "../general.h" #include -#include "../fifo_buffer.h" +#include #define TRY_ALSA(x) if (x < 0) { \ goto error; \ diff --git a/audio/audio_thread_wrapper.c b/audio/audio_thread_wrapper.c index ac5dbde9a0..00927f57fc 100644 --- a/audio/audio_thread_wrapper.c +++ b/audio/audio_thread_wrapper.c @@ -18,7 +18,7 @@ #include #include "../general.h" #include "../performance.h" -#include "../fifo_buffer.h" +#include #include #include diff --git a/audio/coreaudio.c b/audio/coreaudio.c index 95208bc66a..21e968a860 100644 --- a/audio/coreaudio.c +++ b/audio/coreaudio.c @@ -17,7 +17,7 @@ #include "../driver.h" #include "../general.h" -#include "../fifo_buffer.h" +#include #include #include #include diff --git a/audio/dsound.c b/audio/dsound.c index 83d65b97de..ace28c8321 100644 --- a/audio/dsound.c +++ b/audio/dsound.c @@ -52,7 +52,7 @@ static DSMIXBINS dsmb; #include #endif #include -#include "../fifo_buffer.h" +#include #include "../general.h" typedef struct dsound diff --git a/audio/ps3_audio.c b/audio/ps3_audio.c index 3d12e5be4d..082c5f100e 100644 --- a/audio/ps3_audio.c +++ b/audio/ps3_audio.c @@ -19,7 +19,7 @@ #include #include -#include "../fifo_buffer.h" +#include #include "../ps3/sdk_defines.h" diff --git a/audio/rsound.c b/audio/rsound.c index c05bacefe4..9b49e9f67f 100644 --- a/audio/rsound.c +++ b/audio/rsound.c @@ -17,7 +17,7 @@ #include "../driver.h" #include #include "rsound.h" -#include "../fifo_buffer.h" +#include #include #include diff --git a/audio/rsound.h b/audio/rsound.h index 70d7827e11..5395c137aa 100644 --- a/audio/rsound.h +++ b/audio/rsound.h @@ -30,7 +30,7 @@ extern "C" { #include #include -#include "../fifo_buffer.h" +#include #ifdef _WIN32 #define RSD_DEFAULT_HOST "127.0.0.1" // Stupid Windows. diff --git a/audio/sdl_audio.c b/audio/sdl_audio.c index 530dd83c26..5c1a89ad4c 100644 --- a/audio/sdl_audio.c +++ b/audio/sdl_audio.c @@ -26,7 +26,7 @@ #include #include "../general.h" -#include "../fifo_buffer.h" +#include typedef struct sdl_audio { diff --git a/fifo_buffer.h b/fifo_buffer.h deleted file mode 100644 index 01a0c6848c..0000000000 --- a/fifo_buffer.h +++ /dev/null @@ -1,54 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2015 - Daniel De Matteis - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#ifndef __FIFO_BUFFER_H -#define __FIFO_BUFFER_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct fifo_buffer -{ - uint8_t *buffer; - size_t bufsize; - size_t first; - size_t end; -}; - -typedef struct fifo_buffer fifo_buffer_t; - -fifo_buffer_t *fifo_new(size_t size); - -void fifo_write(fifo_buffer_t *buffer, const void *in_buf, size_t size); - -void fifo_read(fifo_buffer_t *buffer, void *in_buf, size_t size); - -void fifo_free(fifo_buffer_t *buffer); - -size_t fifo_read_avail(fifo_buffer_t *buffer); - -size_t fifo_write_avail(fifo_buffer_t *buffer); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/griffin/griffin.c b/griffin/griffin.c index 34125cb53b..7822deff29 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -405,7 +405,7 @@ STATE TRACKER /*============================================================ FIFO BUFFER ============================================================ */ -#include "../fifo_buffer.c" +#include "../libretro-sdk/queues/fifo_buffer.c" /*============================================================ AUDIO RESAMPLER diff --git a/libretro-sdk/include/queues/fifo_buffer.h b/libretro-sdk/include/queues/fifo_buffer.h new file mode 100644 index 0000000000..1e4e06a29f --- /dev/null +++ b/libretro-sdk/include/queues/fifo_buffer.h @@ -0,0 +1,60 @@ +/* Copyright (C) 2010-2015 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (boolean.h). + * --------------------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef __LIBRETRO_SDK_FIFO_BUFFER_H +#define __LIBRETRO_SDK_FIFO_BUFFER_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct fifo_buffer +{ + uint8_t *buffer; + size_t bufsize; + size_t first; + size_t end; +}; + +typedef struct fifo_buffer fifo_buffer_t; + +fifo_buffer_t *fifo_new(size_t size); + +void fifo_write(fifo_buffer_t *buffer, const void *in_buf, size_t size); + +void fifo_read(fifo_buffer_t *buffer, void *in_buf, size_t size); + +void fifo_free(fifo_buffer_t *buffer); + +size_t fifo_read_avail(fifo_buffer_t *buffer); + +size_t fifo_write_avail(fifo_buffer_t *buffer); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/fifo_buffer.c b/libretro-sdk/queues/fifo_buffer.c similarity index 56% rename from fifo_buffer.c rename to libretro-sdk/queues/fifo_buffer.c index 06e3411ca1..10c3bf2c51 100644 --- a/fifo_buffer.c +++ b/libretro-sdk/queues/fifo_buffer.c @@ -1,27 +1,35 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2015 - Daniel De Matteis - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. +/* Copyright (C) 2010-2015 The RetroArch team * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (rthreads.c). + * --------------------------------------------------------------------------------------- * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + #include #include -#include "fifo_buffer.h" +#include fifo_buffer_t *fifo_new(size_t size) { fifo_buffer_t *buf = (fifo_buffer_t*)calloc(1, sizeof(*buf)); + if (!buf) return NULL; @@ -38,7 +46,7 @@ fifo_buffer_t *fifo_new(size_t size) void fifo_free(fifo_buffer_t *buffer) { - if(!buffer) + if (!buffer) return; free(buffer->buffer); diff --git a/libretro-sdk/queues/message_queue.c b/libretro-sdk/queues/message_queue.c index 18320ac70e..3a4bec77c7 100644 --- a/libretro-sdk/queues/message_queue.c +++ b/libretro-sdk/queues/message_queue.c @@ -1,17 +1,23 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2015 - Daniel De Matteis - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. +/* Copyright (C) 2010-2015 The RetroArch team * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (rthreads.c). + * --------------------------------------------------------------------------------------- * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include diff --git a/record/ffmpeg.c b/record/ffmpeg.c index 7aa939d242..8cd58ecd2d 100644 --- a/record/ffmpeg.c +++ b/record/ffmpeg.c @@ -44,7 +44,7 @@ extern "C" { #include #include #include -#include "../fifo_buffer.h" +#include #include #include "../general.h" #include