mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
shm: Allow ShmPipe to save a data pointer for applications
This commit is contained in:
parent
f6efb3e397
commit
ca9d60702f
2 changed files with 16 additions and 0 deletions
|
@ -120,6 +120,7 @@ struct _ShmPipe
|
||||||
int main_socket;
|
int main_socket;
|
||||||
char *socket_path;
|
char *socket_path;
|
||||||
int use_count;
|
int use_count;
|
||||||
|
void *data;
|
||||||
|
|
||||||
ShmArea *shm_area;
|
ShmArea *shm_area;
|
||||||
|
|
||||||
|
@ -374,6 +375,18 @@ sp_shm_area_dec (ShmPipe * self, ShmArea * area)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
sp_get_data (ShmPipe * self)
|
||||||
|
{
|
||||||
|
return self->data;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
sp_set_data (ShmPipe * self, void *data)
|
||||||
|
{
|
||||||
|
self->data = data;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sp_inc (ShmPipe * self)
|
sp_inc (ShmPipe * self)
|
||||||
{
|
{
|
||||||
|
|
|
@ -75,6 +75,8 @@ typedef struct _ShmBlock ShmBlock;
|
||||||
ShmPipe *sp_writer_create (const char *path, size_t size, mode_t perms);
|
ShmPipe *sp_writer_create (const char *path, size_t size, mode_t perms);
|
||||||
const char *sp_writer_get_path (ShmPipe *pipe);
|
const char *sp_writer_get_path (ShmPipe *pipe);
|
||||||
void sp_close (ShmPipe * self);
|
void sp_close (ShmPipe * self);
|
||||||
|
void *sp_get_data (ShmPipe * self);
|
||||||
|
void sp_set_data (ShmPipe * self, void *data);
|
||||||
|
|
||||||
int sp_writer_setperms_shm (ShmPipe * self, mode_t perms);
|
int sp_writer_setperms_shm (ShmPipe * self, mode_t perms);
|
||||||
int sp_writer_resize (ShmPipe * self, size_t size);
|
int sp_writer_resize (ShmPipe * self, size_t size);
|
||||||
|
@ -86,6 +88,7 @@ ShmBlock *sp_writer_alloc_block (ShmPipe * self, size_t size);
|
||||||
void sp_writer_free_block (ShmBlock *block);
|
void sp_writer_free_block (ShmBlock *block);
|
||||||
int sp_writer_send_buf (ShmPipe * self, char *buf, size_t size);
|
int sp_writer_send_buf (ShmPipe * self, char *buf, size_t size);
|
||||||
char *sp_writer_block_get_buf (ShmBlock *block);
|
char *sp_writer_block_get_buf (ShmBlock *block);
|
||||||
|
ShmPipe *sp_writer_block_get_pipe (ShmBlock *block);
|
||||||
|
|
||||||
ShmClient * sp_writer_accept_client (ShmPipe * self);
|
ShmClient * sp_writer_accept_client (ShmPipe * self);
|
||||||
void sp_writer_close_client (ShmPipe *self, ShmClient * client);
|
void sp_writer_close_client (ShmPipe *self, ShmClient * client);
|
||||||
|
|
Loading…
Reference in a new issue