Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d2b7b38
feat: add VideoTrackInfo class
Doominika Feb 4, 2026
5237e90
feat: add StreamTrackModification class
Doominika Feb 4, 2026
b7107fd
feat: add StreamUpdatedEventData class
Doominika Feb 4, 2026
0014c4b
feat: add UpdatedStreamData class
Doominika Feb 4, 2026
3c1588e
feat: add StreamRoomDeletedEventData class
Doominika Feb 4, 2026
79a6692
fix: add StreamRoomDeletedEventData class
Doominika Feb 4, 2026
d67ca31
feat: add StreamPublishedEventData class
Doominika Feb 4, 2026
366c681
feat: add StreamEventData class
Doominika Feb 4, 2026
e311fe0
feat: add StreamUnpublishedEventData class
Doominika Feb 4, 2026
1eabb47
feat: add NewStreams class
Doominika Feb 4, 2026
fc2c394
feat: add StreamsUpdatedData class
Doominika Feb 4, 2026
85d1c07
feat: update StreamPublishResult class
Doominika Feb 4, 2026
556833b
feat: add parse streams event function
Doominika Feb 4, 2026
9d2de70
feat: add initEvent function to header
Doominika Feb 4, 2026
61a45d0
refactor: rename StreamPublishedEventData
Doominika Feb 4, 2026
c5bedd1
feat: add buildSubscriptionQuery to StreamApiLow
Doominika Feb 4, 2026
30f71a1
feat: add class for handling parsing functions used by EventQueue
Doominika Feb 4, 2026
f82213c
refactor: move stream events to core events and remove EventsList class
Doominika Feb 6, 2026
d0b3405
refactor: add missing type to StreamEventType
Doominika Feb 9, 2026
4acf01c
chore: change removeVideoTrack
Doominika Feb 9, 2026
9026e42
feat: add missing methods
Doominika Feb 9, 2026
492800a
chore: cleaning
Doominika Feb 9, 2026
fd80927
chore: delete privmx-endpoint-streams-android
Doominika Feb 9, 2026
1c752e8
Merge remote-tracking branch 'origin/android-stream-api-testing' into…
Doominika Feb 9, 2026
56aab8f
Merge remote-tracking branch 'origin/android-stream-api-testing' into…
Doominika Feb 9, 2026
432062b
feat: add draft methods for audio and video to streamApi
Doominika Feb 9, 2026
c275e8b
chore: update build configs
djenczewski Feb 9, 2026
f057c8d
feat: add draft removeTrack method
Doominika Feb 9, 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
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "privmx/endpoint/core/Types.hpp"
#include "privmx/endpoint/core/Events.hpp"
#include "privmx/endpoint/inbox/Types.hpp"
#include "privmx/endpoint/stream/Events.hpp"
#include "privmx/endpoint/wrapper/streams/parsers/model_native_initializers.h"

std::vector<privmx::endpoint::core::UserWithPubKey>
usersToVector(JniContextUtils &ctx, jobjectArray users);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,46 @@ namespace privmx {

jobject
sdpWithTypeModel2Java(JniContextUtils &ctx, privmx::endpoint::stream::SdpWithTypeModel sdpWithTypeModel_c);
jobject
streamTrackModificationPair2Java(JniContextUtils & ctx, endpoint::stream::StreamTrackModificationPair
streamTrackModificationPair);

jobject
streamTrackModification2Java(JniContextUtils & ctx, endpoint::stream::StreamTrackModification
streamTrackModification);

jobject
streamUpdatedEventData2Java(JniContextUtils & ctx, privmx::endpoint::stream::StreamUpdatedEventData
data);

jobject
updatedStreamData2Java(JniContextUtils & ctx, endpoint::stream::UpdatedStreamData
updatedStreamData);

jobject
streamRoomDeletedEventData2Java(JniContextUtils & ctx, privmx::endpoint::stream::StreamRoomDeletedEventData
data);

jobject
streamPublishedEventData2Java(JniContextUtils & ctx, privmx::endpoint::stream::StreamPublishedEventData
data);

jobject
streamEventData2Java(JniContextUtils & ctx, privmx::endpoint::stream::StreamEventData
data);

jobject
streamUnpublishedEventData2Java(JniContextUtils & ctx, privmx::endpoint::stream::StreamUnpublishedEventData
data);

jobject
newStreams2Java(JniContextUtils & ctx, privmx::endpoint::stream::NewStreams
data);

jobject
streamsUpdated2Java(JniContextUtils & ctx, privmx::endpoint::stream::StreamsUpdatedData
data);

} // streams
} // wrapper
} // privmx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ privmx::endpoint::stream::StreamSettings parseStreamSettings(JNIEnv *env, jobjec

privmx::endpoint::stream::StreamSubscription parseStreamSubscription(JniContextUtils &ctx, jobject streamSubscription);

//#endif //PRIVMX_POCKET_LIB_PARSER_H
privmx::endpoint::stream::SdpWithTypeModel parseSdpWithTypeModel(JniContextUtils &ctx, jobject sdpWithTypeModel);
4 changes: 2 additions & 2 deletions jni-wrappers/privmx-endpoint/src/cpp/modules/EventQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ Java_com_simplito_java_privmx_1endpoint_modules_core_EventQueue_getEvent(
ctx.callResultEndpointApi<jobject>(&result, [&ctx]() {
auto eventHolder = EventQueue::getInstance().getEvent();
return !eventHolder.has_value() ?
nullptr :
parseEvent(ctx, eventHolder.value().get());
nullptr :
parseEvent(ctx, eventHolder.value().get());
});
if (ctx->ExceptionCheck()) {
return nullptr;
Expand Down
129 changes: 129 additions & 0 deletions jni-wrappers/privmx-endpoint/src/cpp/parsers/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,135 @@ parseEvent(JniContextUtils &ctx, std::shared_ptr<privmx::endpoint::core::Event>
event_cast.timestamp,
privmx::wrapper::kvdbDeletedEntryEventData2Java(ctx, event_cast.data)
);
} else if (stream::Events::isStreamRoomCreatedEvent(event)) {
privmx::endpoint::stream::StreamRoomCreatedEvent event_cast = stream::Events::extractStreamRoomCreatedEvent(
event);
return initEvent(
ctx,
event_cast.type,
event_cast.channel,
event_cast.connectionId,
event_cast.subscriptions,
event_cast.timestamp,
privmx::wrapper::streams::streamRoom2Java(ctx, event_cast.data)
);
} else if (stream::Events::isStreamRoomUpdatedEvent(event)) {
privmx::endpoint::stream::StreamRoomUpdatedEvent event_cast =
stream::Events::extractStreamRoomUpdatedEvent(event);

return initEvent(
ctx,
event_cast.type,
event_cast.channel,
event_cast.connectionId,
event_cast.subscriptions,
event_cast.timestamp,
privmx::wrapper::streams::streamRoom2Java(ctx, event_cast.data)
);
} else if (stream::Events::isStreamRoomDeletedEvent(event)) {
privmx::endpoint::stream::StreamRoomDeletedEvent event_cast =
stream::Events::extractStreamRoomDeletedEvent(event);

return initEvent(
ctx,
event_cast.type,
event_cast.channel,
event_cast.connectionId,
event_cast.subscriptions,
event_cast.timestamp,
privmx::wrapper::streams::streamRoomDeletedEventData2Java(ctx, event_cast.data)
);
} else if (stream::Events::isStreamPublishedEvent(event)) {
privmx::endpoint::stream::StreamPublishedEvent event_cast =
stream::Events::extractStreamPublishedEvent(event);

return initEvent(
ctx,
event_cast.type,
event_cast.channel,
event_cast.connectionId,
event_cast.subscriptions,
event_cast.timestamp,
privmx::wrapper::streams::streamPublishedEventData2Java(ctx, event_cast.data)
);
} else if (stream::Events::isStreamUpdatedEvent(event)) {
privmx::endpoint::stream::StreamUpdatedEvent event_cast =
stream::Events::extractStreamUpdatedEvent(event);

return initEvent(
ctx,
event_cast.type,
event_cast.channel,
event_cast.connectionId,
event_cast.subscriptions,
event_cast.timestamp,
privmx::wrapper::streams::streamUpdatedEventData2Java(ctx, event_cast.data)
);
} else if (stream::Events::isStreamJoinedEvent(event)) {
privmx::endpoint::stream::StreamJoinedEvent event_cast =
stream::Events::extractStreamJoinedEvent(event);

return initEvent(
ctx,
event_cast.type,
event_cast.channel,
event_cast.connectionId,
event_cast.subscriptions,
event_cast.timestamp,
privmx::wrapper::streams::streamEventData2Java(ctx, event_cast.data)
);
} else if (stream::Events::isStreamUnpublishedEvent(event)) {
privmx::endpoint::stream::StreamUnpublishedEvent event_cast =
stream::Events::extractStreamUnpublishedEvent(event);

return initEvent(
ctx,
event_cast.type,
event_cast.channel,
event_cast.connectionId,
event_cast.subscriptions,
event_cast.timestamp,
privmx::wrapper::streams::streamUnpublishedEventData2Java(ctx, event_cast.data)
);
} else if (stream::Events::isStreamLeftEvent(event)) {
privmx::endpoint::stream::StreamLeftEvent event_cast =
stream::Events::extractStreamLeftEvent(event);

return initEvent(
ctx,
event_cast.type,
event_cast.channel,
event_cast.connectionId,
event_cast.subscriptions,
event_cast.timestamp,
privmx::wrapper::streams::streamEventData2Java(ctx, event_cast.data)
);
} else if (stream::Events::isStreamNewStreamsEvent(event)) {
privmx::endpoint::stream::StreamNewStreamsEvent event_cast =
stream::Events::extractStreamNewStreamsEvent(event);

return initEvent(
ctx,
event_cast.type,
event_cast.channel,
event_cast.connectionId,
event_cast.subscriptions,
event_cast.timestamp,
privmx::wrapper::streams::newStreams2Java(ctx, event_cast.data)
);
} else if (stream::Events::isStreamsUpdatedEvent(event)) {
privmx::endpoint::stream::StreamsUpdatedEvent event_cast =
stream::Events::extractStreamsUpdatedEvent(event);

return initEvent(
ctx,
event_cast.type,
event_cast.channel,
event_cast.connectionId,
event_cast.subscriptions,
event_cast.timestamp,
privmx::wrapper::streams::streamsUpdated2Java(ctx, event_cast.data)
);
} else {
return initEvent(
ctx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
#include "privmx/endpoint/wrapper/streams/parsers/model_native_initializers.h"
#include "privmx/endpoint/wrapper/streams/parsers/parser.h"

//#include <privmx-endpoint/includes/privmx/endpoint/wrapper/parsers/parser.h>

using namespace privmx::endpoint::stream;
using namespace privmx::endpoint;
//using namespace privmx::wrapper;
Expand Down Expand Up @@ -424,12 +422,10 @@ Java_com_simplito_java_privmx_1endpoint_modules_stream_StreamApiLow_publishStrea
auto result = getStreamApi(ctx, thiz)->publishStream(
parseStreamHandle(ctx, stream_handle)
);
return nullptr;
//TODO: Return result
// return privmx::wrapper::streams::streamPublishResult2Java(
// ctx,
// result
// );
return privmx::wrapper::streams::streamPublishResult2Java(
ctx,
result
);
});
if (ctx->ExceptionCheck()) {
return nullptr;
Expand Down Expand Up @@ -649,6 +645,38 @@ Java_com_simplito_java_privmx_1endpoint_modules_stream_StreamApiLow_unsubscribeF
});
}

extern "C"
JNIEXPORT jstring JNICALL
Java_com_simplito_java_privmx_1endpoint_modules_stream_StreamApiLow_buildSubscriptionQuery(
JNIEnv *env,
jobject thiz,
jlong event_type,
jlong selector_type,
jstring selector_id
) {
JniContextUtils ctx(env);
if (ctx.nullCheck(selector_id, "SelectorID")) {
return nullptr;
}

jstring result = nullptr;
ctx.callResultEndpointApi<jstring>(
&result,
[&ctx, &thiz, &event_type, &selector_type, &selector_id]() {
std::string query_result_c = getStreamApi(ctx, thiz)->buildSubscriptionQuery(
static_cast<stream::EventType>(event_type),
static_cast<stream::EventSelectorType>(selector_type),
ctx.jString2string(selector_id)
);
return ctx->NewStringUTF(query_result_c.c_str());
}
);
if (ctx->ExceptionCheck()) {
return nullptr;
}
return result;
}

extern "C"
JNIEXPORT void JNICALL
Java_com_simplito_java_privmx_1endpoint_modules_stream_StreamApiLow_keyManagement(
Expand Down Expand Up @@ -837,4 +865,59 @@ Java_com_simplito_java_privmx_1endpoint_modules_stream_StreamApiLow_subscribeToR
parseSettings(ctx, options)
);
});
}
extern "C"
JNIEXPORT jobject JNICALL
Java_com_simplito_java_privmx_1endpoint_modules_stream_StreamApiLow_updateStream(
JNIEnv *env,
jobject thiz,
jobject stream_handle
) {
JniContextUtils ctx(env);
jobject result;

ctx.callResultEndpointApi<jobject>(
&result, [
&ctx,
&env,
&thiz,
&stream_handle
] {

auto stream_handle_c = parseStreamHandle(ctx, stream_handle);
auto stream_result = getStreamApi(ctx, thiz)->updateStream(
stream_handle_c
);

return privmx::wrapper::streams::streamPublishResult2Java(
ctx,
stream_result
);

});
if (ctx->ExceptionCheck()) {
return nullptr;
}
return result;
}
extern "C"
JNIEXPORT void JNICALL
Java_com_simplito_java_privmx_1endpoint_modules_stream_StreamApiLow_acceptOfferOnReconfigure(
JNIEnv *env,
jobject thiz,
jlong session_id,
jobject sdp
) {
JniContextUtils ctx(env);
if (ctx.nullCheck(sdp, " SDP")) {
return;
}

ctx.callVoidEndpointApi([&ctx, &thiz, &session_id, &sdp]() {

getStreamApi(ctx, thiz)->acceptOfferOnReconfigure(
session_id,
parseSdpWithTypeModel(ctx, sdp)
);
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,31 @@ namespace privmx::wrapper::streams {
this->jstreamSettings = env->NewGlobalRef(jstreamSettings);


this->OnFrame = [this](
int64_t a,
int64_t b,
const std::shared_ptr<privmx::endpoint::stream::Frame> &frame,
const std::string &c
) {
JNIEnv *env = privmx::wrapper::jni::AttachCurrentThreadIfNeeded(
javaVM,
privmx::wrapper::jni::getPrivmxCallbackThreadName());
JniContextUtils ctx(env);
};

this->OnVideo = [this](const std::string &a) {
JNIEnv *env = privmx::wrapper::jni::AttachCurrentThreadIfNeeded(
javaVM,
privmx::wrapper::jni::getPrivmxCallbackThreadName());
JniContextUtils ctx(env);
};

this->OnVideoRemove = [this](const std::string &a) {
JNIEnv *env = privmx::wrapper::jni::AttachCurrentThreadIfNeeded(
javaVM,
privmx::wrapper::jni::getPrivmxCallbackThreadName());
JniContextUtils ctx(env);
};
// this->OnFrame = [this](
// int64_t a,
// int64_t b,
// const std::shared_ptr<privmx::endpoint::stream::Frame> &frame,
// const std::string &c
// ) {
// JNIEnv *env = privmx::wrapper::jni::AttachCurrentThreadIfNeeded(
// javaVM,
// privmx::wrapper::jni::getPrivmxCallbackThreadName());
// JniContextUtils ctx(env);
// };
//
// this->OnVideo = [this](const std::string &a) {
// JNIEnv *env = privmx::wrapper::jni::AttachCurrentThreadIfNeeded(
// javaVM,
// privmx::wrapper::jni::getPrivmxCallbackThreadName());
// JniContextUtils ctx(env);
// };
//
// this->OnVideoRemove = [this](const std::string &a) {
// JNIEnv *env = privmx::wrapper::jni::AttachCurrentThreadIfNeeded(
// javaVM,
// privmx::wrapper::jni::getPrivmxCallbackThreadName());
// JniContextUtils ctx(env);
// };
}

// void StreamSettingsJNI::StreamSettingsJNI::onVideo2(
Expand Down
Loading