Android JNI generation: Set JNI namespace in build files
This CL removes the use of the @JNINamespace annotation and instead sets the correct JNI namespace in the build file. Bug: webrtc:8278 Change-Id: Ia4490399e45a97d56b02c260fd80df4edfa092bf Reviewed-on: https://webrtc-review.googlesource.com/76440 Commit-Queue: Magnus Jedvert <magjed@webrtc.org> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23299}
This commit is contained in:
committed by
Commit Bot
parent
7e6fcea7de
commit
c7da266cb8
@ -18,7 +18,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
enum AudioDeviceMessageType : uint32_t {
|
||||
kMessageOutputStreamDisconnected,
|
||||
@ -241,6 +241,6 @@ void AAudioPlayer::HandleStreamDisconnected() {
|
||||
StartPlayout();
|
||||
}
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -29,7 +29,7 @@ namespace webrtc {
|
||||
class AudioDeviceBuffer;
|
||||
class FineAudioBuffer;
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
// Implements low-latency 16-bit mono PCM audio output support for Android
|
||||
// using the C based AAudio API.
|
||||
@ -146,7 +146,7 @@ class AAudioPlayer final : public AudioOutput,
|
||||
double latency_millis_ RTC_GUARDED_BY(thread_checker_aaudio_) = 0;
|
||||
};
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
enum AudioDeviceMessageType : uint32_t {
|
||||
kMessageInputStreamDisconnected,
|
||||
@ -230,6 +230,6 @@ void AAudioRecorder::HandleStreamDisconnected() {
|
||||
StartRecording();
|
||||
}
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -27,7 +27,7 @@ namespace webrtc {
|
||||
class FineAudioBuffer;
|
||||
class AudioDeviceBuffer;
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
// Implements low-latency 16-bit mono PCM audio input support for Android
|
||||
// using the C based AAudio API.
|
||||
@ -126,7 +126,7 @@ class AAudioRecorder : public AudioInput,
|
||||
bool first_data_callback_ = true;
|
||||
};
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
namespace {
|
||||
|
||||
@ -496,6 +496,6 @@ bool AAudioWrapper::OptimizeBuffers() {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
// AAudio callback interface for audio transport to/from the AAudio stream.
|
||||
// The interface also contains an error callback method for notifications of
|
||||
@ -122,7 +122,7 @@ class AAudioWrapper {
|
||||
int32_t frames_per_burst_ = 0;
|
||||
};
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
const int kDefaultSampleRate = 44100;
|
||||
// Delay estimates for the two different supported modes. These values are based
|
||||
@ -25,7 +25,7 @@ const int kDefaultSampleRate = 44100;
|
||||
const int kLowLatencyModeDelayEstimateInMilliseconds = 50;
|
||||
const int kHighLatencyModeDelayEstimateInMilliseconds = 150;
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
|
||||
@ -20,8 +20,7 @@
|
||||
#include "system_wrappers/include/metrics.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
namespace {
|
||||
|
||||
@ -632,6 +631,5 @@ rtc::scoped_refptr<AudioDeviceModule> CreateAudioDeviceModuleFromInputAndOutput(
|
||||
playout_delay_ms, std::move(audio_input), std::move(audio_output));
|
||||
}
|
||||
|
||||
} // namespace android_adm
|
||||
|
||||
} // namespace jni
|
||||
} // namespace webrtc
|
||||
|
||||
@ -18,8 +18,7 @@
|
||||
#include "sdk/android/native_api/jni/scoped_java_ref.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
class AudioInput {
|
||||
public:
|
||||
@ -91,7 +90,7 @@ rtc::scoped_refptr<AudioDeviceModule> CreateAudioDeviceModuleFromInputAndOutput(
|
||||
std::unique_ptr<AudioInput> audio_input,
|
||||
std::unique_ptr<AudioOutput> audio_output);
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
namespace {
|
||||
// Scoped class which logs its time of life as a UMA statistic. It generates
|
||||
@ -243,6 +243,6 @@ void AudioRecordJni::DataIsRecorded(JNIEnv* env,
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
// Implements 16-bit mono PCM audio input support for Android using the Java
|
||||
// AudioRecord interface. Most of the work is done by its Java counterpart in
|
||||
@ -131,7 +131,7 @@ class AudioRecordJni : public AudioInput {
|
||||
AudioDeviceBuffer* audio_device_buffer_;
|
||||
};
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
ScopedJavaLocalRef<jobject> AudioTrackJni::CreateJavaWebRtcAudioTrack(
|
||||
JNIEnv* env,
|
||||
@ -216,6 +216,6 @@ void AudioTrackJni::GetPlayoutData(JNIEnv* env,
|
||||
RTC_DCHECK_EQ(length, bytes_per_frame * samples);
|
||||
}
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
// Implements 16-bit mono PCM audio output support for Android using the Java
|
||||
// AudioTrack interface. Most of the work is done by its Java counterpart in
|
||||
@ -123,7 +123,7 @@ class AudioTrackJni : public AudioOutput {
|
||||
AudioDeviceBuffer* audio_device_buffer_;
|
||||
};
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
|
||||
@ -28,22 +28,20 @@ static jlong JNI_JavaAudioDeviceModule_CreateAudioDeviceModule(
|
||||
jboolean j_use_stereo_output) {
|
||||
AudioParameters input_parameters;
|
||||
AudioParameters output_parameters;
|
||||
android_adm::GetAudioParameters(env, j_context, j_audio_manager, sample_rate,
|
||||
j_use_stereo_input, j_use_stereo_output,
|
||||
&input_parameters, &output_parameters);
|
||||
auto audio_input = rtc::MakeUnique<android_adm::AudioRecordJni>(
|
||||
env, input_parameters,
|
||||
android_adm::kHighLatencyModeDelayEstimateInMilliseconds,
|
||||
GetAudioParameters(env, j_context, j_audio_manager, sample_rate,
|
||||
j_use_stereo_input, j_use_stereo_output, &input_parameters,
|
||||
&output_parameters);
|
||||
auto audio_input = rtc::MakeUnique<AudioRecordJni>(
|
||||
env, input_parameters, kHighLatencyModeDelayEstimateInMilliseconds,
|
||||
j_webrtc_audio_record);
|
||||
auto audio_output = rtc::MakeUnique<android_adm::AudioTrackJni>(
|
||||
env, output_parameters, j_webrtc_audio_track);
|
||||
return jlongFromPointer(
|
||||
CreateAudioDeviceModuleFromInputAndOutput(
|
||||
AudioDeviceModule::kAndroidJavaAudio, j_use_stereo_input,
|
||||
j_use_stereo_output,
|
||||
android_adm::kHighLatencyModeDelayEstimateInMilliseconds,
|
||||
std::move(audio_input), std::move(audio_output))
|
||||
.release());
|
||||
auto audio_output = rtc::MakeUnique<AudioTrackJni>(env, output_parameters,
|
||||
j_webrtc_audio_track);
|
||||
return jlongFromPointer(CreateAudioDeviceModuleFromInputAndOutput(
|
||||
AudioDeviceModule::kAndroidJavaAudio,
|
||||
j_use_stereo_input, j_use_stereo_output,
|
||||
kHighLatencyModeDelayEstimateInMilliseconds,
|
||||
std::move(audio_input), std::move(audio_output))
|
||||
.release());
|
||||
}
|
||||
|
||||
} // namespace jni
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
// Returns a string representation given an integer SL_RESULT_XXX code.
|
||||
// The mapping can be found in <SLES/OpenSLES.h>.
|
||||
@ -140,6 +140,6 @@ SLObjectItf OpenSLEngineManager::GetOpenSLEngine() {
|
||||
return engine_object_.Get();
|
||||
}
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
// Returns a string representation given an integer SL_RESULT_XXX code.
|
||||
// The mapping can be found in <SLES/OpenSLES.h>.
|
||||
@ -83,7 +83,7 @@ class OpenSLEngineManager {
|
||||
ScopedSLObjectItf engine_object_;
|
||||
};
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
OpenSLESPlayer::OpenSLESPlayer(
|
||||
const AudioParameters& audio_parameters,
|
||||
@ -441,6 +441,6 @@ SLuint32 OpenSLESPlayer::GetPlayState() const {
|
||||
return state;
|
||||
}
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -29,7 +29,7 @@ namespace webrtc {
|
||||
|
||||
class FineAudioBuffer;
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
// Implements 16-bit mono PCM audio output support for Android using the
|
||||
// C based OpenSL ES API. No calls from C/C++ to Java using JNI is done.
|
||||
@ -188,7 +188,7 @@ class OpenSLESPlayer : public AudioOutput {
|
||||
uint32_t last_play_time_;
|
||||
};
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
OpenSLESRecorder::OpenSLESRecorder(const AudioParameters& audio_parameters,
|
||||
OpenSLEngineManager* engine_manager)
|
||||
@ -441,6 +441,6 @@ SLuint32 OpenSLESRecorder::GetBufferCount() {
|
||||
return state.count;
|
||||
}
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -29,7 +29,7 @@ namespace webrtc {
|
||||
|
||||
class FineAudioBuffer;
|
||||
|
||||
namespace android_adm {
|
||||
namespace jni {
|
||||
|
||||
// Implements 16-bit mono PCM audio input support for Android using the
|
||||
// C based OpenSL ES API. No calls from C/C++ to Java using JNI is done.
|
||||
@ -185,7 +185,7 @@ class OpenSLESRecorder : public AudioInput {
|
||||
uint32_t last_rec_time_;
|
||||
};
|
||||
|
||||
} // namespace android_adm
|
||||
} // namespace jni
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user