| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#pragma once |
| 23 |
|
| 24 |
#include <gst/gst.h> |
| 25 |
#include <gio/gio.h> |
| 26 |
#include <gio/gunixfdlist.h> |
| 27 |
|
| 28 |
G_BEGIN_DECLS |
| 29 |
|
| 30 |
typedef enum |
| 31 |
{ |
| 32 |
COMMAND_TYPE_NEW_BUFFER = 0, |
| 33 |
COMMAND_TYPE_RELEASE_BUFFER = 1, |
| 34 |
COMMAND_TYPE_CAPS = 2, |
| 35 |
COMMAND_TYPE_EOS = 3, |
| 36 |
} CommandType; |
| 37 |
|
| 38 |
typedef enum |
| 39 |
{ |
| 40 |
MEMORY_TYPE_DEFAULT = 0, |
| 41 |
MEMORY_TYPE_DMABUF = 1, |
| 42 |
MEMORY_TYPE_LAST, |
| 43 |
} MemoryType; |
| 44 |
|
| 45 |
typedef struct { |
| 46 |
guint64 size; |
| 47 |
guint64 offset; |
| 48 |
} MemoryPayload; |
| 49 |
|
| 50 |
typedef struct { |
| 51 |
guint64 id; |
| 52 |
guint64 pts; |
| 53 |
guint64 dts; |
| 54 |
guint64 duration; |
| 55 |
guint64 offset; |
| 56 |
guint64 offset_end; |
| 57 |
guint32 flags; |
| 58 |
guint8 type; |
| 59 |
guint8 n_memory; |
| 60 |
guint16 n_meta; |
| 61 |
MemoryPayload memories[]; |
| 62 |
} NewBufferPayload; |
| 63 |
|
| 64 |
typedef struct { |
| 65 |
guint64 id; |
| 66 |
} ReleaseBufferPayload; |
| 67 |
|
| 68 |
gboolean gst_unix_fd_send_command(GSocket * socket, CommandType type, |
| 69 |
GUnixFDList * fds, const guint8 * payload, gsize payload_size, |
| 70 |
GError ** error); |
| 71 |
gboolean gst_unix_fd_receive_command (GSocket *socket, |
| 72 |
GCancellable *cancellable, CommandType *type, GUnixFDList **fds, |
| 73 |
guint8 **payload, gsize *payload_size, GError **error); |
| 74 |
|
| 75 |
gboolean gst_unix_fd_parse_new_buffer (guint8 *payload, gsize payload_size, |
| 76 |
NewBufferPayload **new_buffer, guint32 *consumed); |
| 77 |
gboolean gst_unix_fd_parse_release_buffer(guint8 *payload, gsize payload_size, |
| 78 |
ReleaseBufferPayload **release_buffer); |
| 79 |
gboolean gst_unix_fd_parse_caps (guint8 *payload, gsize payload_size, |
| 80 |
gchar **caps_str); |
| 81 |
|
| 82 |
GSocket *gst_unix_fd_socket_new(const gchar *socket_path, |
| 83 |
GUnixSocketAddressType socket_type, GSocketAddress **address, |
| 84 |
GError **error); |
| 85 |
|
| 86 |
GST_ELEMENT_REGISTER_DECLARE (unixfdsrc); |
| 87 |
GST_ELEMENT_REGISTER_DECLARE (unixfdsink); |
| 88 |
|
| 89 |
G_END_DECLS |