changeset in /hg/pulseaudio: 2008-09-10 Omair Majid <omajid at redh...
Omair Majid
omajid at redhat.com
Thu Sep 11 07:05:45 PDT 2008
changeset 81eff60b8606 in /hg/pulseaudio
details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=81eff60b8606
description:
2008-09-10 Omair Majid <omajid at redhat.com>
* src/java/org/classpath/icedtea/pulseaudio/Stream.java
(playbackStartedCallback): Removed assert.
* src/native/org_classpath_icedtea_pulseaudio_Stream.c
(stream_started_callback): Uncommented this function.
(Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1new):
Added a stream_started_callback as a callback handler.
diffstat:
2 files changed, 28 insertions(+), 35 deletions(-)
src/java/org/classpath/icedtea/pulseaudio/Stream.java | 5 -
src/native/org_classpath_icedtea_pulseaudio_Stream.c | 58 +++++++----------
diffs (159 lines):
diff -r 83ebae76a9a9 -r 81eff60b8606 src/java/org/classpath/icedtea/pulseaudio/Stream.java
--- a/src/java/org/classpath/icedtea/pulseaudio/Stream.java Wed Sep 10 10:28:43 2008 -0400
+++ b/src/java/org/classpath/icedtea/pulseaudio/Stream.java Wed Sep 10 11:00:26 2008 -0400
@@ -123,8 +123,8 @@ public class Stream {
private List<MovedListener> movedListeners;
private List<SuspendedListener> suspendedListeners;
- private native void native_pa_stream_new(byte[] contextPointer, String name,
- String format, int sampleRate, int channels);
+ private native void native_pa_stream_new(byte[] contextPointer,
+ String name, String format, int sampleRate, int channels);
private native int native_pa_stream_get_state();
@@ -572,7 +572,6 @@ public class Stream {
*/
@SuppressWarnings("unused")
private void playbackStartedCallback() {
- assert (false);
synchronized (playbackStartedListeners) {
for (PlaybackStartedListener listener : playbackStartedListeners) {
listener.update();
diff -r 83ebae76a9a9 -r 81eff60b8606 src/native/org_classpath_icedtea_pulseaudio_Stream.c
--- a/src/native/org_classpath_icedtea_pulseaudio_Stream.c Wed Sep 10 10:28:43 2008 -0400
+++ b/src/native/org_classpath_icedtea_pulseaudio_Stream.c Wed Sep 10 11:00:26 2008 -0400
@@ -152,23 +152,23 @@ static void stream_underflow_callback(pa
}
// requires pulseaudio 0.9.11 :(
-/*
- static void stream_started_callback(pa_stream *p, void *userdata) {
- printf("stream_started_callback called\n");
- java_context* context = userdata;
- assert(stream);
- assert(context);
- assert(context->env);
- assert(context->obj);
-
- if (pa_stream_get_state(stream) == PA_STREAM_CREATING) {
- callJavaVoidMethod(context->env, context->obj, "playbackStartedCallback");
- } else {
- callJavaVoidMethod(pulse_thread_env, context->obj, "playbackStartedCallback");
- }
-
- }
- */
+static void stream_started_callback(pa_stream *stream, void *userdata) {
+ // printf("stream_started_callback called\n");
+ java_context* context = userdata;
+ assert(stream);
+ assert(context);
+ assert(context->env);
+ assert(context->obj);
+
+ if (pa_stream_get_state(stream) == PA_STREAM_CREATING) {
+ callJavaVoidMethod(context->env, context->obj,
+ "playbackStartedCallback");
+ } else {
+ callJavaVoidMethod(pulse_thread_env, context->obj,
+ "playbackStartedCallback");
+ }
+
+}
static void stream_latency_update_callback(pa_stream *stream, void *userdata) {
// printf("stream_latency_update_callback called\n");
@@ -221,7 +221,6 @@ static void stream_suspended_callback(pa
}
-
/*
* Class: org_classpath_icedtea_pulseaudio_Stream
* Method: native_pa_stream_new
@@ -229,7 +228,7 @@ static void stream_suspended_callback(pa
*/
JNIEXPORT void JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1new
(JNIEnv* env, jobject obj, jbyteArray contextPointer, jstring nameString,
-jstring encodingString, jint sampleRate, jint channels) {
+ jstring encodingString, jint sampleRate, jint channels) {
// printf("creating a new PulseAudio stream\n");
@@ -291,7 +290,7 @@ jstring encodingString, jint sampleRate,
pa_stream_set_read_callback (stream, stream_read_callback, j_context);
pa_stream_set_overflow_callback (stream, stream_overflow_callback, j_context);
pa_stream_set_underflow_callback (stream, stream_underflow_callback, j_context);
- // pa_stream_set_started_callback (stream, stream_started_callback, j_context);
+ pa_stream_set_started_callback (stream, stream_started_callback, j_context);
pa_stream_set_latency_update_callback (stream, stream_latency_update_callback, j_context);
pa_stream_set_moved_callback (stream, stream_moved_callback, j_context);
pa_stream_set_suspended_callback (stream, stream_suspended_callback, j_context);
@@ -310,7 +309,6 @@ JNIEXPORT jint JNICALL Java_org_classpat
return pa_stream_get_state(stream);
}
-
/*
* Class: org_classpath_icedtea_pulseaudio_Stream
* Method: native_pa_stream_get_context
@@ -376,17 +374,16 @@ JNIEXPORT jint JNICALL Java_org_classpat
return pa_stream_is_suspended(stream);
}
-
/*
* Class: org_classpath_icedtea_pulseaudio_Stream
* Method: native_pa_stream_connect_playback
* Signature: (Ljava/lang/String;IIIIII[B[B)I
*/
JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1connect_1playback
-(JNIEnv* env, jobject obj, jstring device, jint bufferMaxLength,
- jint bufferTargetLength, jint bufferPreBuffering,
- jint bufferMinimumRequest, jint bufferFragmentSize, jint flags,
- jbyteArray volumePointer, jbyteArray sync_streamPointer) {
+(JNIEnv* env, jobject obj, jstring device, jint bufferMaxLength,
+ jint bufferTargetLength, jint bufferPreBuffering,
+ jint bufferMinimumRequest, jint bufferFragmentSize, jint flags,
+ jbyteArray volumePointer, jbyteArray sync_streamPointer) {
pa_stream* stream = (pa_stream*) getJavaPointer(env, obj, "streamPointer");
@@ -430,9 +427,9 @@ JNIEXPORT jint JNICALL Java_org_classpat
*/
JNIEXPORT jint JNICALL Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1connect_1record
(JNIEnv* env, jobject obj, jstring device, jint bufferMaxLength,
- jint bufferTargetLength, jint bufferPreBuffereing,
- jint bufferMinimumRequest, jint bufferFragmentSize, jint flags,
- jbyteArray volumePointer, jbyteArray sync_streamPointer) {
+ jint bufferTargetLength, jint bufferPreBuffereing,
+ jint bufferMinimumRequest, jint bufferFragmentSize, jint flags,
+ jbyteArray volumePointer, jbyteArray sync_streamPointer) {
pa_stream* stream = (pa_stream*)getJavaPointer(env, obj, "streamPointer");
assert(stream);
@@ -659,7 +656,6 @@ static void trigger_callback(pa_stream*
}
-
/*
* Class: org_classpath_icedtea_pulseaudio_Stream
* Method: native_pa_stream_trigger
@@ -680,7 +676,6 @@ static void set_name_callback(pa_stream*
notifyWaitingOperations(env);
}
-
/*
* Class: org_classpath_icedtea_pulseaudio_Stream
@@ -818,7 +813,6 @@ static void set_buffer_attr_callback(pa_
}
-
/*
* Class: org_classpath_icedtea_pulseaudio_Stream
* Method: native_pa_stream_set_buffer_attr
More information about the distro-pkg-dev
mailing list