[aravis] device: rename get_stream to new_stream to reflect the fact reference is given to the caller.
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis] device: rename get_stream to new_stream to reflect the fact reference is given to the caller.
- Date: Sat, 3 Apr 2010 15:59:05 +0000 (UTC)
commit a5485041e185dd5ba6d9741965dc9d36ce77cdb6
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Sat Apr 3 17:58:25 2010 +0200
device: rename get_stream to new_stream to reflect the fact reference is given to the caller.
src/arvcamera.c | 4 ++--
src/arvcamera.h | 2 +-
src/arvcameratest.c | 2 +-
src/arvdevice.c | 16 ++--------------
src/arvdevice.h | 4 ++--
src/arvgvdevice.c | 4 ++--
src/arvtest.c | 2 +-
7 files changed, 11 insertions(+), 23 deletions(-)
---
diff --git a/src/arvcamera.c b/src/arvcamera.c
index ffa4eab..0ca4d6e 100644
--- a/src/arvcamera.c
+++ b/src/arvcamera.c
@@ -37,11 +37,11 @@ struct _ArvCameraPrivate {
};
ArvStream *
-arv_camera_get_stream (ArvCamera *camera)
+arv_camera_new_stream (ArvCamera *camera)
{
g_return_val_if_fail (ARV_IS_CAMERA (camera), NULL);
- return arv_device_get_stream (camera->priv->device);
+ return arv_device_new_stream (camera->priv->device);
}
void
diff --git a/src/arvcamera.h b/src/arvcamera.h
index 73464ec..f9c9d85 100644
--- a/src/arvcamera.h
+++ b/src/arvcamera.h
@@ -50,7 +50,7 @@ struct _ArvCameraClass {
GType arv_camera_get_type (void);
ArvCamera * arv_camera_new (const char *name);
-ArvStream * arv_camera_get_stream (ArvCamera *camera);
+ArvStream * arv_camera_new_stream (ArvCamera *camera);
void arv_camera_start_acquisition (ArvCamera *camera);
void arv_camera_stop_acquisition (ArvCamera *camera);
guint arv_camera_get_payload (ArvCamera *camera);
diff --git a/src/arvcameratest.c b/src/arvcameratest.c
index e688c90..983839f 100644
--- a/src/arvcameratest.c
+++ b/src/arvcameratest.c
@@ -98,7 +98,7 @@ main (int argc, char **argv)
g_print ("vertical binning = %d\n", dy);
g_print ("exposure = %g µs\n", exposure);
- stream = arv_camera_get_stream (camera);
+ stream = arv_camera_new_stream (camera);
if (arv_option_auto_buffer)
arv_gv_stream_set_option (ARV_GV_STREAM (stream),
ARV_GV_STREAM_OPTION_SOCKET_BUFFER_AUTO,
diff --git a/src/arvdevice.c b/src/arvdevice.c
index 2c5772b..c36059a 100644
--- a/src/arvdevice.c
+++ b/src/arvdevice.c
@@ -30,23 +30,14 @@ struct _ArvDevicePrivate {
ArvGc *genicam;
char *genicam_data;
size_t genicam_size;
-
- ArvStream *stream;
};
ArvStream *
-arv_device_get_stream (ArvDevice *device)
+arv_device_new_stream (ArvDevice *device)
{
g_return_val_if_fail (ARV_IS_DEVICE (device), NULL);
- if (device->priv->stream != NULL) {
- g_object_ref (device->priv->stream);
- return device->priv->stream;
- }
-
- device->priv->stream = ARV_DEVICE_GET_CLASS (device)->create_stream (device);
-
- return device->priv->stream;
+ return ARV_DEVICE_GET_CLASS (device)->new_stream (device);
}
gboolean
@@ -132,9 +123,6 @@ arv_device_finalize (GObject *object)
{
ArvDevice *device = ARV_DEVICE (object);
- if (ARV_IS_STREAM (device->priv->stream))
- g_object_unref (device->priv->stream);
-
g_free (device->priv->genicam_data);
if (device->priv->genicam != NULL)
g_object_unref (device->priv->genicam);
diff --git a/src/arvdevice.h b/src/arvdevice.h
index cfae2ac..49a1b8b 100644
--- a/src/arvdevice.h
+++ b/src/arvdevice.h
@@ -46,7 +46,7 @@ struct _ArvDevice {
struct _ArvDeviceClass {
GObjectClass parent_class;
- ArvStream * (*create_stream) (ArvDevice *device);
+ ArvStream * (*new_stream) (ArvDevice *device);
gboolean (*read_memory) (ArvDevice *device, guint32 address, guint32 size, void *buffer);
gboolean (*write_memory) (ArvDevice *device, guint32 address, guint32 size, void *buffer);
@@ -56,7 +56,7 @@ struct _ArvDeviceClass {
GType arv_device_get_type (void);
-ArvStream * arv_device_get_stream (ArvDevice *device);
+ArvStream * arv_device_new_stream (ArvDevice *device);
gboolean arv_device_read_memory (ArvDevice *device, guint32 address, guint32 size,
void *buffer);
diff --git a/src/arvgvdevice.c b/src/arvgvdevice.c
index d4daec4..2edc435 100644
--- a/src/arvgvdevice.c
+++ b/src/arvgvdevice.c
@@ -400,7 +400,7 @@ arv_gv_device_load_genicam (ArvGvDevice *gv_device)
/* ArvDevice implemenation */
static ArvStream *
-arv_gv_device_create_stream (ArvDevice *device)
+arv_gv_device_new_stream (ArvDevice *device)
{
ArvGvDevice *gv_device = ARV_GV_DEVICE (device);
ArvGvDeviceIOData *io_data = gv_device->priv->io_data;
@@ -583,7 +583,7 @@ arv_gv_device_class_init (ArvGvDeviceClass *gv_device_class)
object_class->finalize = arv_gv_device_finalize;
- device_class->create_stream = arv_gv_device_create_stream;
+ device_class->new_stream = arv_gv_device_new_stream;
device_class->read_memory = arv_gv_device_read_memory;
device_class->write_memory = arv_gv_device_write_memory;
device_class->read_register = arv_gv_device_read_register;
diff --git a/src/arvtest.c b/src/arvtest.c
index 6dba0cc..1eee074 100644
--- a/src/arvtest.c
+++ b/src/arvtest.c
@@ -167,7 +167,7 @@ main (int argc, char **argv)
g_print ("reverse x = %s\n", v_boolean ? "TRUE" : "FALSE");
}
- stream = arv_device_get_stream (device);
+ stream = arv_device_new_stream (device);
if (arv_option_auto_buffer)
arv_gv_stream_set_option (ARV_GV_STREAM (stream),
ARV_GV_STREAM_OPTION_SOCKET_BUFFER_AUTO,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]