changeset in /hg/pulseaudio: 2008-09-22 Omair Majid <omajid at redh...

Omair Majid omajid at redhat.com
Mon Sep 22 11:44:45 PDT 2008


changeset 11a52266951f in /hg/pulseaudio
details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=11a52266951f
description:
	2008-09-22 Omair Majid <omajid at redhat.com>

	    * src/native/org_classpath_icedtea_pulseaudio_Stream.c
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1unref):
	    Use the constant STREAM_POINTER instead of the string "streamPointer".
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1state):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1context):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1index):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1device_1index):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1device_1name):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1is_1suspended):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1connect_1playback):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1connect_1record):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1disconnect):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1write):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1read):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1peek):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1drop):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1writable_1size):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1readable_1size):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1drain):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1is_1corked):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1cork):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1flush):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1trigger):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1set_1name):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1time):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1latency):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1sample_1spec):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1buffer_1attr):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1set_1buffer_1attr):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1update_1sample_1rate):
	    Likewise.
	    (Java_org_classpath_icedtea_pulseaudio_Stream_native_1setVolume):
	    Likewise.

diffstat:

1 file changed, 31 insertions(+), 29 deletions(-)
src/native/org_classpath_icedtea_pulseaudio_Stream.c |   60 +++++++++---------

diffs (267 lines):

diff -r 3fc512ee667f -r 11a52266951f src/native/org_classpath_icedtea_pulseaudio_Stream.c
--- a/src/native/org_classpath_icedtea_pulseaudio_Stream.c	Fri Sep 19 17:13:44 2008 -0400
+++ b/src/native/org_classpath_icedtea_pulseaudio_Stream.c	Mon Sep 22 14:10:35 2008 -0400
@@ -306,8 +306,10 @@ JNIEXPORT void JNICALL Java_org_classpat
  */
 JNIEXPORT void JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1unref
 (JNIEnv* env, jobject obj) {
-	pa_stream* stream = getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = getJavaPointer(env, obj, STREAM_POINTER);
+	assert(stream);
 	pa_stream_unref(stream);
+	setJavaPointer(env, obj, "streamPointer", NULL);
 }
 
 /*
@@ -317,7 +319,7 @@ JNIEXPORT void JNICALL Java_org_classpat
  */
 JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1state
 (JNIEnv* env, jobject obj) {
-	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	return pa_stream_get_state(stream);
 }
@@ -330,7 +332,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl
 JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1context
 (JNIEnv* env, jobject obj) {
 
-	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	pa_context* context = pa_stream_get_context(stream);
 	assert(context);
@@ -344,7 +346,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl
  */
 JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1index
 (JNIEnv* env, jobject obj) {
-	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	return pa_stream_get_index(stream);
 }
@@ -356,7 +358,7 @@ JNIEXPORT jint JNICALL Java_org_classpat
  */
 JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1device_1index
 (JNIEnv* env, jobject obj) {
-	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	return pa_stream_get_device_index(stream);
 }
@@ -368,7 +370,7 @@ JNIEXPORT jint JNICALL Java_org_classpat
  */
 JNIEXPORT jstring JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1device_1name
 (JNIEnv* env, jobject obj) {
-	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	const char* name = pa_stream_get_device_name(stream);
 	assert(name);
@@ -382,7 +384,7 @@ JNIEXPORT jstring JNICALL Java_org_class
  */
 JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1is_1suspended
 (JNIEnv* env, jobject obj) {
-	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	return pa_stream_is_suspended(stream);
 }
@@ -398,7 +400,7 @@ JNIEXPORT jint JNICALL Java_org_classpat
 		jint bufferMinimumRequest, jint bufferFragmentSize, jint flags,
 		jbyteArray volumePointer, jbyteArray sync_streamPointer) {
 
-	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER);
 
 	pa_buffer_attr buffer_attr;
 
@@ -444,7 +446,7 @@ JNIEXPORT jint JNICALL Java_org_classpat
 		jint bufferMinimumRequest, jint bufferFragmentSize, jint flags,
 		jbyteArray volumePointer, jbyteArray sync_streamPointer) {
 
-	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 
 	pa_buffer_attr buffer_attr;
@@ -485,7 +487,7 @@ JNIEXPORT jint JNICALL Java_org_classpat
  */
 JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1disconnect
 (JNIEnv* env, jobject obj) {
-	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	int return_value = pa_stream_disconnect(stream);
 
@@ -499,7 +501,7 @@ JNIEXPORT jint JNICALL Java_org_classpat
  */
 JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1write
 (JNIEnv* env, jobject obj, jbyteArray data, jint offset, jint data_length) {
-	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	jbyte* data_buffer = (*env)->GetByteArrayElements(env, data, NULL);
 	if (data_buffer == NULL) {
@@ -513,7 +515,7 @@ JNIEXPORT jint JNICALL Java_org_classpat
 
 JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1read
 (JNIEnv *env, jobject obj, jbyteArray array, jint length, jint offset) {
-	pa_stream *stream = getJavaPointer(env, obj, "streamPointer");
+	pa_stream *stream = getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	const void *read_data = NULL;
 	size_t read_length = 0;
@@ -535,7 +537,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl
 JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1peek
 (JNIEnv* env, jobject obj) {
 
-	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	const void* startLocation;
 	size_t count;
@@ -562,7 +564,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl
  */
 JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1drop
 (JNIEnv* env, jobject obj) {
-	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	return pa_stream_drop(stream);
 }
@@ -574,7 +576,7 @@ JNIEXPORT jint JNICALL Java_org_classpat
  */
 JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1writable_1size
 (JNIEnv* env, jobject obj) {
-	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	size_t size = pa_stream_writable_size(stream);
 	return size;
@@ -588,7 +590,7 @@ JNIEXPORT jint JNICALL Java_org_classpat
  */
 JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1readable_1size
 (JNIEnv* env, jobject obj) {
-	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	return pa_stream_readable_size(stream);
 }
@@ -609,7 +611,7 @@ static void drain_callback(pa_stream* st
  */
 JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1drain
 (JNIEnv* env, jobject obj) {
-	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	pa_operation* operation = pa_stream_drain(stream, drain_callback, NULL);
 	assert(operation);
@@ -623,7 +625,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl
  */
 JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1is_1corked
 (JNIEnv* env, jobject obj) {
-	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	return pa_stream_is_corked(stream);
 }
@@ -642,7 +644,7 @@ static void cork_callback(pa_stream* str
  */
 JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1cork
 (JNIEnv* env, jobject obj, jint yes) {
-	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	pa_operation* operation = pa_stream_cork(stream, yes, cork_callback, NULL);
 	assert(operation);
@@ -664,7 +666,7 @@ static void flush_callback(pa_stream* st
  */
 JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1flush
 (JNIEnv* env, jobject obj) {
-	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	pa_operation* operation = pa_stream_flush(stream, flush_callback, NULL);
 	assert(operation);
@@ -686,7 +688,7 @@ static void trigger_callback(pa_stream* 
  */
 JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1trigger
 (JNIEnv* env, jobject obj) {
-	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	pa_operation* operation = pa_stream_trigger(stream, trigger_callback, NULL);
 	assert(operation);
@@ -707,7 +709,7 @@ static void set_name_callback(pa_stream*
  */
 JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1set_1name
 (JNIEnv* env, jobject obj, jstring newName) {
-	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 
 	const char* name;
@@ -730,7 +732,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl
  */
 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");
+	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 
 	pa_usec_t time = 0;
@@ -748,7 +750,7 @@ JNIEXPORT jlong JNICALL Java_org_classpa
  */
 JNIEXPORT jlong JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1latency
 (JNIEnv* env, jobject obj) {
-	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	pa_usec_t returnValue = 0;
 	int negative = 0;
@@ -765,7 +767,7 @@ JNIEXPORT jlong JNICALL Java_org_classpa
  */
 JNIEXPORT jobject JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1get_1sample_1spec
 (JNIEnv* env, jobject obj) {
-	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 
 	const pa_sample_spec* sample_spec = pa_stream_get_sample_spec(stream);
@@ -801,7 +803,7 @@ JNIEXPORT jobject JNICALL Java_org_class
 
 	//	printf("in native_pa_stream_get_buffer_attributes");
 
-	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	const pa_buffer_attr* buffer = pa_stream_get_buffer_attr(stream);
 	assert(buffer);
@@ -844,7 +846,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl
 JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1set_1buffer_1attr
 (JNIEnv* env, jobject obj, jobject bufferAttributeObject) {
 
-	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 
 	jclass cls = (*env)->GetObjectClass(env, bufferAttributeObject);
@@ -904,7 +906,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl
 
 	uint32_t rate = (uint32_t) newRate;
 
-	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer");
+	pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 	pa_operation* operation = pa_stream_update_sample_rate(stream,rate, update_sample_rate_callback, NULL);
 	assert(operation);
@@ -919,7 +921,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_cl
  */
 JNIEXPORT jbyteArray JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1setVolume
 (JNIEnv *env, jobject obj, jfloat new_volume) {
-	pa_stream *stream = getJavaPointer(env, obj, "streamPointer");
+	pa_stream *stream = getJavaPointer(env, obj, STREAM_POINTER);
 	assert(stream);
 
 	pa_context *context = pa_stream_get_context(stream);



More information about the distro-pkg-dev mailing list