Commit 45cf51e6 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev
Browse files

introduced back and bumped the version ti 1.3.3

parent 9cfcd99c
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
[Dolphin]
SortOrder=1
Timestamp=2019,7,25,12,34,14
Version=3
ViewMode=1
+70 −0
Original line number Original line Diff line number Diff line
--- ./src/framing.c	2005-11-27 21:26:05.000000000 -0700
+++ ./src/framing.c	2007-11-11 13:36:15.000000000 -0700
@@ -315,6 +315,67 @@
 
   return(0);
 }
+#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)
+//int ogg_stream_packetin(ogg_stream_state *os,ogg_packet *op){
+  int ogg_stream_packetin_elph(ogg_stream_state *os, elph_ogg_packet *op) {
+
+  int lacing_vals=op->bytes/255+1,i;
+
+  if(os->body_returned){
+    /* advance packet data according to the body_returned pointer. We
+       had to keep it around to return a pointer into the buffer last
+       call */
+    
+    os->body_fill-=os->body_returned;
+    if(os->body_fill)
+      memmove(os->body_data,os->body_data+os->body_returned,
+	      os->body_fill);
+    os->body_returned=0;
+  }
+ 
+  /* make sure we have the buffer storage */
+  _os_body_expand(os,op->bytes);
+  _os_lacing_expand(os,lacing_vals);
+
+  /*! Copy in the submitted packet.  Yes, the copy is a waste; this is
+     the liability of overly clean abstraction for the time being.  It
+     will actually be fairly easy to eliminate the extra copy in the
+     future */
+//  memcpy(os->body_data+os->body_fill,op->packet,op->bytes);
+//  os->body_fill+=op->bytes;
+  long bytes_left=op->bytes;
+  int  chunk_index=0;
+  while (bytes_left>0) {
+    memcpy(os->body_data+os->body_fill,op->packet[chunk_index].chunk,op->packet[chunk_index].bytes);
+    os->body_fill+=op->packet[chunk_index].bytes;
+    bytes_left-=op->packet[chunk_index].bytes;
+    chunk_index++;
+  }
+
+  /* Store lacing vals for this packet */
+  for(i=0;i<lacing_vals-1;i++){
+    os->lacing_vals[os->lacing_fill+i]=255;
+    os->granule_vals[os->lacing_fill+i]=os->granulepos;
+  }
+  os->lacing_vals[os->lacing_fill+i]=(op->bytes)%255;
+  os->granulepos=os->granule_vals[os->lacing_fill+i]=op->granulepos;
+
+  /* flag the first segment as the beginning of the packet */
+  os->lacing_vals[os->lacing_fill]|= 0x100;
+
+  os->lacing_fill+=lacing_vals;
+
+  /* for the sake of completeness */
+  os->packetno++;
+
+  if(op->e_o_s)os->e_o_s=1;
+
+  return(0);
+}
+#endif
+
 
 /* This will flush remaining packets into a page (returning nonzero),
    even if there is not enough data to trigger a flush normally
+52 −0
Original line number Original line Diff line number Diff line
--- ./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,
+4 −0
Original line number Original line Diff line number Diff line
FILESEXTRAPATHS_prepend := "${THISDIR}/files:" 

SRC_URI_append +=   "file://framing.c.patch \
                    file://ogg.h.patch"
 No newline at end of file