ipcpipeline: Minimal fixes that allow building with MSVC

This commit is contained in:
Nirbheek Chauhan 2020-01-12 07:41:34 +05:30
parent c8db7a9127
commit b7d91711f7
2 changed files with 11 additions and 4 deletions

View file

@ -24,7 +24,13 @@
# include "config.h"
#endif
#include <unistd.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef _MSC_VER
/* ssize_t is not available, so match return value of read()/write() on MSVC */
#define ssize_t int
#endif
#include <errno.h>
#include <string.h>
#include <gst/base/gstbytewriter.h>
@ -219,7 +225,8 @@ write_to_fd_raw (GstIpcPipelineComm * comm, const void *data, size_t size)
gboolean ret = TRUE;
offset = 0;
GST_TRACE_OBJECT (comm->element, "Writing %zu bytes to fdout", size);
GST_TRACE_OBJECT (comm->element, "Writing %u bytes to fdout",
(unsigned) size);
while (size) {
ssize_t written =
write (comm->fdout, (const unsigned char *) data + offset, size);

View file

@ -295,8 +295,8 @@ gst_ipc_pipeline_src_log_queue (GstIpcPipelineSrc * src)
} else if (GST_IS_QUERY (object)) {
GST_LOG_OBJECT (src, " #%u: %s query", n, GST_QUERY_TYPE_NAME (object));
} else if (GST_IS_BUFFER (object)) {
GST_LOG_OBJECT (src, " #%u: %zu bytes buffer", n,
(size_t) gst_buffer_get_size (object));
GST_LOG_OBJECT (src, " #%u: %" G_GSIZE_FORMAT " bytes buffer", n,
gst_buffer_get_size (object));
} else {
GST_LOG_OBJECT (src, " #%u: unknown item in queue", n);
}