[xiph-cvs] cvs commit: ogg-python/src _oggmodule.c _oggmodule.h pyoggpackbuff.c pyoggsyncstate.c pyoggsyncstate.h pyoggpack.c

Andrew Catham Master of Python andrew at xiph.org
Sat Mar 17 18:46:13 PST 2001



andrew      01/03/17 18:46:13

  Modified:    .        ChangeLog MANIFEST.in
               src      _oggmodule.c _oggmodule.h pyoggpackbuff.c
                        pyoggsyncstate.c pyoggsyncstate.h
  Removed:     src      pyoggpack.c
  Log:
  3-17-2001 Andrew H. Chatham <andrew.chatham at duke.edu>
          * src/_oggmodule.c: Remove dependency on Vorbis
  
          * src/pyoggpackbuff.c: More PackBuff methods
  
          * src/pyoggsyncstate.c: Simple SyncState methods.
  
          * src/pyoggpack.c: Removed
  
          * src/_oggmodule.c: Added ability to create OggPackBuff object

Revision  Changes    Path
1.2       +11 -0     ogg-python/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /usr/local/cvsroot/ogg-python/ChangeLog,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ChangeLog	2001/02/06 03:18:19	1.1
+++ ChangeLog	2001/03/18 02:46:12	1.2
@@ -1,3 +1,14 @@
+3-17-2001 Andrew H. Chatham <andrew.chatham at duke.edu>
+	* src/_oggmodule.c: Remove dependency on Vorbis
+
+	* src/pyoggpackbuff.c: More PackBuff methods
+
+	* src/pyoggsyncstate.c: Simple SyncState methods.
+
+	* src/pyoggpack.c: Removed
+
+	* src/_oggmodule.c: Added ability to create OggPackBuff object
+	
 1-17-2001 Andrew H. Chatham <andrew.chatham at duke.edu>
         * src/audiofilemodule.c
           src/audioread.c

1.3       +2 -1      ogg-python/MANIFEST.in

Index: MANIFEST.in
===================================================================
RCS file: /usr/local/cvsroot/ogg-python/MANIFEST.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MANIFEST.in	2001/02/19 06:00:56	1.2
+++ MANIFEST.in	2001/03/18 02:46:12	1.3
@@ -2,4 +2,5 @@
 recursive-include src/ *.c *.h *.py
 recursive-include test/ *.py 
 recursive-include include/ *.h
-recursive-include debian
+recursive-include debian/ *
+prune debian/CVS

1.2       +3 -1      ogg-python/src/_oggmodule.c

Index: _oggmodule.c
===================================================================
RCS file: /usr/local/cvsroot/ogg-python/src/_oggmodule.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- _oggmodule.c	2001/02/06 03:18:19	1.1
+++ _oggmodule.c	2001/03/18 02:46:12	1.2
@@ -1,4 +1,3 @@
-#include <vorbis/codec.h>
 #include <pyogg/pyogg.h>
 
 #include "general.h"
@@ -6,10 +5,13 @@
 
 #include "pyoggstreamstate.h"
 #include "pyoggpacket.h"
+#include "pyoggpackbuff.h"
 
 static PyMethodDef Ogg_methods[] = {
   {"OggStreamState", py_ogg_stream_state_new, 
    METH_VARARGS, py_ogg_stream_state_doc},
+  {"OggPackBuff", py_oggpack_buffer_new,
+   METH_VARARGS, py_oggpack_buffer_doc},
   {NULL, NULL}
 };
 

1.2       +1 -0      ogg-python/src/_oggmodule.h

Index: _oggmodule.h
===================================================================
RCS file: /usr/local/cvsroot/ogg-python/src/_oggmodule.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- _oggmodule.h	2001/02/06 03:18:19	1.1
+++ _oggmodule.h	2001/03/18 02:46:12	1.2
@@ -8,5 +8,6 @@
 /* Object docstrings */
 
 extern char py_ogg_stream_state_doc[];
+extern char py_oggpack_buffer_doc[];
 
 #endif /* __OGGMODULE_H__ */

1.2       +143 -15   ogg-python/src/pyoggpackbuff.c

Index: pyoggpackbuff.c
===================================================================
RCS file: /usr/local/cvsroot/ogg-python/src/pyoggpackbuff.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pyoggpackbuff.c	2001/02/06 03:18:19	1.1
+++ pyoggpackbuff.c	2001/03/18 02:46:12	1.2
@@ -6,18 +6,29 @@
                          OggPackBuffer Object
  ************************************************************/
 
-/* TODO : Actually add methods to this object and a way to create one! */
-
 char py_oggpack_buffer_doc[] = "";
 
 static void py_oggpack_buffer_dealloc(py_oggpack_buffer *);
 static PyObject* py_oggpack_buffer_getattr(PyObject *, char *);
+
+FDEF(oggpack_reset) "";
+FDEF(oggpack_writeclear) "";
+
+FDEF(oggpack_look) "";
+FDEF(oggpack_look_huff) "";
+FDEF(oggpack_look1) "";
 
-FDEF(oggpack_buffer_read) "Return the value of n bits";
+FDEF(oggpack_bytes) "";
+FDEF(oggpack_bits) "";
 
-FDEF(oggpack_buffer_adv) "Advance the read location by n bits";
+FDEF(oggpack_read) "Return the value of n bits";
+FDEF(oggpack_read1) "";
 
-FDEF(oggpack_buffer_write) "Write bits to the buffer.\n\n\
+FDEF(oggpack_adv) "Advance the read location by n bits";
+FDEF(oggpack_adv_huff) "";
+FDEF(oggpack_adv1) "";
+
+FDEF(oggpack_write) "Write bits to the buffer.\n\n\
 The first parameterf is an integer from which the bits will be extracted.\n\
 The second parameter is the number of bits to write (defaults to 32)";
 
@@ -51,12 +62,32 @@
 };
 
 static PyMethodDef py_oggpack_buffer_methods[] = {
-  {"read", py_oggpack_buffer_read,
-   METH_VARARGS, py_oggpack_buffer_read_doc},
-  {"write", py_oggpack_buffer_write,
-   METH_VARARGS, py_oggpack_buffer_write_doc},
-  {"adv", py_oggpack_buffer_adv,
-   METH_VARARGS, py_oggpack_buffer_adv_doc},
+  {"reset", py_oggpack_reset,
+   METH_VARARGS, py_oggpack_reset_doc},
+  {"writeclear", py_oggpack_writeclear,
+   METH_VARARGS, py_oggpack_writeclear_doc},
+  {"look", py_oggpack_look,
+   METH_VARARGS, py_oggpack_look_doc},
+  {"look_huff", py_oggpack_look_huff,
+   METH_VARARGS, py_oggpack_look_huff_doc},
+  {"look1", py_oggpack_look1,
+   METH_VARARGS, py_oggpack_look1_doc},
+  {"bytes", py_oggpack_bytes,
+   METH_VARARGS, py_oggpack_bytes_doc},
+  {"bits", py_oggpack_bits,
+   METH_VARARGS, py_oggpack_bits_doc},
+  {"read", py_oggpack_read,
+   METH_VARARGS, py_oggpack_read_doc},
+  {"read1", py_oggpack_read1,
+   METH_VARARGS, py_oggpack_read1_doc},
+  {"write", py_oggpack_write,
+   METH_VARARGS, py_oggpack_write_doc},
+  {"adv", py_oggpack_adv,
+   METH_VARARGS, py_oggpack_adv_doc},
+  {"adv_huff", py_oggpack_adv_huff,
+   METH_VARARGS, py_oggpack_adv_huff_doc},
+  {"adv1", py_oggpack_adv1,
+   METH_VARARGS, py_oggpack_adv1_doc},
   {NULL, NULL}
 };
 
@@ -85,9 +116,77 @@
   return (PyObject *)ret;
 }
 
+static PyObject *
+py_oggpack_reset(PyObject *self, PyObject *args)
+{
+  oggpack_reset(PY_OGGPACK_BUFF(self));
+}
+
+static PyObject *
+py_oggpack_writeclear(PyObject *self, PyObject *args)
+{
+  oggpack_writeclear(PY_OGGPACK_BUFF(self));
+}
+
+static PyObject *
+py_oggpack_look(PyObject *self, PyObject *args) 
+{
+  int bits = 32;
+  long ret;
+  if (!PyArg_ParseTuple(args, "l", &bits))
+    return NULL;
+
+  if (bits > 32) {
+    PyErr_SetString(PyExc_ValueError, "Cannot look at more than 32 bits");
+    return NULL;
+  }
+
+  ret = oggpack_look(PY_OGGPACK_BUFF(self), bits);
+  return PyLong_FromLong(ret);
+}
+
+static PyObject *
+py_oggpack_look_huff(PyObject *self, PyObject *args) 
+{
+  int bits = 8;
+  long ret;
+  if (!PyArg_ParseTuple(args, "l", &bits))
+    return NULL;
+
+  if (bits > 8) {
+    PyErr_SetString(PyExc_ValueError, "Cannot look at more than 8 bits");
+    return NULL;
+  }
+
+  ret = oggpack_look_huff(PY_OGGPACK_BUFF(self), bits);
+  return PyLong_FromLong(ret);
+}
+
 static PyObject *
-py_oggpack_buffer_write(PyObject *self, PyObject *args) 
+py_oggpack_look1(PyObject *self, PyObject *args) 
 {
+  long ret;
+  ret = oggpack_look1(PY_OGGPACK_BUFF(self));
+  return PyLong_FromLong(ret);
+}
+
+static PyObject *
+py_oggpack_bytes(PyObject *self, PyObject *args)
+{
+  long ret = oggpack_bytes(PY_OGGPACK_BUFF(self));
+  return PyLong_FromLong(ret);
+}
+
+static PyObject *
+py_oggpack_bits(PyObject *self, PyObject *args)
+{
+  long ret = oggpack_bits(PY_OGGPACK_BUFF(self));
+  return PyLong_FromLong(ret);
+}
+
+static PyObject *
+py_oggpack_write(PyObject *self, PyObject *args) 
+{
   long val;
   int bits = 32;
 
@@ -95,7 +194,7 @@
     return NULL;
 
   if (bits > 32) {
-    PyErr_SetString(PyExc_ValueError, "Cannot read more than 32 bits");
+    PyErr_SetString(PyExc_ValueError, "Cannot write more than 32 bits");
     return NULL;
   }
 
@@ -106,7 +205,7 @@
 }
 
 static PyObject *
-py_oggpack_buffer_read(PyObject *self, PyObject *args) 
+py_oggpack_read(PyObject *self, PyObject *args) 
 {
   int bits = 32;
   long ret;
@@ -125,8 +224,15 @@
 }
 
 static PyObject *
-py_oggpack_buffer_adv(PyObject *self, PyObject *args)
+py_oggpack_read1(PyObject *self, PyObject *args)
 {
+  long ret = oggpack_read1(PY_OGGPACK_BUFF(self));
+  return PyInt_FromLong(ret);
+}
+
+static PyObject *
+py_oggpack_adv(PyObject *self, PyObject *args)
+{
   int bits;
 
   if (!PyArg_ParseTuple(args, "i", &bits))
@@ -134,6 +240,28 @@
 
   oggpack_adv(PY_OGGPACK_BUFF(self), bits);
 
+  Py_INCREF(Py_None);
+  return Py_None;
+}
+
+static PyObject *
+py_oggpack_adv_huff(PyObject *self, PyObject *args)
+{
+  int bits;
+
+  if (!PyArg_ParseTuple(args, "i", &bits))
+    return NULL;
+
+  oggpack_adv_huff(PY_OGGPACK_BUFF(self), bits);
+
+  Py_INCREF(Py_None);
+  return Py_None;
+}
+
+static PyObject *
+py_oggpack_adv1(PyObject *self, PyObject *args)
+{
+  oggpack_adv1(PY_OGGPACK_BUFF(self));
   Py_INCREF(Py_None);
   return Py_None;
 }

1.2       +32 -0     ogg-python/src/pyoggsyncstate.c

Index: pyoggsyncstate.c
===================================================================
RCS file: /usr/local/cvsroot/ogg-python/src/pyoggsyncstate.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pyoggsyncstate.c	2001/02/06 03:18:19	1.1
+++ pyoggsyncstate.c	2001/03/18 02:46:12	1.2
@@ -13,6 +13,12 @@
 static void py_ogg_sync_state_dealloc(py_ogg_sync_state *);
 static PyObject* py_ogg_sync_state_getattr(PyObject *, char *);
 
+FDEF(ogg_sync_clear) "";
+FDEF(ogg_sync_reset) "";
+FDEF(ogg_sync_wrote) "";
+FDEF(ogg_stream_pagein) "";
+FDEF(ogg_stream_packetout) "";
+
 PyTypeObject py_ogg_sync_state_type = {
   PyObject_HEAD_INIT(&PyType_Type)
   0,
@@ -43,6 +49,10 @@
 };
 
 static PyMethodDef py_ogg_sync_state_methods[] = {
+  {"reset", py_ogg_sync_reset,
+   METH_VARARGS, py_ogg_sync_reset_doc},
+  {"wrote", py_ogg_sync_wrote,
+   METH_VARARGS, py_ogg_sync_wrote_doc},
   {NULL, NULL}
 };
 
@@ -56,4 +66,26 @@
 py_ogg_sync_state_getattr(PyObject *self, char *name)
 {
   return Py_FindMethod(py_ogg_sync_state_methods, self, name);
+}
+
+static PyObject *
+py_ogg_sync_reset(PyObject *self, PyObject *args)
+{
+  int ret;
+  ret = ogg_sync_reset(PY_OGG_SYNC_STATE(self));
+  Py_INCREF(Py_None);
+  return Py_None;
+}
+
+static PyObject *
+py_ogg_sync_wrote(PyObject *self, PyObject *args)
+{
+  long bytes;
+  int ret; 
+  if (!PyArg_ParseTuple(args, "l", &bytes))
+    return NULL;
+
+  ret = ogg_sync_wrote(PY_OGG_SYNC_STATE(self), bytes);
+  Py_INCREF(Py_None);
+  return Py_None;
 }

1.2       +1 -0      ogg-python/src/pyoggsyncstate.h

Index: pyoggsyncstate.h
===================================================================
RCS file: /usr/local/cvsroot/ogg-python/src/pyoggsyncstate.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pyoggsyncstate.h	2001/02/06 03:18:19	1.1
+++ pyoggsyncstate.h	2001/03/18 02:46:12	1.2
@@ -9,6 +9,7 @@
   ogg_sync_state os;
 } py_ogg_sync_state;
 
+#define PY_OGG_SYNC_STATE(x) (&(((py_ogg_sync_state *) (x))->os))
 
 extern PyTypeObject py_ogg_sync_state_type;
 

--- >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