Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3928fc0
refactor: move streamApiLow and required classes to privmx-endpoint
Doominika Feb 11, 2026
1d8936a
chore: comment unimplemented methods in streamApiLow
Doominika Feb 11, 2026
944f009
refactor: change jni functions names after moving java classes to new…
Doominika Feb 11, 2026
c8852eb
refactor: change paths to java classes in jni after refactor
Doominika Feb 11, 2026
401cf8f
chore: remove redundant functions in jni
Doominika Feb 11, 2026
b635b58
chore: reformat file
Doominika Feb 11, 2026
bd70f6e
feat: add new class - StreamEncryptionMode
Doominika Feb 11, 2026
cf4164b
feat: add new parameter to streamApiLow create method
Doominika Feb 11, 2026
4cc36e2
feat: add new method to streamApiLow - createStreamRoomEx
Doominika Feb 11, 2026
e826c12
feat: add new method to streamApiLow - getStreamRoomEx
Doominika Feb 11, 2026
f5854f8
feat: add new method to streamApiLow - listStreamRoomsEx
Doominika Feb 11, 2026
5f8665b
feat: add new method to streamApiLow - enableStreamRoomRecording
Doominika Feb 11, 2026
433d76a
feat: add new class - RecordingEncKey
Doominika Feb 12, 2026
2afeb93
feat: add new method to streamApiLow - getStreamRoomRecordingKeys
Doominika Feb 12, 2026
3d1b327
feat: add new parameter to StreamRoom class
Doominika Feb 12, 2026
65bd0e2
chore: remove unnecessary headers
Doominika Feb 12, 2026
3ed7c4e
refactor: move streamApiLow to privmx-endpoint
Doominika Feb 17, 2026
482a863
refactor: remove stream classes from privmx-endpoint-streams and use …
Doominika Feb 17, 2026
c507056
feat: remove redundant classes and import right ones
Doominika Feb 17, 2026
58852dc
refactor: change the way of creating streamApiLow
Doominika Feb 18, 2026
e5814f8
refactor: move java stream events classes to new directory
Doominika Feb 18, 2026
2d658ac
refactor: Move stream event selector type and event type
djenczewski Feb 19, 2026
3e45719
feat: move streamApiLow jni part
Doominika Feb 20, 2026
84db6dd
feat: uncomment implemented methods
Doominika Feb 20, 2026
fcd92df
feat: init method in jni
Doominika Feb 20, 2026
afa11ef
feat: correct imports
Doominika Feb 20, 2026
2dd7460
feat: remove class
Doominika Feb 20, 2026
44060a4
feat: remove stream parsers
Doominika Feb 20, 2026
e82468f
feat: remove classes from android jni and move them to privmx-endpoint
Doominika Feb 20, 2026
d393e72
Merge remote-tracking branch 'origin/android-stream-api-testing' into…
Doominika Feb 20, 2026
b72ff72
Merge remote-tracking branch 'origin/refactor/move-stream-api-low' in…
Doominika Feb 20, 2026
2922021
feat: correct package name
Doominika Feb 20, 2026
ca93588
feat: change to java byte array
Doominika Feb 20, 2026
dc8e4ba
feat: remove redundant import
Doominika Feb 20, 2026
d6243b4
fix: change types to nullable ones in models
Doominika Feb 21, 2026
96bbb69
fix: correct parseStreamSubscription function
Doominika Feb 21, 2026
3a54398
chore: bring back the lost classes
Doominika Feb 23, 2026
7bdb313
chore: bring back the param in init streamApiLow and add nullcheck
Doominika Feb 23, 2026
f0f5798
chore: bring back callResultEndpointApi in init function
Doominika Feb 23, 2026
735f125
chore: bring back new parameter in create function
Doominika Feb 23, 2026
21e1f16
chore: fix param in nullcheck
Doominika Feb 23, 2026
ed44093
chore: bring back api methods
Doominika Feb 23, 2026
2a3df80
chore: bring back method
Doominika Feb 23, 2026
a215898
feat: add nullcheck for stream_room_id
Doominika Feb 23, 2026
99fa304
fix: change imports after moving streamApiLow
Doominika Feb 23, 2026
da8ea8b
Merge remote-tracking branch 'origin/android-stream-api-testing' into…
djenczewski Mar 11, 2026
0390ba1
chore(privmx-endpoint): fix imports in StreamApiLow
djenczewski Mar 11, 2026
933b117
chore(jni-wrappers/privmx-endpoint): remove unnecessary methods
djenczewski Mar 11, 2026
6326290
chore(privmx-endpoint): revert stream recording methods
djenczewski Mar 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion jni-wrappers/privmx-endpoint/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ add_library(${CMAKE_PROJECT_NAME} SHARED
${CMAKE_CURRENT_SOURCE_DIR}/src/cpp/modules/Utils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/cpp/modules/KvdbApi.cpp
src/cpp/modules/WebRTCInterfaceJNI.cpp
#src/cpp/modules/StreamSettingsJNI.cpp
src/cpp/modules/StreamApiLow.cpp
)
target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/includes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ namespace privmx {
JniContextUtils &ctx,
privmx::endpoint::stream::StreamsUpdatedData data
);

} // wrapper
} // privmx

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ privmx::endpoint::stream::StreamSubscription parseStreamSubscription(JniContextU

privmx::endpoint::stream::SdpWithTypeModel parseSdpWithTypeModel(JniContextUtils &ctx, jobject sdpWithTypeModel);

privmx::endpoint::stream::StreamEncryptionMode parseStreamEncryptionMode(JniContextUtils &ctx, jobject streamEncryptionMode);

jobject parseEvent(JniContextUtils &ctx, std::shared_ptr<privmx::endpoint::core::Event> event);

Expand Down
48 changes: 25 additions & 23 deletions jni-wrappers/privmx-endpoint/src/cpp/modules/StreamApiLow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

using namespace privmx::endpoint::stream;
using namespace privmx::endpoint;
//using namespace privmx::wrapper;

StreamApiLow *getStreamApi(JniContextUtils &ctx, jobject streamApiInstance) {
jclass cls = ctx->GetObjectClass(streamApiInstance);
Expand All @@ -32,22 +31,26 @@ Java_com_simplito_java_privmx_1endpoint_modules_stream_StreamApiLow_init(
JNIEnv *env,
jobject thiz,
jobject connection,
jobject eventApi
jobject eventApi,
jobject stream_encryption_mode
) {
JniContextUtils ctx(env);
jobject result;

if (ctx.nullCheck(connection, "Connection") ||
ctx.nullCheck(eventApi, "EventApi")) {
ctx.nullCheck(eventApi, "EventApi") ||
ctx.nullCheck(stream_encryption_mode, "Stream Encryption Mode")
) {
return nullptr;
}

ctx.callResultEndpointApi<jobject>(&result, [&ctx, &env, &connection, &eventApi] {
ctx.callResultEndpointApi<jobject>(&result, [&ctx, &env, &connection, &eventApi, &stream_encryption_mode] {
auto connection_c = getConnection(env, connection);
auto eventApi_c = getEventApi(env, eventApi);
auto streamApiLow = stream::StreamApiLow::create(
*connection_c,
*eventApi_c
*eventApi_c,
parseStreamEncryptionMode(ctx, stream_encryption_mode)
);
auto streamApiLow_ptr = new stream::StreamApiLow();
*streamApiLow_ptr = streamApiLow;
Expand Down Expand Up @@ -95,10 +98,10 @@ Java_com_simplito_java_privmx_1endpoint_modules_stream_StreamApiLow_createStream
) {
JniContextUtils ctx(env);
if (ctx.nullCheck(context_id, "Context ID") ||
ctx.nullCheck(users, "Users list") ||
ctx.nullCheck(managers, "Managers list") ||
ctx.nullCheck(public_meta, "Public meta") ||
ctx.nullCheck(private_meta, "Private meta")) {
ctx.nullCheck(users, "Users list") ||
ctx.nullCheck(managers, "Managers list") ||
ctx.nullCheck(public_meta, "Public meta") ||
ctx.nullCheck(private_meta, "Private meta")) {
return nullptr;
}

Expand Down Expand Up @@ -156,10 +159,10 @@ Java_com_simplito_java_privmx_1endpoint_modules_stream_StreamApiLow_updateStream
) {
JniContextUtils ctx(env);
if (ctx.nullCheck(stream_room_id, "Stream room ID") ||
ctx.nullCheck(users, "Users list") ||
ctx.nullCheck(managers, "Managers list") ||
ctx.nullCheck(public_meta, "Public meta") ||
ctx.nullCheck(private_meta, "Private meta")) {
ctx.nullCheck(users, "Users list") ||
ctx.nullCheck(managers, "Managers list") ||
ctx.nullCheck(public_meta, "Public meta") ||
ctx.nullCheck(private_meta, "Private meta")) {
return;
}
ctx.callVoidEndpointApi(
Expand Down Expand Up @@ -214,7 +217,7 @@ Java_com_simplito_java_privmx_1endpoint_modules_stream_StreamApiLow_listStreamRo
) {
JniContextUtils ctx(env);
if (ctx.nullCheck(context_id, "Context ID") ||
ctx.nullCheck(sort_order, "Sort order")) {
ctx.nullCheck(sort_order, "Sort order")) {
return nullptr;
}

Expand Down Expand Up @@ -399,11 +402,10 @@ Java_com_simplito_java_privmx_1endpoint_modules_stream_StreamApiLow_joinStreamRo
jobject thiz,
jstring stream_room_id,
jobject web_rtc
// todo - made changes in arguments
) {
JniContextUtils ctx(env);
if (ctx.nullCheck(stream_room_id, "Stream room ID") ||
ctx.nullCheck(web_rtc, "webRtc")) {
ctx.nullCheck(web_rtc, "webRtc")) {
return;
}

Expand Down Expand Up @@ -692,7 +694,7 @@ Java_com_simplito_java_privmx_1endpoint_modules_stream_StreamApiLow_unsubscribeF
) {
JniContextUtils ctx(env);
if (ctx.nullCheck(stream_room_id, "Stream Room ID") ||
ctx.nullCheck(subscriptions_to_remove, "Subscriptions to remove")) {
ctx.nullCheck(subscriptions_to_remove, "Subscriptions to remove")) {
return;
}

Expand Down Expand Up @@ -733,9 +735,9 @@ Java_com_simplito_java_privmx_1endpoint_modules_stream_StreamApiLow_modifyRemote
) {
JniContextUtils ctx(env);
if (ctx.nullCheck(stream_room_id, "Stream Room ID") ||
ctx.nullCheck(subscriptions_to_add, "Subscriptions to add") ||
ctx.nullCheck(subscriptions_to_add, "Subscriptions to remove") ||
ctx.nullCheck(options, "Options")) {
ctx.nullCheck(subscriptions_to_add, "Subscriptions to add") ||
ctx.nullCheck(subscriptions_to_add, "Subscriptions to remove") ||
ctx.nullCheck(options, "Options")) {
return;
}

Expand Down Expand Up @@ -764,7 +766,7 @@ Java_com_simplito_java_privmx_1endpoint_modules_stream_StreamApiLow_modifyRemote
}
for (int i = 0; i < subscriptions_to_remove_length; i++) {
jobject arrayElement = ctx->GetObjectArrayElement(subscriptions_to_remove_arr,
i);
i);
if (ctx.nullCheck(arrayElement, "Subscriptions to remove array elements")) {
return;
}
Expand Down Expand Up @@ -795,8 +797,8 @@ Java_com_simplito_java_privmx_1endpoint_modules_stream_StreamApiLow_subscribeToR
) {
JniContextUtils ctx(env);
if (ctx.nullCheck(stream_room_id, "Stream Room ID") ||
ctx.nullCheck(subscriptions, "Subscriptions") ||
ctx.nullCheck(options, "Options")) {
ctx.nullCheck(subscriptions, "Subscriptions") ||
ctx.nullCheck(options, "Options")) {
return;
}
ctx.callVoidEndpointApi([&ctx, &thiz, &stream_room_id, &subscriptions, &options]() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1617,6 +1617,7 @@ namespace privmx {
"Lcom/simplito/java/privmx_endpoint/model/ContainerPolicy;" // policy
"Ljava/lang/Long;" // statusCode
"Ljava/lang/Long;" // schemaVersion
"Ljava/lang/Boolean;" // closed
")V"
);

Expand Down Expand Up @@ -1647,7 +1648,8 @@ namespace privmx {
privateMeta,
privmx::wrapper::containerPolicy2Java(ctx, streamRoom_c.policy),
ctx.long2jLong(streamRoom_c.statusCode),
ctx.long2jLong(streamRoom_c.schemaVersion)
ctx.long2jLong(streamRoom_c.schemaVersion),
ctx.bool2jBoolean(streamRoom_c.closed)
);
}

Expand Down
30 changes: 25 additions & 5 deletions jni-wrappers/privmx-endpoint/src/cpp/parsers/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,21 +846,21 @@ privmx::endpoint::stream::StreamSubscription parseStreamSubscription(JniContextU
privmx::endpoint::stream::StreamSubscription result;
jclass cls = ctx->GetObjectClass(streamSubscription);
jfieldID streamIdFID = ctx->GetFieldID(
ctx->GetObjectClass(streamSubscription),
cls,
"streamId",
"J"
"Ljava/lang/Long;"
);

jfieldID trackIdFID = ctx->GetFieldID(
ctx->GetObjectClass(streamSubscription),
cls,
"streamTrackId",
"Ljava/lang/String;"
);

jlong streamId = ctx->GetLongField(streamSubscription, streamIdFID);
jobject streamId = ctx->GetObjectField(streamSubscription, streamIdFID);
jobject streamTrackId = ctx->GetObjectField(streamSubscription, trackIdFID);

result.streamId = streamId;
result.streamId = jobject2long(ctx, streamId);
if (streamTrackId != nullptr) result.streamTrackId = jobject2string(ctx, streamTrackId);

return result;
Expand All @@ -884,6 +884,26 @@ privmx::endpoint::stream::SdpWithTypeModel parseSdpWithTypeModel(JniContextUtils
}


privmx::endpoint::stream::StreamEncryptionMode parseStreamEncryptionMode(
JniContextUtils &ctx,
jobject streamEncryptionMode
) {
jclass cls = ctx->GetObjectClass(streamEncryptionMode);
jmethodID nameFID = ctx->GetMethodID(
cls,
"name",
"()Ljava/lang/String;"
);

auto name_j = (jstring) ctx->CallObjectMethod(streamEncryptionMode, nameFID);
std::string name_c = ctx.jString2string(name_j);

if (name_c == "SINGLE_KEY") return privmx::endpoint::stream::StreamEncryptionMode::SINGLE_KEY;
if (name_c == "MULTIPLE_KEY") return privmx::endpoint::stream::StreamEncryptionMode::MULTIPLE_KEY;

return {};
}

// java -> c++
template<typename T>
std::vector<T> jArrayToVector(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.simplito.java.privmx_endpoint.model.stream;

public enum StreamEncryptionMode {
SINGLE_KEY,
MULTIPLE_KEY
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class StreamRoom {
public ContainerPolicy policy;
public Long statusCode;
public Long schemaVersion;
public Boolean closed;

public StreamRoom(
String contextId,
Expand All @@ -45,7 +46,8 @@ public StreamRoom(
byte[] privateMeta,
ContainerPolicy policy,
Long statusCode,
Long schemaVersion
Long schemaVersion,
boolean closed
) {
this.contextId = contextId;
this.streamRoomId = streamRoomId;
Expand All @@ -61,5 +63,6 @@ public StreamRoom(
this.policy = policy;
this.statusCode = statusCode;
this.schemaVersion = schemaVersion;
this.closed = closed;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.simplito.java.privmx_endpoint.model.stream;

public class StreamSubscription {
public long streamId;
public Long streamId;
public String streamTrackId;

public StreamSubscription(long streamId, String streamTrackId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.simplito.java.privmx_endpoint.model.UserWithPubKey;
import com.simplito.java.privmx_endpoint.model.stream.SdpWithTypeModel;
import com.simplito.java.privmx_endpoint.model.stream.Settings;
import com.simplito.java.privmx_endpoint.model.stream.StreamEncryptionMode;
import com.simplito.java.privmx_endpoint.model.stream.StreamHandle;
import com.simplito.java.privmx_endpoint.model.stream.StreamInfo;
import com.simplito.java.privmx_endpoint.model.stream.StreamPublishResult;
Expand Down Expand Up @@ -46,23 +47,36 @@ private StreamApiLow(Long api) {
this.api = api;
}

private native Long init(Connection connection, EventApi eventApi) throws IllegalStateException;
private native Long init(
Connection connection,
EventApi eventApi,
StreamEncryptionMode streamEncryptionMode
) throws IllegalStateException;

public StreamApiLow(
Connection connection
) throws IllegalStateException {
this.api = init(connection, null);
this.api = init(connection, null, StreamEncryptionMode.SINGLE_KEY);
}

public StreamApiLow(
Connection connection,
EventApi eventApi
) throws IllegalStateException {
this.api = init(connection, eventApi, StreamEncryptionMode.SINGLE_KEY);
}

public StreamApiLow(
Connection connection,
EventApi eventApi,
StreamEncryptionMode streamEncryptionMode
) throws IllegalStateException {
Objects.requireNonNull(connection);
EventApi tmpEventApi = eventApi == null ? new EventApi(connection) : null;
this.api = init(
connection,
Optional.ofNullable(eventApi).orElse(tmpEventApi)
Optional.ofNullable(eventApi).orElse(tmpEventApi),
Optional.ofNullable(streamEncryptionMode).orElse(StreamEncryptionMode.SINGLE_KEY)
);

try {
Expand Down Expand Up @@ -222,7 +236,6 @@ public String buildSubscriptionQuery(
}

public native void keyManagement(String streamRoomId, boolean disable);

private native void deinit() throws IllegalStateException;

@Override
Expand Down