[xiph-commits] r8260 - in experimental/dholth/oggpy: . tests

dholth at motherfish-iii.xiph.org dholth at motherfish-iii.xiph.org
Mon Nov 22 18:15:59 PST 2004


Author: dholth
Date: 2004-11-22 18:15:58 -0800 (Mon, 22 Nov 2004)
New Revision: 8260

Added:
   experimental/dholth/oggpy/flacpy.pyste
Modified:
   experimental/dholth/oggpy/Makefile
   experimental/dholth/oggpy/README
   experimental/dholth/oggpy/config.py
   experimental/dholth/oggpy/oggcc.h
   experimental/dholth/oggpy/setup.py
   experimental/dholth/oggpy/tests/decode.py
Log:
patch-27


Modified: experimental/dholth/oggpy/Makefile
===================================================================
--- experimental/dholth/oggpy/Makefile	2004-11-23 02:13:15 UTC (rev 8259)
+++ experimental/dholth/oggpy/Makefile	2004-11-23 02:15:58 UTC (rev 8260)
@@ -17,7 +17,11 @@
 	pyste --module=theorapy --out=theorapy.cpp -I. \
 	-I$(PYTHON_HEADER_DIR) -I$(BOOST_HEADER_DIR) -I/usr/include/  theorapy.pyste
 
-module: theorapy.cpp oggpy.cpp vorbispy.cpp
+flacpy.cpp: flacpy.pyste
+	pyste --module=flacpy --out=flacpy.cpp -I. \
+	-I$(PYTHON_HEADER_DIR) -I$(BOOST_HEADER_DIR) -I/usr/include/ $<
+
+module: theorapy.cpp oggpy.cpp vorbispy.cpp flacpy.cpp
 	python ./setup.py build
 
 bridge:

Modified: experimental/dholth/oggpy/README
===================================================================
--- experimental/dholth/oggpy/README	2004-11-23 02:13:15 UTC (rev 8259)
+++ experimental/dholth/oggpy/README	2004-11-23 02:15:58 UTC (rev 8260)
@@ -40,6 +40,8 @@
 	ACCEPT_KEYWORDS=~x86 emerge theora (to manipulate theora streams)
 	pygame (to display theora)
 
+	I've also submitted an ebuild.
+
 Then use setup.py build as normal.
 
 Hopefully I'll figure out an ebuild for this.

Modified: experimental/dholth/oggpy/config.py
===================================================================
--- experimental/dholth/oggpy/config.py	2004-11-23 02:13:15 UTC (rev 8259)
+++ experimental/dholth/oggpy/config.py	2004-11-23 02:15:58 UTC (rev 8260)
@@ -17,5 +17,8 @@
 theorapy_libraries = common_libraries + ["theora"]
 theorapy_include_dirs = common_include_dirs
 
+flacpy_libraries = common_libraries + ["FLAC++", "FLAC"]
+flacpy_include_dirs = common_include_dirs
+
 bridge_libraries = common_libraries + ["SDL", "theora"]
 bridge_include_dirs = common_include_dirs + ["/usr/include/SDL"]

Added: experimental/dholth/oggpy/flacpy.pyste
===================================================================
--- experimental/dholth/oggpy/flacpy.pyste	2004-11-23 02:13:15 UTC (rev 8259)
+++ experimental/dholth/oggpy/flacpy.pyste	2004-11-23 02:15:58 UTC (rev 8260)
@@ -0,0 +1,3 @@
+
+StreamDecoder = Class("FLAC::Decoder::Stream", "FLAC++/decoder.h")
+

Modified: experimental/dholth/oggpy/oggcc.h
===================================================================
--- experimental/dholth/oggpy/oggcc.h	2004-11-23 02:13:15 UTC (rev 8259)
+++ experimental/dholth/oggpy/oggcc.h	2004-11-23 02:15:58 UTC (rev 8260)
@@ -21,7 +21,7 @@
     class packet {
         /// packet points to internal data structures.  not sure how memory management works.
         /// zero packet and free internal storage (NOT SAFE: packet points to internal oggvorbis stuff)
-        /// this method is not called in the ogg, vorbis, or ices source.
+        /// ogg_packet_clear is not called in the ogg, vorbis, or ices source.
         protected:
             void clear ( )              { ogg_packet_clear(&this->data); }
 
@@ -151,9 +151,9 @@
     /// Basic unit of ogg bitstream format.
     class page {
         private:
+            ogg_page data;
 
         public:
-            ogg_page data;  // soon to be privatized, take that social security!
             ogg_page *get_data()        { return &this->data; }
 
             /// first page in stream?
@@ -171,8 +171,8 @@
             void checksum_set ( )       { ogg_page_checksum_set(this->get_data()); }
 
             /// for encoding. concatenate header and body to form a page, pages to form ogg streams.
-            std::string header ( )      { return std::string((char*)this->data.header, (size_t)this->data.header_len); }
-            std::string body ( )        { return std::string((char*)this->data.body, (size_t)this->data.body_len); }
+            std::string header ( )      { return std::string((char*)this->data.header, (size_t)this->get_data()->header_len); }
+            std::string body ( )        { return std::string((char*)this->data.body, (size_t)this->get_data()->body_len); }
     };
 
     
@@ -201,8 +201,8 @@
             char *buffer    ( long size )     { return ogg_sync_buffer (&this->data, size); }
             int   wrote     ( long bytes )    { return ogg_sync_wrote (&this->data, bytes); }
 
-            int   pageout   ( page *og )      { return this->pageout(&og->data);  }
-            long  pageseek  ( page *og )      { return this->pageseek(&og->data); }
+            int   pageout   ( page *og )      { return this->pageout(og->get_data());  }
+            long  pageseek  ( page *og )      { return this->pageseek(og->get_data()); }
 
             /// good to call before seeking
             int   reset     ( )               { return ogg_sync_reset (&this->data); }
@@ -238,10 +238,10 @@
             int eos ( )                           { return ogg_stream_eos(&this->data); }
 
             /// use to flush a packet regardles of its size
-            int flush ( page *og )                { return this->flush(&og->data); }
+            int flush ( page *og )                { return this->flush(og->get_data()); }
 
             // decode.  copies page in?
-            int pagein  ( page *og )              { return this->pagein(&og->data); }
+            int pagein  ( page *og )              { return this->pagein(og->get_data()); }
             /// decode.  points a packet at an internal data buffer.
             int packetout   ( packet *op )        { return this->packetout(op->get_data()); }
             /** Attempt to assemble a raw data packet and return it without advancing decoding.
@@ -255,7 +255,7 @@
 
             // encode. copies submitted packet. always returns zero.
             int packetin ( packet *op )           { return this->packetin(op->get_data()); }
-            int pageout ( page *og )              { return this->pageout(&og->data); }
+            int pageout ( page *og )              { return this->pageout(og->get_data()); }
 
             /// good to call before seeking
             int reset   ( )                       { return ogg_stream_reset(&this->data); }

Modified: experimental/dholth/oggpy/setup.py
===================================================================
--- experimental/dholth/oggpy/setup.py	2004-11-23 02:13:15 UTC (rev 8259)
+++ experimental/dholth/oggpy/setup.py	2004-11-23 02:15:58 UTC (rev 8260)
@@ -22,13 +22,17 @@
 Topic :: Multimedia :: Video
 """
 
+version = "0.5"
+url = "http://dingoskidneys.com/oggpy/"
+
 setup(name="oggpy",
-      version="0.5",
+      version=version,
       description="Boost.Python and C++ wrappers of ogg, vorbis and theora",
       long_description=description,
       author="Daniel Holth",
       author_email="dholth at fastmail.fm",
-      url="http://dingoskidneys.com/oggpy/",
+      url=url,
+      download_url=url+"oggpy-"+version+".tar.gz",
       platforms="linux",
       license="MIT",
       classifiers=filter(None, classifiers.splitlines()),
@@ -47,12 +51,16 @@
                     Extension("theorapy", ["oggcc.cc", "theorapy.cpp"],
                               libraries=config.theorapy_libraries,
                               include_dirs=config.theorapy_include_dirs,
-                              depends=["oggcc.h", "theoracc.h"])
+                              depends=["oggcc.h", "theoracc.h"]),
+                    
+                    Extension("flacpy", ["flacpy.cpp"],
+                              libraries=config.flacpy_libraries,
+                              include_dirs=config.flacpy_include_dirs)
 
                     # It works!
                     , Extension("pygame_bridge", ["pygame_bridge.cc"],
-                        libraries=config.bridge_libraries,
-                        include_dirs=config.bridge_include_dirs)
+                                libraries=config.bridge_libraries,
+                                include_dirs=config.bridge_include_dirs)
 
                     ]
      )

Modified: experimental/dholth/oggpy/tests/decode.py
===================================================================
--- experimental/dholth/oggpy/tests/decode.py	2004-11-23 02:13:15 UTC (rev 8259)
+++ experimental/dholth/oggpy/tests/decode.py	2004-11-23 02:15:58 UTC (rev 8260)
@@ -5,7 +5,10 @@
 #
 # Daniel Holth <dholth at fastmail.fm>, 2004
 
-import oss
+try:
+    import oss
+except:
+    oss = None
 import sys
 import oggpy
 import vorbispy



More information about the commits mailing list