camorama r362 - in trunk: . src



Author: herzi
Date: Wed May 28 14:20:42 2008
New Revision: 362
URL: http://svn.gnome.org/viewvc/camorama?rev=362&view=rev

Log:
2008-05-28  Sven Herzberg  <sven imendio com>

	Added a private memory section to the read algorithm (to store the cam
	the same way the mmap algorithm does).

	* src/capture-strategy-read.c: (capture_strategy_read_init),
	(capture_strategy_read_class_init): added a private memory section
	* src/capture-strategy-read.h: added a casting macro


Modified:
   trunk/ChangeLog
   trunk/src/capture-strategy-read.c
   trunk/src/capture-strategy-read.h

Modified: trunk/src/capture-strategy-read.c
==============================================================================
--- trunk/src/capture-strategy-read.c	(original)
+++ trunk/src/capture-strategy-read.c	Wed May 28 14:20:42 2008
@@ -25,6 +25,12 @@
 
 #include "camorama-globals.h"
 
+struct _CaptureStrategyReadPrivate {
+	cam* cam;
+};
+
+#define PRIV(i) (CAPTURE_STRATEGY_READ (i)->_private)
+
 /* GType Implementation */
 
 static void implement_capture_strategy (CaptureStrategyIface* iface);
@@ -34,11 +40,17 @@
 
 static void
 capture_strategy_read_init (CaptureStrategyRead* self)
-{}
+{
+	PRIV(self) = G_TYPE_INSTANCE_GET_PRIVATE (self,
+						  CAMORAMA_TYPE_CAPTURE_STRATEGY_READ,
+						  CaptureStrategyReadPrivate);
+}
 
 static void
 capture_strategy_read_class_init (CaptureStrategyReadClass* self_class)
-{}
+{
+	g_type_class_add_private (self_class, sizeof (CaptureStrategyReadPrivate));
+}
 
 /* Public API */
 

Modified: trunk/src/capture-strategy-read.h
==============================================================================
--- trunk/src/capture-strategy-read.h	(original)
+++ trunk/src/capture-strategy-read.h	Wed May 28 14:20:42 2008
@@ -32,7 +32,8 @@
 typedef struct _CaptureStrategyReadPrivate CaptureStrategyReadPrivate;
 typedef struct _CaptureStrategyReadClass   CaptureStrategyReadClass;
 
-#define CAMORAMA_TYPE_CAPTURE_STRATEGY_READ         (capture_strategy_read_get_type ())
+#define CAMORAMA_TYPE_CAPTURE_STRATEGY_READ (capture_strategy_read_get_type ())
+#define CAPTURE_STRATEGY_READ(i)            (G_TYPE_CHECK_INSTANCE_CAST ((i), CAMORAMA_TYPE_CAPTURE_STRATEGY_READ, CaptureStrategyRead))
 
 CaptureStrategy* capture_strategy_read_new (void);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]