Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

env:
# TODO: set to master
ROC_REVISION: v0.2.6
ROC_REVISION: v0.3.0

steps:
- name: Checkout
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:

env:
# TODO: set to master
ROC_REVISION: v0.2.6
ROC_REVISION: v0.3.0
JAVA_VERSION: ${{ matrix.jdk }}
SDK_LEVEL: ${{ matrix.sdk }}
API_LEVEL: ${{ matrix.api }}
Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:

env:
# TODO: set to master
ROC_REVISION: v0.2.6
ROC_REVISION: v0.3.0
SDK_LEVEL: ${{ matrix.sdk }}
API_LEVEL: ${{ matrix.api }}
NDK_VERSION: ${{ matrix.ndk }}
Expand Down
5 changes: 5 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ Run tests:
./gradlew test
```

Run tests and print logs:
```
./gradlew test --info
```

Generate documentation:
```
./gradlew javadoc
Expand Down
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,17 @@ Documentation for the C API can be found [here](https://roc-streaming.org/toolki
#### Sender

```java
import org.rocstreaming.roctoolkit;
import org.rocstreaming.roctoolkit.*;

try (RocContext context = new RocContext()) {
RocSenderConfig config = RocSenderConfig.builder()
.frameSampleRate(44100)
.frameChannels(ChannelSet.STEREO)
.frameEncoding(FrameEncoding.PCM_FLOAT)
.frameEncoding(
MediaEncoding.builder()
.rate(44100)
.format(Format.PCM_FLOAT32)
.channels(ChannelLayout.STEREO)
.build()
)
.fecEncoding(FecEncoding.RS8M)
.clockSource(ClockSource.INTERNAL)
.build();
Expand All @@ -67,13 +71,17 @@ try (RocContext context = new RocContext()) {
#### Receiver

```java
import org.rocstreaming.roctoolkit;
import org.rocstreaming.roctoolkit.*;

try (RocContext context = new RocContext()) {
RocReceiverConfig config = RocReceiverConfig.builder()
.frameSampleRate(44100)
.frameChannels(ChannelSet.STEREO)
.frameEncoding(FrameEncoding.PCM_FLOAT)
.frameEncoding(
MediaEncoding.builder()
.rate(44100)
.format(Format.PCM_FLOAT32)
.channels(ChannelLayout.STEREO)
.build()
)
.clockSource(ClockSource.INTERNAL)
.build();

Expand Down
1 change: 1 addition & 0 deletions eclipse-format-prefs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="false"/>

<setting id="org.eclipse.jdt.core.formatter.wrap_before_additive_operator" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator" value="false"/>
Expand Down
61 changes: 33 additions & 28 deletions roc_jni/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- cmake-tab-width: 4 -*-
cmake_minimum_required(VERSION 3.10)

project(RocJni C)
Expand All @@ -12,29 +13,28 @@ if(APPLE)
endif()

add_library(roc_jni SHARED
src/main/impl/channel_set.c
src/main/impl/clock_source.c
src/main/impl/common.c
src/main/impl/context.c
src/main/impl/endpoint.c
src/main/impl/fec_encoding.c
src/main/impl/frame_encoding.c
src/main/impl/logger.c
src/main/impl/packet_encoding.c
src/main/impl/protocol.c
src/main/impl/receiver.c
src/main/impl/resampler_backend.c
src/main/impl/resampler_profile.c
src/main/impl/sender.c
)
src/main/impl/context.c
src/main/impl/context_config.c
src/main/impl/endpoint.c
src/main/impl/helpers.c
src/main/impl/interface_config.c
src/main/impl/logger.c
src/main/impl/media_encoding.c
src/main/impl/receiver.c
src/main/impl/receiver_config.c
src/main/impl/sender.c
src/main/impl/sender_config.c
)

target_compile_options(roc_jni PRIVATE
-Wall
-Wextra
-Wno-system-headers
-Wno-unused-but-set-variable
-Wno-unused-parameter
)
# enable assertions (even in release build)
-UNDEBUG
)

if(NOT ANDROID)
if (NOT CMAKE_CROSSCOMPILING)
Expand All @@ -45,19 +45,19 @@ if(NOT ANDROID)
endif()

target_include_directories(roc_jni
PRIVATE src/main/impl/
PUBLIC src/main/export/
)
PRIVATE src/main/impl/
PUBLIC src/main/export/
)

if(ANDROID)
# include libroc headers
target_include_directories(roc_jni SYSTEM PRIVATE
${ROC_DIR}/include/${ANDROID_ABI})
${ROC_DIR}/include/${ANDROID_ABI})

# link libroc shared library
add_library(lib_roc SHARED IMPORTED)
set_target_properties(lib_roc PROPERTIES IMPORTED_LOCATION
${ROC_DIR}/lib/${ANDROID_ABI}/libroc.so)
${ROC_DIR}/lib/${ANDROID_ABI}/libroc.so)
target_link_libraries(roc_jni lib_roc)
else()
# include libroc headers
Expand All @@ -75,22 +75,27 @@ else()
AND NOT ROC_LIBRARY_PATH STREQUAL "")
add_library(lib_roc SHARED IMPORTED)
set_target_properties(lib_roc PROPERTIES IMPORTED_LOCATION
${ROC_LIBRARY_PATH}/libroc${CMAKE_SHARED_LIBRARY_SUFFIX})
${ROC_LIBRARY_PATH}/libroc${CMAKE_SHARED_LIBRARY_SUFFIX})
target_link_libraries(roc_jni lib_roc)
elseif(DEFINED ENV{ROC_LIBRARY_PATH}
AND NOT ENV{ROC_LIBRARY_PATH} STREQUAL "")
add_library(lib_roc SHARED IMPORTED)
set_target_properties(lib_roc PROPERTIES IMPORTED_LOCATION
$ENV{ROC_LIBRARY_PATH}/libroc${CMAKE_SHARED_LIBRARY_SUFFIX})
$ENV{ROC_LIBRARY_PATH}/libroc${CMAKE_SHARED_LIBRARY_SUFFIX})
target_link_libraries(roc_jni lib_roc)
else()
target_link_libraries(roc_jni -lroc)
endif()
endif()

add_custom_command(TARGET roc_jni POST_BUILD
add_custom_command(
COMMENT "Copying compile_commands.json to project root"
COMMAND "${CMAKE_COMMAND}" -E copy
"${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json"
"${PROJECT_SOURCE_DIR}/compile_commands.json"
)
DEPENDS roc_jni
OUTPUT ${PROJECT_SOURCE_DIR}/compile_commands.json
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json
${PROJECT_SOURCE_DIR}/compile_commands.json
)
add_custom_target(compile_commands ALL
DEPENDS ${PROJECT_SOURCE_DIR}/compile_commands.json
)
20 changes: 10 additions & 10 deletions roc_jni/src/main/export/org_rocstreaming_roctoolkit_Endpoint.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions roc_jni/src/main/export/org_rocstreaming_roctoolkit_RocContext.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 24 additions & 16 deletions roc_jni/src/main/export/org_rocstreaming_roctoolkit_RocReceiver.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading