[xiph-commits] r8920 - icecast/trunk/shout-perl

brendan at motherfish-iii.xiph.org brendan at motherfish-iii.xiph.org
Mon Feb 14 12:13:01 PST 2005


Author: brendan
Date: 2005-02-14 12:13:00 -0800 (Mon, 14 Feb 2005)
New Revision: 8920

Modified:
   icecast/trunk/shout-perl/Changes
   icecast/trunk/shout-perl/Shout.pm
   icecast/trunk/shout-perl/Shout.xs
Log:
Update for libshout 2.1


Modified: icecast/trunk/shout-perl/Changes
===================================================================
--- icecast/trunk/shout-perl/Changes	2005-02-14 19:48:33 UTC (rev 8919)
+++ icecast/trunk/shout-perl/Changes	2005-02-14 20:13:00 UTC (rev 8920)
@@ -1,5 +1,8 @@
 Revision history for Perl extension Shout.
 
+2.1   Mon Feb 14 12:10:00 2004
+        - updated to libshout 2.1
+
 2.0   Sat Jul  5 14:47:00 2003
 	- full implementation
 	- backward compatible with Shout 1.0

Modified: icecast/trunk/shout-perl/Shout.pm
===================================================================
--- icecast/trunk/shout-perl/Shout.pm	2005-02-14 19:48:33 UTC (rev 8919)
+++ icecast/trunk/shout-perl/Shout.pm	2005-02-14 20:13:00 UTC (rev 8920)
@@ -13,6 +13,7 @@
 	host  		=> 'localhost',
 	port		=> 8000,
 	mount		=> 'testing',
+        nonblocking     => 0,
 	password	=> 'pa$$word!',
 	user		=> 'username',
 	dumpfile	=> undef,
@@ -31,6 +32,7 @@
   $conn->host('localhost');
   $conn->port(8000);
   $conn->mount('testing');
+  $conn->nonblocking(0);
   $conn->password('pa$$word!');
   $conn->user('username');
   $conn->dumpfile(undef);
@@ -95,6 +97,7 @@
 	shout_set_host
 	shout_set_port
 	shout_set_mount
+        shout_set_nonblocking
 	shout_set_password
 	shout_set_user
 	shout_set_icq
@@ -108,6 +111,7 @@
 	shout_get_host
 	shout_get_port
 	shout_get_mount
+        shout_get_nonblocking
 	shout_get_password
 	shout_get_user
 	shout_get_icq
@@ -126,6 +130,7 @@
 	shout_get_protocol
 	shout_set_audio_info
 	shout_get_audio_info
+        shout_queuelen
 
 They work almost identically to their libshout C counterparts. See the libshout
 documentation for more information about how to use the function interface.
@@ -159,7 +164,7 @@
 BEGIN {
     use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD);
 
-    $VERSION = '2.0.2';
+    $VERSION = '2.1';
 
     use Carp;
 
@@ -178,7 +183,7 @@
         SHOUT_AI_CHANNELS
 	SHOUTERR_SUCCESS SHOUTERR_INSANE SHOUTERR_NOCONNECT SHOUTERR_NOLOGIN 
 	SHOUTERR_SOCKET SHOUTERR_MALLOC SHOUTERR_METADATA SHOUTERR_CONNECTED 
-	SHOUTERR_UNCONNECTED SHOUTERR_UNSUPPORTED 
+	SHOUTERR_UNCONNECTED SHOUTERR_UNSUPPORTED SHOUTERR_BUSY
     };
     @EXPORT_OK = qw{
 	SHOUT_FORMAT_VORBIS SHOUT_FORMAT_MP3
@@ -187,10 +192,10 @@
         SHOUT_AI_CHANNELS
 	SHOUTERR_SUCCESS SHOUTERR_INSANE SHOUTERR_NOCONNECT SHOUTERR_NOLOGIN 
 	SHOUTERR_SOCKET SHOUTERR_MALLOC SHOUTERR_METADATA SHOUTERR_CONNECTED 
-	SHOUTERR_UNCONNECTED SHOUTERR_UNSUPPORTED 
+	SHOUTERR_UNCONNECTED SHOUTERR_UNSUPPORTED SHOUTERR_BUSY
 	shout_open shout_close
 	shout_set_metadata shout_metadata_new shout_metadata_free 
-	shout_metadata_add shout_send_data shout_sync shout_delay
+	shout_metadata_add shout_send_data shout_sync shout_delay shout_queuelen
 	shout_set_host shout_set_port shout_set_mount shout_set_password
 	shout_set_user shout_set_dumpfile shout_set_name
 	shout_set_url shout_set_genre shout_set_description
@@ -201,6 +206,7 @@
 	shout_get_public shout_get_error shout_set_format shout_get_format
 	shout_get_audio_info shout_set_audio_info
 	shout_set_protocol shout_get_protocol shout_get_errno
+        shout_get_nonblocking shout_set_nonblocking
     };
     %EXPORT_TAGS = (
 	all       => \@EXPORT_OK,
@@ -210,7 +216,7 @@
             SHOUT_AI_CHANNELS
 	    SHOUTERR_SUCCESS SHOUTERR_INSANE SHOUTERR_NOCONNECT SHOUTERR_NOLOGIN 
 	    SHOUTERR_SOCKET SHOUTERR_MALLOC SHOUTERR_METADATA SHOUTERR_CONNECTED 
-	    SHOUTERR_UNCONNECTED SHOUTERR_UNSUPPORTED 
+	    SHOUTERR_UNCONNECTED SHOUTERR_UNSUPPORTED SHOUTERR_BUSY
 	}],
         functions => [qw{shout_open shout_close
             shout_set_metadata shout_metadata_add shout_metadata_new
@@ -226,6 +232,7 @@
 	    shout_get_public shout_get_error shout_get_errno
 	    shout_set_protocol shout_get_protocol
 	    shout_set_format shout_get_format
+            shout_get_nonblocking shout_set_nonblocking shout_queuelen
         }],
     );
 }
@@ -259,6 +266,7 @@
     public
     format
     protocol
+    nonblocking
 };
 
 %CompatibilityMethods = (
@@ -278,6 +286,7 @@
 ###			host		=> <destination ip address>,
 ###			port		=> <destination port>,
 ###			mount		=> <stream mountpoint>,
+###			nonblocking	=> <use nonblocking IO>,
 ###			password	=> <password to use when connecting>,
 ###			user		=> <username to use when connecting>,
 ###			dumpfile	=> <dumpfile for the stream>,
@@ -413,6 +422,15 @@
     $self->shout_delay; 
 }
 
+### METHOD: queuelen( undef )
+### Tell how many bytes of data are in the write queue. This is only
+### useful in conjunction with nonblocking sends.
+sub queuelen ($) {
+    my $self = shift or croak "delay: Method called as function";
+
+    $self->shout_queuelen;
+}
+
 ### METHOD: set_audio_info( key => val, key => val )
 ### Set audio parameters (bitrate, samplerate, channels etc) for informational
 ### purposes. Audio info is a hash using the SHOUT_AI constants as keys.
@@ -532,6 +550,10 @@
 ###	Get/set the connection's public flag. This flag, when set to true, indicates
 ###		that the stream may be listed in the public directory servers.
 
+###	METHOD: nonblocking( $boolean )
+###	Get/set the connection's nonblocking flag. This flag, when set to true, indicates
+###		that sends should complete instantly, queueing data if necessary.
+
 ### (PROXY) METHOD: AUTOLOAD( @args )
 ###	Provides a proxy for functions and methods which aren't explicitly defined.
 sub AUTOLOAD {

Modified: icecast/trunk/shout-perl/Shout.xs
===================================================================
--- icecast/trunk/shout-perl/Shout.xs	2005-02-14 19:48:33 UTC (rev 8919)
+++ icecast/trunk/shout-perl/Shout.xs	2005-02-14 20:13:00 UTC (rev 8920)
@@ -57,10 +57,12 @@
      return SHOUTERR_UNCONNECTED;
    if (strEQ(name,"SHOUTERR_UNSUPPORTED"))
      return SHOUTERR_UNSUPPORTED;
+   if (strEQ(name,"SHOUTERR_BUSY"))
+     return SHOUTERR_BUSY;
    if (strEQ(name, "SHOUT_FORMAT_MP3"))
      return SHOUT_FORMAT_MP3;
-   if (strEQ(name, "SHOUT_FORMAT_VORBIS"))
-     return SHOUT_FORMAT_VORBIS;
+   if (strEQ(name, "SHOUT_FORMAT_OGG") || strEQ(name, "SHOUT_FORMAT_VORBIS"))
+     return SHOUT_FORMAT_OGG;
    if (strEQ(name, "SHOUT_PROTOCOL_ICY"))
      return SHOUT_PROTOCOL_ICY;
    if (strEQ(name, "SHOUT_PROTOCOL_XAUDIOCAST"))
@@ -127,6 +129,11 @@
 	char *str
 
 void
+shout_set_nonblocking(self, num)
+	shout_t *self
+	int num
+
+void
 shout_set_password(self, str)
 	shout_t *self
 	char *str
@@ -178,6 +185,10 @@
 shout_get_mount(self)
 	shout_t *self
 
+int
+shout_get_nonblocking(self)
+	shout_t* self
+
 const char *
 shout_get_password(self)
 	shout_t *self
@@ -266,6 +277,10 @@
        shout_t *self
 
 int
+shout_queuelen(self)
+	shout_t* self
+
+int
 shout_set_audio_info(self, name, value)
        shout_t *self
        const char *name



More information about the commits mailing list