changeset in /hg/pulseaudio: 2008-08-18 Omair Majid <omajid at redh...

Omair Majid omajid at redhat.com
Wed Aug 27 09:05:25 PDT 2008


changeset 9a23cb09d073 in /hg/pulseaudio
details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=9a23cb09d073
description:
	2008-08-18 Omair Majid <omajid at redhat.com>

	* src/java/org/classpath/icedtea/pulseaudio/Stream.java
	(native_pa_stream_get_time): New function.
	(getTime): Return the time provided by PulseAudio.
	* src/native/org_classpath_icedtea_pulseaudio_Stream.c
	(Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1time):
	New function.

diffstat:

2 files changed, 28 insertions(+), 11 deletions(-)
src/java/org/classpath/icedtea/pulseaudio/Stream.java |   21 ++++++++---------
src/native/org_classpath_icedtea_pulseaudio_Stream.c  |   18 ++++++++++++++

diffs (71 lines):

diff -r 23ff317f0c99 -r 9a23cb09d073 src/java/org/classpath/icedtea/pulseaudio/Stream.java
--- a/src/java/org/classpath/icedtea/pulseaudio/Stream.java	Mon Aug 18 15:36:12 2008 -0400
+++ b/src/java/org/classpath/icedtea/pulseaudio/Stream.java	Mon Aug 18 15:53:50 2008 -0400
@@ -131,14 +131,11 @@ public class Stream {
 	/* returns an operationPointer */
 	private native long native_pa_stream_set_name(String name);
 
-	/*
-	 * Return the current playback/recording time private native int
-	 * native_pa_stream_get_time (pa_usec_t r_usec);
-	 */
+	/* Return the current playback/recording time */
+	private native long native_pa_stream_get_time();
 
 	/* Return the total stream latency */
-	 private native long native_pa_stream_get_latency();
-	 
+	private native long native_pa_stream_get_latency();
 
 	/*
 	 * const pa_timing_info * pa_stream_get_timing_info (pa_stream *s) Return
@@ -574,14 +571,16 @@ public class Stream {
 		return setNameOperation;
 	}
 
-	public long getTimeInMicroseconds() {
-		return -1;
-	}
-
+	public long getTime() {
+		return native_pa_stream_get_time();
+	}
+
+
+	
 	/**
 	 * @returns the total stream latency in microseconds
 	 */
-	public long  getLatency() {
+	public long getLatency() {
 		return native_pa_stream_get_latency();
 	}
 
diff -r 23ff317f0c99 -r 9a23cb09d073 src/native/org_classpath_icedtea_pulseaudio_Stream.c
--- a/src/native/org_classpath_icedtea_pulseaudio_Stream.c	Mon Aug 18 15:36:12 2008 -0400
+++ b/src/native/org_classpath_icedtea_pulseaudio_Stream.c	Mon Aug 18 15:53:50 2008 -0400
@@ -565,6 +565,24 @@ JNIEXPORT jlong JNICALL Java_org_classpa
 
 /*
  * Class:     org_classpath_icedtea_pulseaudio_Stream
+ * Method:    native_pa_stream_get_time
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1time
+(JNIEnv* env, jobject obj) {
+	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer");
+	assert(stream);
+
+	pa_usec_t time = 0;
+	int result = pa_stream_get_time (stream,&time);
+	assert(result == 0);
+
+	return time;
+
+}
+
+/*
+ * Class:     org_classpath_icedtea_pulseaudio_Stream
  * Method:    native_pa_stream_get_latency
  * Signature: ()J
  */



More information about the distro-pkg-dev mailing list