Stop using deprecated constraints-based version of CreateAudioSource.
Also did some slight refactoring of the code that turns constraints into rtc::Optionals. Used a template method to avoid code duplication, and used the same pattern for "CopyConstraintsIntoAudioOptions" as was being used for "CopyConstraintsIntoRtcConfiguration". BUG=webrtc:6752 Review-Url: https://codereview.webrtc.org/2628523003 Cr-Commit-Position: refs/heads/master@{#16063}
This commit is contained in:
@ -1442,8 +1442,10 @@ JOW(jlong, PeerConnectionFactory_nativeCreateAudioSource)(
|
||||
new ConstraintsWrapper(jni, j_constraints));
|
||||
rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
|
||||
factoryFromJava(native_factory));
|
||||
cricket::AudioOptions options;
|
||||
CopyConstraintsIntoAudioOptions(constraints.get(), &options);
|
||||
rtc::scoped_refptr<AudioSourceInterface> source(
|
||||
factory->CreateAudioSource(constraints.get()));
|
||||
factory->CreateAudioSource(options));
|
||||
return (jlong)source.release();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user