-
Notifications
You must be signed in to change notification settings - Fork 0
[FEAT]: Implement stream and media handling methods #110
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
Open
Doominika
wants to merge
30
commits into
feat/implement-base-streamApi
Choose a base branch
from
feat/implement-stream-and-media-handling-methods
base: feat/implement-base-streamApi
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
87e170b
feat: add Stream class
Doominika 1603262
feat: implement listStreams method
Doominika 30c624f
feat: add StreamHandle class
Doominika 63b00da
feat: implement createStream method
Doominika 2e34cd1
feat: add DeviceType enum
Doominika 9454287
feat: add MediaDevice class
Doominika 3044b63
feat: implement getMediaDevices method
Doominika fe01e34
feat:add parser for DeviceType
Doominika 9cfc30f
feat:add parser for MediaDevice
Doominika ec6cbb2
feat:add parser for StreamHandle
Doominika c9e9491
feat: change value type in StreamHandle class
Doominika 341ca81
feat: implement addTrack method
Doominika c6813e1
feat: add nullchecks to addTrack method in jni
Doominika c1e4d54
feat: implement removeTrack method
Doominika a418de4
feat: add remoteStreamId class
Doominika 16f9956
feat: implement publishStream method
Doominika 85d498c
feat: implement unpublishStream method
Doominika d48d807
feat: implement subscribeToRemoteStreams method
Doominika f25d32d
feat: add StreamSettings
Doominika 29889d0
feat: add Settings
Doominika 0d80b30
feat: add OnFrameCallback
Doominika e2e28d0
feat: add StreamSubscription
Doominika aa31b24
feat: add Frame
Doominika 73d4b89
feat: implement modifyRemoteStreamsSubscriptions
Doominika 0fea22f
feat: implement unsubscribeFromRemoteStreams
Doominika c432217
feat: implement dropBrokenFrames
Doominika ccc65e1
refactor: remove unnecessary getters
Doominika b53b906
chore: fix contents of arguments passed to null-check function
Doominika 11a2c6e
feat: add missing null-check
Doominika 8d9b1dc
chore: update OnFrameCallback params names
Doominika 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 hidden or 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 |
|---|---|---|
|
|
@@ -1394,5 +1394,130 @@ namespace privmx { | |
| ); | ||
| } | ||
|
|
||
| //Stream | ||
| jobject stream2Java( | ||
| JniContextUtils &ctx, | ||
| privmx::endpoint::stream::Stream stream_c | ||
| ) { | ||
| jclass itemCls = ctx->FindClass( | ||
| "com/simplito/java/privmx_endpoint/model/Stream"); | ||
|
|
||
| jmethodID initItemMID = ctx->GetMethodID( | ||
| itemCls, | ||
| "<init>", | ||
| "(" | ||
| "Ljava/lang/Long;" // streamId | ||
| "Ljava/lang/String;" // userId | ||
| ")V" | ||
| ); | ||
|
|
||
| return ctx->NewObject( | ||
| itemCls, | ||
| initItemMID, | ||
| ctx.long2jLong(stream_c.streamId), | ||
| ctx->NewStringUTF(stream_c.userId.c_str()) | ||
| ); | ||
| } | ||
|
|
||
| jobject deviceType2Java( | ||
| JniContextUtils &ctx, | ||
| privmx::endpoint::stream::DeviceType deviceType_c | ||
| ) { | ||
| jclass itemCls = ctx->FindClass( | ||
| "com/simplito/java/privmx_endpoint/model/streams/DeviceType"); | ||
|
|
||
| jmethodID valuesMID = ctx->GetStaticMethodID(itemCls, "values", | ||
| "()[Lcom/simplito/java/privmx_endpoint/model/streams/DeviceType;"); | ||
|
|
||
| jobjectArray enumValues = (jobjectArray) ctx->CallStaticObjectMethod(itemCls, | ||
| valuesMID); | ||
|
|
||
| return (jobject) ctx->GetObjectArrayElement(enumValues, (int) deviceType_c); | ||
| } | ||
|
|
||
|
|
||
| jobject mediaDevice2Java( | ||
| JniContextUtils &ctx, | ||
| privmx::endpoint::stream::MediaDevice mediaDevice_c | ||
| ) { | ||
| jclass itemCls = ctx->FindClass( | ||
| "com/simplito/java/privmx_endpoint/model/streams/MediaDevice"); | ||
|
|
||
| jmethodID initItemMID = ctx->GetMethodID( | ||
| itemCls, | ||
| "<init>", | ||
| "(" | ||
| "Ljava/lang/String;" // name | ||
| "Ljava/lang/String;" // id | ||
| "Lcom/simplito/java/privmx_endpoint/model/streams/DeviceType;" // type | ||
| ")V" | ||
| ); | ||
|
|
||
| return ctx->NewObject( | ||
| itemCls, | ||
| initItemMID, | ||
| ctx->NewStringUTF(mediaDevice_c.name.c_str()), | ||
| ctx->NewStringUTF(mediaDevice_c.id.c_str()), | ||
| deviceType2Java(ctx, mediaDevice_c.type) | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this line |
||
| ); | ||
| } | ||
|
|
||
| jobject streamHandle2Java( | ||
| JniContextUtils &ctx, | ||
| privmx::endpoint::stream::StreamHandle streamHandle_c | ||
| ) { | ||
| jclass itemCls = ctx->FindClass( | ||
| "com/simplito/java/privmx_endpoint/model/streams/StreamHandle"); | ||
|
|
||
| jmethodID initItemMID = ctx->GetMethodID( | ||
| itemCls, | ||
| "<init>", | ||
| "(" | ||
| "Ljava/lang/Long;" // value | ||
| ")V" | ||
| ); | ||
|
|
||
| return ctx->NewObject( | ||
| itemCls, | ||
| initItemMID, | ||
| ctx.long2jLong(streamHandle_c) | ||
| ); | ||
| } | ||
|
|
||
| jobject remoteStreamId2Java(JniContextUtils &ctx, privmx::endpoint::stream::RemoteStreamId remoteStreamId_c){ | ||
| jclass itemCls = ctx->FindClass( | ||
| "com/simplito/java/privmx_endpoint/model/streams/RemoteStreamId"); | ||
|
|
||
| jmethodID initItemMID = ctx->GetMethodID( | ||
| itemCls, | ||
| "<init>", | ||
| "(" | ||
| "Ljava/lang/Long;" // value | ||
| ")V" | ||
| ); | ||
|
|
||
| return ctx->NewObject( | ||
| itemCls, | ||
| initItemMID, | ||
| ctx.long2jLong(remoteStreamId_c) | ||
| ); | ||
| } | ||
|
|
||
| jobject frame2Java(JniContextUtils &ctx, privmx::endpoint::stream::Frame &frame_c) { | ||
| jclass itemCls = ctx->FindClass( | ||
| "com/simplito/java/privmx_endpoint/model/streams/Frame"); | ||
|
|
||
| jmethodID initItemMID = ctx->GetMethodID( | ||
| itemCls, | ||
| "<init>", | ||
| "()V" | ||
| ); | ||
|
|
||
| return ctx->NewObject( | ||
| itemCls, | ||
| initItemMID | ||
| ); | ||
| } | ||
| } // wrapper | ||
| } // privmx | ||
This file contains hidden or 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
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.