[xiph-commits] r18044 - in trunk/ogg: doc/libogg include/ogg src

gmaxwell at svn.xiph.org gmaxwell at svn.xiph.org
Mon Aug 1 10:55:20 PDT 2011


Author: gmaxwell
Date: 2011-08-01 10:55:20 -0700 (Mon, 01 Aug 2011)
New Revision: 18044

Added:
   trunk/ogg/doc/libogg/ogg_stream_flush_fill.html
Modified:
   trunk/ogg/include/ogg/ogg.h
   trunk/ogg/src/framing.c
Log:
Add ogg_stream_flush_fill to compliment ogg_stream_pageout_fill because ogg_stream_flush will produce multiple pages when >4096 bytes and >4 packets are available.

Added: trunk/ogg/doc/libogg/ogg_stream_flush_fill.html
===================================================================
--- trunk/ogg/doc/libogg/ogg_stream_flush_fill.html	                        (rev 0)
+++ trunk/ogg/doc/libogg/ogg_stream_flush_fill.html	2011-08-01 17:55:20 UTC (rev 18044)
@@ -0,0 +1,69 @@
+<html>
+
+<head>
+<title>libogg - function - ogg_stream_flush_fill</title>
+<link rel=stylesheet href="style.css" type="text/css">
+</head>
+
+<body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff">
+<table border=0 width=100%>
+<tr>
+<td><p class=tiny>libogg documentation</p></td>
+<td align=right><p class=tiny>libogg release 1.2.1 - 20101029</p></td>
+</tr>
+</table>
+
+<h1>ogg_stream_flush_fill</h1>
+
+<p><i>declared in "ogg/ogg.h";</i></p>
+
+<p>This function checks for remaining packets inside the stream and forces remaining packets into a page, regardless of the size of the page.
+<p>This should only be used when you want to flush an undersized page from the middle of the stream.  Otherwise, <a href="ogg_stream_pageout.html">ogg_stream_pageout</a> or <a href="ogg_stream_pageout_fill.html">ogg_stream_pageout_fill</a>should always be used.  
+<p>This function can be used to verify that all packets have been flushed.  If the return value is 0, all packets have been placed into a page.
+
+<br><br>
+<table border=0 color=black cellspacing=0 cellpadding=7>
+<tr bgcolor=#cccccc>
+	<td>
+<pre><b>
+int ogg_stream_flush_fill(<a href="ogg_stream_state.html">ogg_stream_state</a> *os, <a href="ogg_page.html">ogg_page</a> *og, int fillbytes);
+</b></pre>
+	</td>
+</tr>
+</table>
+
+<h3>Parameters</h3>
+<dl>
+<dt><i>os</i></dt>
+<dd>Pointer to a previously declared <a href="ogg_stream_state.html">ogg_stream_state</a> struct, which represents the current logical bitstream.</dd>
+<dt><i>og</i></dt>
+<dd>Pointer to a page of data.  The remaining packets in the stream will be placed into this page, if any remain.
+<dt><i>fillbytes</i></dt>
+<dd>Packet data watermark in bytes.</dd>
+</dl>
+
+
+<h3>Return Values</h3>
+<blockquote>
+<li>0 means that all packet data has already been flushed into pages, and there are no packets to put into the page.  0 is also returned in the case of an <a href="ogg_stream_state.html">ogg_stream_state</a> that has been cleared explicitly or implicitly due to an internal error.</li>
+<li>
+Nonzero means that remaining packets have successfully been flushed into the page.</li>
+</blockquote>
+<p>
+
+<br><br>
+<hr noshade>
+<table border=0 width=100%>
+<tr valign=top>
+<td><p class=tiny>copyright &copy; 2000-2010 Xiph.Org</p></td>
+<td align=right><p class=tiny><a href="http://www.xiph.org/ogg/">Ogg Container Format</a></p></td>
+</tr><tr>
+<td><p class=tiny>libogg documentation</p></td>
+<td align=right><p class=tiny>libogg release 1.2.1 - 20101029</p></td>
+</tr>
+</table>
+
+
+</body>
+
+</html>

Modified: trunk/ogg/include/ogg/ogg.h
===================================================================
--- trunk/ogg/include/ogg/ogg.h	2011-08-01 15:38:19 UTC (rev 18043)
+++ trunk/ogg/include/ogg/ogg.h	2011-08-01 17:55:20 UTC (rev 18044)
@@ -161,6 +161,7 @@
 extern int      ogg_stream_pageout(ogg_stream_state *os, ogg_page *og);
 extern int      ogg_stream_pageout_fill(ogg_stream_state *os, ogg_page *og, int nfill);
 extern int      ogg_stream_flush(ogg_stream_state *os, ogg_page *og);
+extern int      ogg_stream_flush_fill(ogg_stream_state *os, ogg_page *og, int nfill);
 
 /* Ogg BITSTREAM PRIMITIVES: decoding **************************/
 

Modified: trunk/ogg/src/framing.c
===================================================================
--- trunk/ogg/src/framing.c	2011-08-01 15:38:19 UTC (rev 18043)
+++ trunk/ogg/src/framing.c	2011-08-01 17:55:20 UTC (rev 18044)
@@ -518,6 +518,14 @@
   return ogg_stream_flush_i(os,og,1,4096);
 }
 
+/* Like the above, but an argument is provided to adjust the nominal 
+page size for applications which are smart enough to provide their
+own delay based flushing */
+
+int ogg_stream_flush_fill(ogg_stream_state *os,ogg_page *og, int nfill){
+  return ogg_stream_flush_i(os,og,1,nfill);
+}
+
 /* This constructs pages from buffered packet segments.  The pointers
 returned are to static buffers; do not free. The returned buffers are
 good only until the next call (using the same ogg_stream_state) */



More information about the commits mailing list