-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor modifications to Android build and samples to match new documentation #4271
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a3b13c6
To streamline the command, also clean swig and pjsua jni output direc…
bennylp 0985367
Kotlin sample: add account, modify video size and bandwidth, and audi…
bennylp 2bf934e
Android CLI app: fix armeabi hardcoded arch and also copy stdc++.so
bennylp 4d7e797
Merge branch 'master' into android-doc
bennylp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,10 +20,15 @@ import java.lang.ref.WeakReference | |
/* Configs */ | ||
|
||
// Account ID | ||
const val ACC_ID_URI = "sip:localhost" | ||
const val ACC_DOMAIN = "pjsip.org" | ||
const val ACC_USER = "101" | ||
const val ACC_PASSWD = "" | ||
const val ACC_ID_URI = "Kotlin <sip:" + ACC_USER + "@" + ACC_DOMAIN + ">" | ||
const val ACC_REGISTRAR = "sip:sip.pjsip.org;transport=tls" | ||
const val ACC_PROXY = "sip:sip.pjsip.org;lr;transport=tls" | ||
|
||
// Peer to call | ||
const val CALL_DST_URI = "sip:192.168.1.9:6000" | ||
const val CALL_DST_URI = "MicroSIP <sip:[email protected]>" | ||
|
||
// Camera ID used for video call. | ||
// Use VidDevManager::enumDev2() to get available cameras & IDs. | ||
|
@@ -273,8 +278,18 @@ class MainActivity : AppCompatActivity(), android.os.Handler.Callback { | |
g.ep.transportCreate(pjsip_transport_type_e.PJSIP_TRANSPORT_UDP, | ||
sipTpConfig) | ||
|
||
g.ep.transportCreate(pjsip_transport_type_e.PJSIP_TRANSPORT_TLS, | ||
TransportConfig()) | ||
|
||
val accCfg = AccountConfig() | ||
accCfg.idUri = ACC_ID_URI | ||
accCfg.regConfig.registrarUri = ACC_REGISTRAR | ||
accCfg.sipConfig.authCreds.add( | ||
AuthCredInfo("Digest", "*", ACC_USER, 0, | ||
ACC_PASSWD) | ||
) | ||
accCfg.sipConfig.proxies.add( ACC_PROXY ) | ||
|
||
accCfg.videoConfig.autoShowIncoming = true | ||
accCfg.videoConfig.autoTransmitOutgoing = true | ||
accCfg.videoConfig.defaultCaptureDevice = VIDEO_CAPTURE_DEVICE_ID | ||
|
@@ -291,6 +306,14 @@ class MainActivity : AppCompatActivity(), android.os.Handler.Callback { | |
} | ||
findViewById<TextView>(R.id.text_info).text = "Library started" | ||
|
||
/* Prioritize AMR-WB */ | ||
try { | ||
g.ep.codecSetPriority("AMR-WB", 255) | ||
g.ep.codecSetPriority("AMR/8000", 254) | ||
} catch (e: Exception) { | ||
println(e) | ||
} | ||
|
||
/* Fix camera orientation to portrait mode (for front camera) */ | ||
try { | ||
g.ep.vidDevManager().setCaptureOrient(VIDEO_CAPTURE_DEVICE_ID, | ||
|
@@ -306,8 +329,10 @@ class MainActivity : AppCompatActivity(), android.os.Handler.Callback { | |
} | ||
} | ||
var vcp = g.ep.getVideoCodecParam(codecId) | ||
vcp.encFmt.width = 240 | ||
vcp.encFmt.height = 320 | ||
vcp.encFmt.width = 480 | ||
vcp.encFmt.height = 640 | ||
vcp.encFmt.avgBps = 1024000 | ||
vcp.encFmt.maxBps = 5000000 | ||
g.ep.setVideoCodecParam(codecId, vcp) | ||
} catch (e: Exception) { | ||
println(e) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usually we use test account here ("test"), also for the destination
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used three accounts for the doc, hence I thought using 102-103 has better symmetry to it.