--- ./include/ogg/ogg.h	2005-11-27 21:26:05.000000000 -0700
+++ ./include/ogg/ogg.h	2007-11-11 13:33:16.000000000 -0700
@@ -16,7 +16,7 @@
  ********************************************************************/
 #ifndef _OGG_H
 #define _OGG_H
-
+#define ELPHEL_OGG y
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -95,6 +95,29 @@
 				(which is in a seperate abstraction
 				layer) also knows about the gap */
 } ogg_packet;
+#ifdef ELPHEL_OGG
+//! New packet structure that supports packets consisting of several memory chunks each (like MJPEG header
+//! and data in circular buffer of Elphel cameras
+typedef struct {
+  unsigned char *chunk;
+  long  bytes;
+} elph_packet_chunk;
+
+typedef struct {
+  elph_packet_chunk *packet;
+  long  bytes;
+  long  b_o_s;
+  long  e_o_s;
+
+  ogg_int64_t  granulepos;
+  
+  ogg_int64_t  packetno;     /* sequence number for decode; the framing
+				knows where there's a hole in the data,
+				but we need coupling so that the codec
+				(which is in a seperate abstraction
+				layer) also knows about the gap */
+} elph_ogg_packet;
+#endif
 
 typedef struct {
   unsigned char *data;
@@ -148,6 +171,12 @@
 /* Ogg BITSTREAM PRIMITIVES: encoding **************************/
 
+#ifdef ELPHEL_OGG
+//! Support for a packet structure to use packets consisting of several memory chunks each (like MJPEG header
+//! and data in circular buffer of Elphel cameras (for now counting on copying packets in libogg)
+extern int      ogg_stream_packetin_elph(ogg_stream_state *os, elph_ogg_packet *op);
+#endif
+
 extern int      ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op);
 extern int      ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov,