gegl r1983 - in trunk: . operations/io operations/workshop



Author: ok
Date: Sat Feb  9 19:53:36 2008
New Revision: 1983
URL: http://svn.gnome.org/viewvc/gegl?rev=1983&view=rev

Log:
* operations/io/pixbuf.c: modified to be capable of receiving varying
pixbufs and invalidate properly.
* operations/workshop/ff-save.c: indentation improvement.


Modified:
   trunk/ChangeLog
   trunk/operations/io/pixbuf.c
   trunk/operations/workshop/ff-save.c

Modified: trunk/operations/io/pixbuf.c
==============================================================================
--- trunk/operations/io/pixbuf.c	(original)
+++ trunk/operations/io/pixbuf.c	Sat Feb  9 19:53:36 2008
@@ -44,6 +44,13 @@
   return result;
 }
 
+static void prepare (GeglOperation *operation)
+{
+  GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+  gegl_operation_set_format (operation, "output", 
+      babl_format(gdk_pixbuf_get_has_alpha(o->pixbuf)?"R'G'B'A u8":"R'G'B' u8"));
+}
+
 static gboolean
 process (GeglOperation       *operation,
          GeglNodeContext     *context,
@@ -57,11 +64,11 @@
       GeglRectangle extent = {0,0,
                               gdk_pixbuf_get_width (o->pixbuf),
                               gdk_pixbuf_get_height (o->pixbuf)};
-      GeglBuffer *output = gegl_buffer_new (&extent,
-  babl_format(gdk_pixbuf_get_has_alpha(o->pixbuf)?"R'G'B'A u8":"R'G'B' u8"));
+      /*GeglBuffer *output = gegl_buffer_new (&extent,
+      babl_format(gdk_pixbuf_get_has_alpha(o->pixbuf)?"R'G'B'A u8":"R'G'B' u8"));*/
       gegl_buffer_set (output, NULL, NULL, gdk_pixbuf_get_pixels (o->pixbuf),
                        GEGL_AUTO_ROWSTRIDE);
-      gegl_node_context_set_object (context, "output", G_OBJECT (output));
+      /*gegl_node_context_set_object (context, "output", G_OBJECT (output));*/
     }
   return TRUE;
 }
@@ -76,8 +83,11 @@
   operation_class = GEGL_OPERATION_CLASS (klass);
   source_class    = GEGL_OPERATION_SOURCE_CLASS (klass);
 
+  /*source_class->process = process;*/
   source_class->process = process;
   operation_class->get_defined_region = get_defined_region;
+  operation_class->prepare = prepare;
+  /*operation_class->no_cache = TRUE;*/
 
   operation_class->name        = "pixbuf";
   operation_class->categories  = "programming:input";

Modified: trunk/operations/workshop/ff-save.c
==============================================================================
--- trunk/operations/workshop/ff-save.c	(original)
+++ trunk/operations/workshop/ff-save.c	Sat Feb  9 19:53:36 2008
@@ -53,15 +53,16 @@
   int       frame_count, video_outbuf_size;
 
 
-    /** the rest is for audio handling within oxide, note that the interface used
-     *  passes all used functions in the oxide api through the reg_sym api of gggl,
-     *  this means that the ops should be usable by other applications using gggl
-     *  directly,. without needing to link with the oxide library
+    /** the rest is for audio handling within oxide, note that the interface
+     * used passes all used functions in the oxide api through the reg_sym api
+     * of gggl, this means that the ops should be usable by other applications
+     * using gggl directly,. without needing to link with the oxide library
      */
 
   AVStream *audio_st;
 
-  void     *oxide_audio_instance;       /*< non NULL audio_query,. means audio present */
+  void     *oxide_audio_instance;  
+  /*< non NULL audio_query,. means audio present */
 
   int32_t (*oxide_audio_query) (void *audio_instance,
                                 uint32_t * sample_rate,
@@ -70,8 +71,9 @@
                                 uint32_t * fragment_samples,
                                 uint32_t * fragment_size);
 
-  /* get audio samples for the current video frame, this should provide all audiosamples
-   * associated with the frame, frame centering on audio stream is undefined (FIXME:<<)
+  /* get audio samples for the current video frame, this should provide all
+   * audiosamples associated with the frame, frame centering on audio stream is
+   * undefined (FIXME:<<)
    */
 
   int32_t (*oxide_audio_get_fragment) (void *audio_instance, uint8_t * buf);
@@ -87,9 +89,10 @@
   int       buffer_size;
   int       buffer_read_pos;
   int       buffer_write_pos;
-  uint8_t  *buffer;             /* optimal buffer size should be calculated,. preferably run time,. no magic numbers
-                                   needed for the filewrite case, perhaps a tiny margin for ntsc since it has
-                                   a strange framerate */
+  uint8_t  *buffer;   /* optimal buffer size should be calculated,. preferably
+                         run time,. no magic numbers needed for the filewrite
+                         case, perhaps a tiny margin for ntsc since it has a
+                         strange framerate */
 
   int       audio_outbuf_size;
   int       audio_input_frame_size;



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