mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 02:00:33 +00:00
plugins: Don't force 64-bit file/seek functions variants on android
Most functions are automatically chosen from the _FILE_OFFSET_BITS define, the remaining one (fstat) is only available on API >= 21 so check for that
This commit is contained in:
parent
cbe24ecc89
commit
5a5a548b09
6 changed files with 10 additions and 32 deletions
|
@ -69,13 +69,11 @@
|
|||
#define off_t guint64
|
||||
#endif
|
||||
|
||||
#ifdef __BIONIC__ /* Android */
|
||||
#undef lseek
|
||||
#define lseek lseek64
|
||||
#if defined(__BIONIC__) /* Android */
|
||||
#if defined(__ANDROID_API__) && __ANDROID_API__ >= 21
|
||||
#undef fstat
|
||||
#define fstat fstat64
|
||||
#undef off_t
|
||||
#define off_t guint64
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
|
|
|
@ -81,11 +81,11 @@
|
|||
#include "gstfdsrc.h"
|
||||
|
||||
#ifdef __BIONIC__ /* Android */
|
||||
#undef lseek
|
||||
#define lseek lseek64
|
||||
#if defined(__ANDROID_API__) && __ANDROID_API__ >= 21
|
||||
#undef fstat
|
||||
#define fstat fstat64
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
|
|
|
@ -70,13 +70,6 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __BIONIC__ /* Android */
|
||||
#undef lseek
|
||||
#define lseek lseek64
|
||||
#undef off_t
|
||||
#define off_t guint64
|
||||
#endif
|
||||
|
||||
#include "gstelements_private.h"
|
||||
#include "gstfilesink.h"
|
||||
|
||||
|
@ -401,12 +394,12 @@ gst_file_sink_open_file (GstFileSink * sink)
|
|||
sink->buffer = g_malloc (sink->buffer_size);
|
||||
buffer_size = sink->buffer_size;
|
||||
}
|
||||
/* Cygwin does not have __fbufsize */
|
||||
#if defined(HAVE_STDIO_EXT_H) && !defined(__CYGWIN__)
|
||||
/* Cygwin does not have __fbufsize, android adds it in API 23 */
|
||||
#if defined(HAVE_STDIO_EXT_H) && (!defined(__CYGWIN__) && (!defined(__ANDROID_API__) || __ANDROID_API__ >= 23))
|
||||
GST_DEBUG_OBJECT (sink, "change buffer size %u to %u, mode %d",
|
||||
(guint) __fbufsize (sink->file), buffer_size, mode);
|
||||
#else
|
||||
GST_DEBUG_OBJECT (sink, "change buffer size to %u, mode %d",
|
||||
GST_DEBUG_OBJECT (sink, "change buffer size to %u, mode %d",
|
||||
sink->buffer_size, mode);
|
||||
#endif
|
||||
if (setvbuf (sink->file, sink->buffer, mode, buffer_size) != 0) {
|
||||
|
|
|
@ -66,12 +66,10 @@
|
|||
#endif
|
||||
|
||||
#ifdef __BIONIC__ /* Android */
|
||||
#undef lseek
|
||||
#define lseek lseek64
|
||||
#if defined(__ANDROID_API__) && __ANDROID_API__ >= 21
|
||||
#undef fstat
|
||||
#define fstat fstat64
|
||||
#undef off_t
|
||||
#define off_t guint64
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
|
|
|
@ -75,10 +75,6 @@
|
|||
#endif
|
||||
|
||||
#ifdef __BIONIC__ /* Android */
|
||||
#undef lseek
|
||||
#define lseek lseek64
|
||||
#undef off_t
|
||||
#define off_t guint64
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -36,13 +36,6 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __BIONIC__ /* Android */
|
||||
#undef lseek
|
||||
#define lseek lseek64
|
||||
#undef off_t
|
||||
#define off_t guint64
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FSEEKO
|
||||
#define FSEEK_FILE(file,offset) (fseeko (file, (off_t) offset, SEEK_SET) != 0)
|
||||
#elif defined (G_OS_UNIX) || defined (G_OS_WIN32)
|
||||
|
|
Loading…
Reference in a new issue