Skip to content

Commit 9a93dec

Browse files
committed
rename files.
1 parent 8414f49 commit 9a93dec

7 files changed

+92
-92
lines changed

sdk/android/BUILD.gn

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ if (is_android) {
261261
"api/org/webrtc/CryptoOptions.java",
262262
"api/org/webrtc/DataChannel.java",
263263
"api/org/webrtc/DtmfSender.java",
264-
"api/org/webrtc/ExternalAudioProcessor.java",
264+
"api/org/webrtc/ExternalAudioProcessingFactory.java",
265265
"api/org/webrtc/FecControllerFactoryFactoryInterface.java",
266266
"api/org/webrtc/FrameCryptor.java",
267267
"api/org/webrtc/FrameCryptorAlgorithm.java",
@@ -727,10 +727,11 @@ if (current_os == "linux" || is_android) {
727727
"src/jni/pc/data_channel.cc",
728728
"src/jni/pc/data_channel.h",
729729
"src/jni/pc/dtmf_sender.cc",
730-
"src/jni/pc/default_audio_processor.cc",
730+
"src/jni/pc/external_audio_processing_factory.cc",
731+
"src/jni/pc/external_audio_processing_factory.h",
732+
"src/jni/pc/external_audio_processing_interface.h",
731733
"src/jni/pc/external_audio_processor.cc",
732734
"src/jni/pc/external_audio_processor.h",
733-
"src/jni/pc/external_audio_processor_interface.h",
734735
"src/jni/pc/frame_cryptor.cc",
735736
"src/jni/pc/frame_cryptor.h",
736737
"src/jni/pc/frame_cryptor_key_provider.cc",
@@ -1419,7 +1420,7 @@ if (current_os == "linux" || is_android) {
14191420
"api/org/webrtc/CryptoOptions.java",
14201421
"api/org/webrtc/DataChannel.java",
14211422
"api/org/webrtc/DtmfSender.java",
1422-
"api/org/webrtc/ExternalAudioProcessor.java",
1423+
"api/org/webrtc/ExternalAudioProcessingFactory.java",
14231424
"api/org/webrtc/FrameCryptor.java",
14241425
"api/org/webrtc/FrameCryptorFactory.java",
14251426
"api/org/webrtc/FrameCryptorKeyProvider.java",

sdk/android/api/org/webrtc/ExternalAudioProcessor.java renamed to sdk/android/api/org/webrtc/ExternalAudioProcessingFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import org.webrtc.AudioProcessingFactory;
2323

2424

25-
public class ExternalAudioProcessor implements AudioProcessingFactory {
25+
public class ExternalAudioProcessingFactory implements AudioProcessingFactory {
2626

2727
public static interface AudioProcessing {
2828
@CalledByNative("AudioProcessing")
@@ -37,7 +37,7 @@ public static interface AudioProcessing {
3737
private long capturePostProcessingPtr;
3838
private long renderPreProcessingPtr;
3939

40-
public ExternalAudioProcessor() {
40+
public ExternalAudioProcessingFactory() {
4141
apmPtr = nativeGetDefaultApm();
4242
capturePostProcessingPtr = 0;
4343
renderPreProcessingPtr = 0;

sdk/android/src/jni/pc/default_audio_processor.cc renamed to sdk/android/src/jni/pc/external_audio_processing_factory.cc

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,18 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include "sdk/android/src/jni/pc/default_audio_processor.h"
17+
#include "sdk/android/src/jni/pc/external_audio_processing_factory.h"
1818

1919
#include <jni.h>
2020
#include <syslog.h>
2121

2222
#include "api/make_ref_counted.h"
2323
#include "rtc_base/ref_counted_object.h"
24-
#include "sdk/android/generated_peerconnection_jni/ExternalAudioProcessor_jni.h"
24+
#include "sdk/android/generated_peerconnection_jni/ExternalAudioProcessingFactory_jni.h"
2525
#include "sdk/android/native_api/jni/java_types.h"
2626
#include "sdk/android/native_api/jni/scoped_java_ref.h"
2727
#include "sdk/android/src/jni/jni_helpers.h"
2828
#include "sdk/android/src/jni/pc/external_audio_processor.h"
29-
#include "sdk/android/src/jni/pc/external_audio_processor_interface.h"
3029

3130
namespace webrtc {
3231
namespace jni {
@@ -55,7 +54,7 @@ void ExternalAudioProcessingJni::Process(int num_bans, int num_frames, int buffe
5554
Java_AudioProcessing_Process(env, j_prosessing_global_, num_bans, num_frames, audio_buffer);
5655
}
5756

58-
DefaultAudioProcessor::DefaultAudioProcessor() {
57+
ExternalAudioProcessingFactory::ExternalAudioProcessingFactory() {
5958
capture_post_processor_ = new ExternalAudioProcessor();
6059
std::unique_ptr<webrtc::CustomProcessing> capture_post_processor(
6160
capture_post_processor_);
@@ -75,17 +74,17 @@ DefaultAudioProcessor::DefaultAudioProcessor() {
7574
apm_->ApplyConfig(config);
7675
}
7776

78-
static DefaultAudioProcessor* default_processor_ptr;
77+
static ExternalAudioProcessingFactory* default_processor_ptr;
7978

80-
static jlong JNI_ExternalAudioProcessor_GetDefaultApm(JNIEnv* env) {
79+
static jlong JNI_ExternalAudioProcessingFactory_GetDefaultApm(JNIEnv* env) {
8180
if (!default_processor_ptr) {
82-
auto default_processor = rtc::make_ref_counted<DefaultAudioProcessor>();
81+
auto default_processor = rtc::make_ref_counted<ExternalAudioProcessingFactory>();
8382
default_processor_ptr = default_processor.release();
8483
}
8584
return webrtc::jni::jlongFromPointer(default_processor_ptr->apm().get());
8685
}
8786

88-
static jlong JNI_ExternalAudioProcessor_SetCapturePostProcessing(
87+
static jlong JNI_ExternalAudioProcessingFactory_SetCapturePostProcessing(
8988
JNIEnv* env,
9089
const JavaParamRef<jobject>& j_processing) {
9190
if (!default_processor_ptr) {
@@ -99,7 +98,7 @@ static jlong JNI_ExternalAudioProcessor_SetCapturePostProcessing(
9998
return jlongFromPointer(processing.get());
10099
}
101100

102-
static jlong JNI_ExternalAudioProcessor_SetRenderPreProcessing(
101+
static jlong JNI_ExternalAudioProcessingFactory_SetRenderPreProcessing(
103102
JNIEnv* env,
104103
const JavaParamRef<jobject>& j_processing) {
105104
if (!default_processor_ptr) {
@@ -113,7 +112,7 @@ static jlong JNI_ExternalAudioProcessor_SetRenderPreProcessing(
113112
return jlongFromPointer(processing.get());
114113
}
115114

116-
static void JNI_ExternalAudioProcessor_SetBypassFlagForCapturePost(
115+
static void JNI_ExternalAudioProcessingFactory_SetBypassFlagForCapturePost(
117116
JNIEnv* env,
118117
jboolean bypass) {
119118
if (!default_processor_ptr) {
@@ -122,7 +121,7 @@ static void JNI_ExternalAudioProcessor_SetBypassFlagForCapturePost(
122121
default_processor_ptr->capture_post_processor()->SetBypassFlag(bypass);
123122
}
124123

125-
static void JNI_ExternalAudioProcessor_SetBypassFlagForRenderPre(
124+
static void JNI_ExternalAudioProcessingFactory_SetBypassFlagForRenderPre(
126125
JNIEnv* env,
127126
jboolean bypass) {
128127
if (!default_processor_ptr) {
@@ -131,7 +130,7 @@ static void JNI_ExternalAudioProcessor_SetBypassFlagForRenderPre(
131130
default_processor_ptr->render_pre_processor()->SetBypassFlag(bypass);
132131
}
133132

134-
static void JNI_ExternalAudioProcessor_Destroy(JNIEnv* env) {
133+
static void JNI_ExternalAudioProcessingFactory_Destroy(JNIEnv* env) {
135134
if (!default_processor_ptr) {
136135
return;
137136
}
Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,68 @@
1-
/*
2-
* Copyright 2022 LiveKit
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
17-
#include <jni.h>
18-
19-
#define WEBRTC_APM_DEBUG_DUMP 0
20-
21-
#include "rtc_base/ref_counted_object.h"
22-
#include "sdk/android/native_api/jni/scoped_java_ref.h"
23-
#include "sdk/android/src/jni/pc/external_audio_processor.h"
24-
#include "sdk/android/src/jni/pc/external_audio_processor_interface.h"
25-
26-
namespace webrtc {
27-
namespace jni {
28-
29-
class ExternalAudioProcessingJni
30-
: public webrtc::ExternalAudioProcessorInterface,
31-
public rtc::RefCountInterface {
32-
public:
33-
ExternalAudioProcessingJni(JNIEnv* jni, const JavaRef<jobject>& j_prosessing);
34-
~ExternalAudioProcessingJni();
35-
36-
protected:
37-
virtual void Initialize(int sample_rate_hz, int num_channels) override;
38-
virtual void Reset(int new_rate) override;
39-
virtual void Process(int num_bans, int num_frames, int buffer_size, float* buffer) override;
40-
41-
private:
42-
const ScopedJavaGlobalRef<jobject> j_prosessing_global_;
43-
const ScopedJavaGlobalRef<jobject> j_prosessing_;
44-
};
45-
46-
class DefaultAudioProcessor : public rtc::RefCountInterface {
47-
public:
48-
DefaultAudioProcessor();
49-
virtual ~DefaultAudioProcessor() = default;
50-
51-
ExternalAudioProcessor* capture_post_processor() {
52-
return capture_post_processor_;
53-
}
54-
55-
ExternalAudioProcessor* render_pre_processor() {
56-
return render_pre_processor_;
57-
}
58-
59-
rtc::scoped_refptr<webrtc::AudioProcessing> apm() { return apm_; }
60-
61-
private:
62-
rtc::scoped_refptr<webrtc::AudioProcessing> apm_;
63-
ExternalAudioProcessor* capture_post_processor_;
64-
ExternalAudioProcessor* render_pre_processor_;
65-
};
66-
67-
} // namespace jni
68-
} // namespace webrtc
1+
/*
2+
* Copyright 2022 LiveKit
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#include <jni.h>
18+
19+
#define WEBRTC_APM_DEBUG_DUMP 0
20+
21+
#include "rtc_base/ref_counted_object.h"
22+
#include "sdk/android/native_api/jni/scoped_java_ref.h"
23+
#include "sdk/android/src/jni/pc/external_audio_processor.h"
24+
#include "sdk/android/src/jni/pc/external_audio_processing_interface.h"
25+
26+
namespace webrtc {
27+
namespace jni {
28+
29+
class ExternalAudioProcessingJni
30+
: public webrtc::ExternalAudioProcessingInterface,
31+
public rtc::RefCountInterface {
32+
public:
33+
ExternalAudioProcessingJni(JNIEnv* jni, const JavaRef<jobject>& j_prosessing);
34+
~ExternalAudioProcessingJni();
35+
36+
protected:
37+
virtual void Initialize(int sample_rate_hz, int num_channels) override;
38+
virtual void Reset(int new_rate) override;
39+
virtual void Process(int num_bans, int num_frames, int buffer_size, float* buffer) override;
40+
41+
private:
42+
const ScopedJavaGlobalRef<jobject> j_prosessing_global_;
43+
const ScopedJavaGlobalRef<jobject> j_prosessing_;
44+
};
45+
46+
class ExternalAudioProcessingFactory : public rtc::RefCountInterface {
47+
public:
48+
ExternalAudioProcessingFactory();
49+
virtual ~ExternalAudioProcessingFactory() = default;
50+
51+
ExternalAudioProcessor* capture_post_processor() {
52+
return capture_post_processor_;
53+
}
54+
55+
ExternalAudioProcessor* render_pre_processor() {
56+
return render_pre_processor_;
57+
}
58+
59+
rtc::scoped_refptr<webrtc::AudioProcessing> apm() { return apm_; }
60+
61+
private:
62+
rtc::scoped_refptr<webrtc::AudioProcessing> apm_;
63+
ExternalAudioProcessor* capture_post_processor_;
64+
ExternalAudioProcessor* render_pre_processor_;
65+
};
66+
67+
} // namespace jni
68+
} // namespace webrtc

sdk/android/src/jni/pc/external_audio_processor_interface.h renamed to sdk/android/src/jni/pc/external_audio_processing_interface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818

1919
namespace webrtc {
2020

21-
class ExternalAudioProcessorInterface {
21+
class ExternalAudioProcessingInterface {
2222
public:
2323
virtual void Initialize(int sample_rate_hz, int num_channels) = 0;
2424
virtual void Reset(int new_rate) = 0;
2525
virtual void Process(int num_bans, int num_frames, int buffer_size, float* buffer) = 0;
2626

2727
protected:
28-
virtual ~ExternalAudioProcessorInterface() = default;
28+
virtual ~ExternalAudioProcessingInterface() = default;
2929
};
3030

3131
} // namespace webrtc

sdk/android/src/jni/pc/external_audio_processor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
namespace webrtc {
2020

2121
void ExternalAudioProcessor::SetExternalAudioProcessing(
22-
ExternalAudioProcessorInterface* processor) {
22+
ExternalAudioProcessingInterface* processor) {
2323
webrtc::MutexLock lock(&mutex_);
2424
external_processor_ = processor;
2525
if (initialized_) {

sdk/android/src/jni/pc/external_audio_processor.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "modules/audio_processing/audio_buffer.h"
2323
#include "modules/audio_processing/audio_processing_impl.h"
2424
#include "modules/audio_processing/include/audio_processing.h"
25-
#include "sdk/android/src/jni/pc/external_audio_processor_interface.h"
25+
#include "sdk/android/src/jni/pc/external_audio_processing_interface.h"
2626

2727
namespace webrtc {
2828

@@ -32,7 +32,7 @@ class ExternalAudioProcessor : public webrtc::CustomProcessing {
3232
~ExternalAudioProcessor() override = default;
3333

3434
void SetExternalAudioProcessing(
35-
ExternalAudioProcessorInterface* processor);
35+
ExternalAudioProcessingInterface* processor);
3636

3737
void SetBypassFlag(bool bypass);
3838

@@ -45,7 +45,7 @@ class ExternalAudioProcessor : public webrtc::CustomProcessing {
4545

4646
private:
4747
mutable webrtc::Mutex mutex_;
48-
ExternalAudioProcessorInterface* external_processor_;
48+
ExternalAudioProcessingInterface* external_processor_;
4949
bool bypass_flag_;
5050
bool initialized_;
5151
int sample_rate_hz_;

0 commit comments

Comments
 (0)