[xiph-commits] r3795 - in liboggz/trunk: include/oggz src/liboggz

conrad at svn.annodex.net conrad at svn.annodex.net
Wed Nov 19 14:13:18 PST 2008


Author: conrad
Date: 2008-11-19 14:13:18 -0800 (Wed, 19 Nov 2008)
New Revision: 3795

Modified:
   liboggz/trunk/include/oggz/oggz_seek.h
   liboggz/trunk/src/liboggz/Version_script.in
   liboggz/trunk/src/liboggz/oggz_auto.c
   liboggz/trunk/src/liboggz/oggz_private.h
   liboggz/trunk/src/liboggz/oggz_stream.c
Log:
add API functions for getting and seting preroll:
oggz_get_preroll(), oggz_set_preroll()
Set preroll in oggz_auto.c for vorbis and speex


Modified: liboggz/trunk/include/oggz/oggz_seek.h
===================================================================
--- liboggz/trunk/include/oggz/oggz_seek.h	2008-11-17 23:35:56 UTC (rev 3794)
+++ liboggz/trunk/include/oggz/oggz_seek.h	2008-11-19 22:13:18 UTC (rev 3795)
@@ -259,6 +259,30 @@
  */
 
 /**
+ * Retrieve the preroll of a logical bitstream.
+ * \param oggz An OGGZ handle
+ * \param serialno Identify the logical bitstream in \a oggz
+ * \returns The preroll of the specified logical bitstream.
+ * \retval OGGZ_ERR_BAD_SERIALNO \a serialno does not identify an existing
+ * logical bitstream in \a oggz.
+ * \retval OGGZ_ERR_BAD_OGGZ \a oggz does not refer to an existing OGGZ
+ */
+int oggz_get_preroll (OGGZ * oggz, long serialno);
+
+/**
+ * Specify the preroll of a logical bitstream.
+ * \param oggz An OGGZ handle
+ * \param serialno Identify the logical bitstream in \a oggz to attach
+ * this preroll to.
+ * \param preroll The preroll
+ * \returns 0 Success
+ * \retval OGGZ_ERR_BAD_SERIALNO \a serialno does not identify an existing
+ * logical bitstream in \a oggz.
+ * \retval OGGZ_ERR_BAD_OGGZ \a oggz does not refer to an existing OGGZ
+ */
+int oggz_set_preroll (OGGZ * oggz, long serialno, int preroll);
+
+/**
  * Retrieve the granuleshift of a logical bitstream.
  * \param oggz An OGGZ handle
  * \param serialno Identify the logical bitstream in \a oggz

Modified: liboggz/trunk/src/liboggz/Version_script.in
===================================================================
--- liboggz/trunk/src/liboggz/Version_script.in	2008-11-17 23:35:56 UTC (rev 3794)
+++ liboggz/trunk/src/liboggz/Version_script.in	2008-11-19 22:13:18 UTC (rev 3795)
@@ -38,6 +38,8 @@
 		oggz_get_granulerate;
 		oggz_set_granuleshift;
 		oggz_get_granuleshift;
+		oggz_set_preroll;
+		oggz_get_preroll;
 
 		oggz_tell;
                 oggz_tell_granulepos;

Modified: liboggz/trunk/src/liboggz/oggz_auto.c
===================================================================
--- liboggz/trunk/src/liboggz/oggz_auto.c	2008-11-17 23:35:56 UTC (rev 3794)
+++ liboggz/trunk/src/liboggz/oggz_auto.c	2008-11-19 22:13:18 UTC (rev 3795)
@@ -94,6 +94,8 @@
 
   oggz_set_granulerate (oggz, serialno, granule_rate, OGGZ_AUTO_MULT);
 
+  oggz_set_preroll (oggz, serialno, 3);
+
   numheaders = (ogg_int64_t) INT32_LE_AT(&header[68]) + 2;
   oggz_stream_set_numheaders (oggz, serialno, numheaders);
 
@@ -115,6 +117,8 @@
 
   oggz_set_granulerate (oggz, serialno, granule_rate, OGGZ_AUTO_MULT);
 
+  oggz_set_preroll (oggz, serialno, 2);
+
   oggz_stream_set_numheaders (oggz, serialno, 3);
 
   return 1;

Modified: liboggz/trunk/src/liboggz/oggz_private.h
===================================================================
--- liboggz/trunk/src/liboggz/oggz_private.h	2008-11-17 23:35:56 UTC (rev 3794)
+++ liboggz/trunk/src/liboggz/oggz_private.h	2008-11-19 22:13:18 UTC (rev 3795)
@@ -279,9 +279,11 @@
                                     ogg_int64_t * granulerate_d);
 
 int oggz_set_granuleshift (OGGZ * oggz, long serialno, int granuleshift);
-
 int oggz_get_granuleshift (OGGZ * oggz, long serialno);
 
+int oggz_set_preroll (OGGZ * oggz, long serialno, int preroll);
+int oggz_get_preroll (OGGZ * oggz, long serialno);
+
 /* oggz_auto */
  
 int

Modified: liboggz/trunk/src/liboggz/oggz_stream.c
===================================================================
--- liboggz/trunk/src/liboggz/oggz_stream.c	2008-11-17 23:35:56 UTC (rev 3794)
+++ liboggz/trunk/src/liboggz/oggz_stream.c	2008-11-19 22:13:18 UTC (rev 3795)
@@ -86,3 +86,30 @@
   return stream->numheaders;
 }
 
+int
+oggz_set_preroll (OGGZ * oggz, long serialno, int preroll)
+{
+  oggz_stream_t * stream;
+
+  if (oggz == NULL) return OGGZ_ERR_BAD_OGGZ;
+
+  stream = oggz_get_stream (oggz, serialno);
+  if (stream == NULL) return OGGZ_ERR_BAD_SERIALNO;
+
+  stream->preroll = preroll;
+
+  return 0;
+}
+
+int
+oggz_get_preroll (OGGZ * oggz, long serialno)
+{
+  oggz_stream_t * stream;
+
+  if (oggz == NULL) return OGGZ_ERR_BAD_OGGZ;
+
+  stream = oggz_get_stream (oggz, serialno);
+  if (stream == NULL) return OGGZ_ERR_BAD_SERIALNO;
+
+  return stream->preroll;
+}



More information about the commits mailing list