mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 09:39:56 +00:00
(SDK) Move fifo_buffer.c to libretro SDK
This commit is contained in:
parent
1463d5e7dc
commit
751f2b7403
@ -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 \
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <alsa/asoundlib.h>
|
||||
#include "../general.h"
|
||||
#include <rthreads/rthreads.h>
|
||||
#include "../fifo_buffer.h"
|
||||
#include <queues/fifo_buffer.h>
|
||||
|
||||
#define TRY_ALSA(x) if (x < 0) { \
|
||||
goto error; \
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <rthreads/rthreads.h>
|
||||
#include "../general.h"
|
||||
#include "../performance.h"
|
||||
#include "../fifo_buffer.h"
|
||||
#include <queues/fifo_buffer.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#include "../driver.h"
|
||||
#include "../general.h"
|
||||
#include "../fifo_buffer.h"
|
||||
#include <queues/fifo_buffer.h>
|
||||
#include <stdlib.h>
|
||||
#include <boolean.h>
|
||||
#include <pthread.h>
|
||||
|
@ -52,7 +52,7 @@ static DSMIXBINS dsmb;
|
||||
#include <mmsystem.h>
|
||||
#endif
|
||||
#include <dsound.h>
|
||||
#include "../fifo_buffer.h"
|
||||
#include <queues/fifo_buffer.h>
|
||||
#include "../general.h"
|
||||
|
||||
typedef struct dsound
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <string.h>
|
||||
#include "../fifo_buffer.h"
|
||||
#include <queues/fifo_buffer.h>
|
||||
|
||||
#include "../ps3/sdk_defines.h"
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "../driver.h"
|
||||
#include <stdlib.h>
|
||||
#include "rsound.h"
|
||||
#include "../fifo_buffer.h"
|
||||
#include <queues/fifo_buffer.h>
|
||||
#include <boolean.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
|
||||
|
@ -30,7 +30,7 @@ extern "C" {
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "../fifo_buffer.h"
|
||||
#include <queues/fifo_buffer.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define RSD_DEFAULT_HOST "127.0.0.1" // Stupid Windows.
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include <rthreads/rthreads.h>
|
||||
|
||||
#include "../general.h"
|
||||
#include "../fifo_buffer.h"
|
||||
#include <queues/fifo_buffer.h>
|
||||
|
||||
typedef struct sdl_audio
|
||||
{
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __FIFO_BUFFER_H
|
||||
#define __FIFO_BUFFER_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#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
|
||||
|
@ -405,7 +405,7 @@ STATE TRACKER
|
||||
/*============================================================
|
||||
FIFO BUFFER
|
||||
============================================================ */
|
||||
#include "../fifo_buffer.c"
|
||||
#include "../libretro-sdk/queues/fifo_buffer.c"
|
||||
|
||||
/*============================================================
|
||||
AUDIO RESAMPLER
|
||||
|
60
libretro-sdk/include/queues/fifo_buffer.h
Normal file
60
libretro-sdk/include/queues/fifo_buffer.h
Normal file
@ -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 <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#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
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
* 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 <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "fifo_buffer.h"
|
||||
#include <queues/fifo_buffer.h>
|
||||
|
||||
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);
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
* 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 <stdlib.h>
|
||||
|
@ -44,7 +44,7 @@ extern "C" {
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <boolean.h>
|
||||
#include "../fifo_buffer.h"
|
||||
#include <queues/fifo_buffer.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
#include "../general.h"
|
||||
#include <gfx/scaler/scaler.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user