{
PROP_0,
PROP_SOCKET_PATH,
- PROP_IS_LIVE
+ PROP_IS_LIVE,
+ PROP_SHM_AREA_NAME
};
struct GstShmBuffer
g_object_class_install_property (gobject_class, PROP_SOCKET_PATH,
g_param_spec_string ("socket-path",
"Path to the control socket",
- "The path to the control socket used to control the shared memory"
- " transport", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ "The path to the control socket used to control the shared memory",
+ NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_IS_LIVE,
g_param_spec_boolean ("is-live", "Is this a live source",
"True if the element cannot produce data in PAUSED", FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (gobject_class, PROP_SHM_AREA_NAME,
+ g_param_spec_string ("shm-area-name",
+ "Name of the shared memory area",
+ "The name of the shared memory area used to get buffers",
+ NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
case PROP_IS_LIVE:
g_value_set_boolean (value, gst_base_src_is_live (GST_BASE_SRC (object)));
break;
+ case PROP_SHM_AREA_NAME:
+ GST_OBJECT_LOCK (object);
+ if (self->pipe)
+ g_value_set_string (value, sp_get_shm_area_name (self->pipe->pipe));
+ GST_OBJECT_UNLOCK (object);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
int id;
int use_count;
+ int is_writer;
int shm_fd;
area->shm_area_len = size;
+ area->is_writer = (path == NULL);
+
if (path)
flags = O_RDONLY;
prot = PROT_READ | PROT_WRITE;
} else {
+ area->shm_area_name = strdup (path);
prot = PROT_READ;
}
close (area->shm_fd);
if (area->shm_area_name) {
- shm_unlink (area->shm_area_name);
+ if (area->is_writer)
+ shm_unlink (area->shm_area_name);
free (area->shm_area_name);
}
return self->main_socket;
}
+const gchar *
+sp_get_shm_area_name (ShmPipe * self)
+{
+ if (self->shm_area)
+ return self->shm_area->shm_area_name;
+
+ return NULL;
+}
+
int
sp_writer_get_client_fd (ShmClient * client)
{