[xiph-cvs] cvs commit: ogg/src framing.c

Monty xiphmont at xiph.org
Mon Oct 9 22:42:35 PDT 2000



xiphmont    00/10/09 22:42:35

  Modified:    .        README
               include/ogg ogg.h
               src      framing.c
  Log:
  Added 'ogg_page_packets()' call.  See source for comment documentation.
  
  Monty

Revision  Changes    Path
1.4       +60 -1     ogg/README

Index: README
===================================================================
RCS file: /usr/local/cvsroot/ogg/README,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- README	2000/09/05 21:02:42	1.3
+++ README	2000/10/10 05:42:33	1.4
@@ -1 +1,60 @@
-This is the Ogg bistream library
+********************************************************************
+*                                                                  *
+* THIS FILE IS PART OF THE Ogg BITSTREAM LAYER SOURCE CODE.        *
+* USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+* THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE.    *
+* PLEASE READ THESE TERMS DISTRIBUTING.                            *
+*                                                                  *
+* THE Ogg SOURCE CODE IS (C) COPYRIGHT 1994-2000                   *
+* by Monty <monty at xiph.org> and The XIPHOPHORUS Company            *
+* http://www.xiph.org/                                             *
+*                                                                  *
+********************************************************************
+
+WHAT'S HERE:
+
+This source distribution includes libogg and nothing else.  Other modules (eg, the modules vorbis, vorbis-tools and vorbis-plugins for the Vorbis codec) contain the codec libraries for use with Ogg bitstreams.
+
+Directory:
+
+./lib  		The source for libogg, an LGPLed inplementation of 
+		the public domain Ogg bitstream format
+
+./include       Library API headers and codebooks
+
+./debian        Rules/spec files for building Debian .deb packages
+
+./doc           Ogg specification documents
+
+WHAT IS OGG?:
+
+Ogg project codecs use the Ogg bitstream format to arrange the raw,
+compressed bitstream into a more robust, useful form.  For example,
+the Ogg bitstream makes seeking, time stamping and error recovery
+possible, as well as mixing several sepearate, concurrent media
+streams into a single physical bitstream.
+
+CONTACT:
+
+The Ogg homepage is located at 'http://www.xiph.org/ogg/'.
+Up to date technical documents, contact information, source code and
+pre-built utilities may be found there.
+
+BUILD:
+
+A standard build should consist of nothing more than:
+
+./autogen.sh
+make 
+
+and as root if desired :
+
+make install
+
+This will install the Ogg libraries (static and shared) into
+/usr/local/lib, includes into /usr/local/include and API manpages
+(once we write some) into /usr/local/man.
+
+Monty <monty at xiph.org>
+
+$Id: README,v 1.4 2000/10/10 05:42:33 xiphmont Exp $

1.6       +1 -0      ogg/include/ogg/ogg.h

Index: ogg.h
===================================================================
RCS file: /usr/local/cvsroot/ogg/include/ogg/ogg.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ogg.h	2000/09/28 05:01:56	1.5
+++ ogg.h	2000/10/10 05:42:34	1.6
@@ -145,6 +145,7 @@
 extern ogg_int64_t  ogg_page_granulepos(ogg_page *og);
 extern int      ogg_page_serialno(ogg_page *og);
 extern int      ogg_page_pageno(ogg_page *og);
+  extern int      ogg_page_packets(ogg_page *og);
 
 
 #ifdef __cplusplus

1.5       +32 -1     ogg/src/framing.c

Index: framing.c
===================================================================
RCS file: /usr/local/cvsroot/ogg/src/framing.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- framing.c	2000/09/28 05:01:56	1.4
+++ framing.c	2000/10/10 05:42:34	1.5
@@ -13,7 +13,7 @@
 
  function: code raw [Vorbis] packets into framed OggSquish stream and
            decode Ogg streams back into raw packets
- last mod: $Id: framing.c,v 1.4 2000/09/28 05:01:56 jack Exp $
+ last mod: $Id: framing.c,v 1.5 2000/10/10 05:42:34 xiphmont Exp $
 
  note: The CRC code is directly derived from public domain code by
  Ross Williams (ross at guest.adelaide.edu.au).  See docs/framing.html
@@ -35,6 +35,10 @@
   return((int)(og->header[5]&0x01));
 }
 
+int ogg_page_continued(ogg_page *og){
+  return((int)(og->header[5]&0x01));
+}
+
 int ogg_page_bos(ogg_page *og){
   return((int)(og->header[5]&0x02));
 }
@@ -69,6 +73,33 @@
          (og->header[20]<<16) |
          (og->header[21]<<24));
 }
+
+
+
+/* returns the number of packets that are completed on this page (if
+   the leading packet is begun on a previous page, but ends on this
+   page, it's counted */
+
+/* NOTE:
+If a page consists of a packet begun on a previous page, and a new
+packet begun (but not completed) on this page, the return will be:
+  ogg_page_packets(page)   ==1, 
+  ogg_page_continued(page) !=0
+
+If a page happens to be a single packet that was begun on a
+previous page, and spans to the next page (in the case of a three or
+more page packet), the return will be: 
+  ogg_page_packets(page)   ==0, 
+  ogg_page_continued(page) !=0
+*/
+
+int ogg_page_packets(ogg_page *og){
+  int i,n=og->header[26],count=0;
+  for(i=0;i<n;i++)
+    if(og->header[27+i]==0)count++;
+  return(count);
+}
+
 
 /* helper to initialize lookup for direct-table CRC */
 

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list