Giter Club home page Giter Club logo

Comments (1)

grebulon avatar grebulon commented on July 23, 2024

The native cc code for DataIsRecorded is defined as:

{"nativeDataIsRecorded", "(IJ)V", reinterpret_cast<void*>(&webrtc::AudioRecordJni::DataIsRecorded)}};

JNI_FUNCTION_ALIGN void JNICALL AudioRecordJni::DataIsRecorded(JNIEnv* env, jobject obj, jint length, jlong nativeAudioRecord)

The arguments are: jint length, jlong nativeAudioRecord

It is called twice:

From: ./mediasoup-client/deps/webrtc/src/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java - as:

private native void nativeDataIsRecorded(int bytes, long nativeAudioRecord);

From: ./mediasoup-client/deps/webrtc/src/sdk/android/src/java/org/webrtc/audio/WebRtcAudioRecord.java - as:

private native void nativeDataIsRecorded(long nativeAudioRecordJni, int bytes);

In the second case, the arguments are reversed: long nativeAudioRecordJni, int bytes.

Same goes for GetPlayoutData:

{"nativeGetPlayoutData", "(IJ)V", reinterpret_cast<void*>(&webrtc::AudioTrackJni::GetPlayoutData)}};

JNI_FUNCTION_ALIGN void JNICALL AudioTrackJni::GetPlayoutData(JNIEnv* env, jobject obj, jint length, jlong nativeAudioTrack)

Called properly from: ./mediasoup-client/deps/webrtc/src/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java - as:

private native void nativeGetPlayoutData(int bytes, long nativeAudioRecord);

From: ./mediasoup-client/deps/webrtc/src/sdk/android/src/java/org/webrtc/audio/WebRtcAudioTrack.java - as (wrong order):

private static native void nativeGetPlayoutData(long nativeAudioTrackJni, int bytes);

from mediasoup-client-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.