Skip to content
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

Update NativeCamera to support MediaStreamTrack API #1158

Merged
merged 30 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
27f1895
MediaStreamTrack ownership and single NativeCameraImpl header
CoPrez Oct 19, 2022
8fc3ee7
Torch works!
CoPrez Oct 21, 2022
0ef1dd3
Constraints are broken out now
CoPrez Oct 25, 2022
14871a6
Generic types are more generic
CoPrez Oct 26, 2022
6f7fddf
Add zoom capability and more polyfill
CoPrez Oct 26, 2022
10cde11
Fix MacOS and BN build breaks
CoPrez Oct 27, 2022
eff838e
Fixing another build issue
CoPrez Oct 27, 2022
ceb47c0
Cleaning up MediaStream init, hack for instanceof fix
CoPrez Oct 30, 2022
6c5e5ca
Update stubs for unsupported platforms
CoPrez Oct 30, 2022
4617980
Addressing build and runtime issues
CoPrez Oct 30, 2022
a2ed121
Fix assert being undefined
CoPrez Oct 30, 2022
bf398db
Fixing the picky linux compiler and android jcenter issues
CoPrez Oct 31, 2022
84f67e1
Stop being so picky linux
CoPrez Oct 31, 2022
7d7898b
Stop being so picky android/maven
CoPrez Oct 31, 2022
d2faf11
Remove isNative
CoPrez Nov 1, 2022
874f651
Swapping shared_ptr with unique_ptr where appropriate
CoPrez Nov 2, 2022
9d1db7a
Apply suggestions from code review
CoPrez Nov 2, 2022
a714fff
Impl PImpl more gooder and remove shared_ptrs
CoPrez Nov 3, 2022
bc69636
Fix non-supported platforms
CoPrez Nov 3, 2022
2423237
Adding a bit extra type checking
CoPrez Nov 14, 2022
d68cb75
Removing NativeCameraImpl and renaming classes to clarify intents
CoPrez Nov 15, 2022
aa9dfc0
Responding to PR feedback
CoPrez Nov 15, 2022
a192471
Splitting Capability and Constraint into separate files and styling u…
CoPrez Nov 15, 2022
9f7221e
Add Constraints.cpp because Android builds fail with duplicate symbol…
CoPrez Nov 15, 2022
cec3127
Apply suggestions from code review
CoPrez Nov 16, 2022
f209711
Responding to PR feedback
CoPrez Nov 16, 2022
20c8196
Merge branch 'small-tweak-to-native-camera' of https://github.com/CoP…
CoPrez Nov 16, 2022
0ea6e35
Upper Case EveryWhere
CoPrez Nov 16, 2022
bacf773
Fixing up whitespace
CoPrez Nov 16, 2022
86aa1aa
Fix threading issue on destruction
CoPrez Nov 16, 2022
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
9 changes: 5 additions & 4 deletions Apps/Playground/Android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ android {
applicationId "com.android.babylonnative.playground"
minSdkVersion "${platformVersion}"
targetSdkVersion 28
ndkVersion "21.4.7075529"
if (project.hasProperty("NDK_VERSION")) {
def NDKVersion = project.property("NDK_VERSION")
ndkVersion "${NDK_VERSION}"
}
externalNativeBuild {
cmake {
abiFilters "arm64-v8a", "armeabi-v7a", "x86", "x86_64"
Expand All @@ -61,10 +66,6 @@ android {
} else {
abiFilters "arm64-v8a", "armeabi-v7a", "x86"
}
if (project.hasProperty("NDK_VERSION")) {
def NDKVersion = project.property("NDK_VERSION")
ndkVersion "${NDK_VERSION}"
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions Apps/Playground/Android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ buildscript {

repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
Expand All @@ -17,6 +18,7 @@ buildscript {
allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}
7 changes: 6 additions & 1 deletion Plugins/NativeCamera/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ endif()

set(SOURCES
"Include/Babylon/Plugins/NativeCamera.h"
"Source/CameraCapability.h"
"Source/CameraCapability.cpp"
"Source/MediaStream.h"
"Source/MediaStream.cpp"
"Source/NativeCamera.cpp"
"Source/NativeVideo.cpp"
"Source/NativeVideo.h"
"Source/${PLATFORM}/NativeCameraImpl.h"
"Source/NativeCameraImpl.h"
"Source/NativeCameraImplShared.h"
"Source/${PLATFORM}/NativeCameraImpl.${BABYLON_NATIVE_PLATFORM_IMPL_EXT}")

add_library(NativeCamera ${SOURCES})
Expand Down
7 changes: 3 additions & 4 deletions Plugins/NativeCamera/Include/Babylon/Plugins/NativeCamera.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ namespace Babylon::Plugins
// Initialization with overrideCameraTexture set to true means the caller
// is expected to override the camera source texture with a native texture.
// In that case, the HW camera will not be open.
CoPrez marked this conversation as resolved.
Show resolved Hide resolved
static Camera Initialize(Napi::Env env, bool overrideCameraTexture = false);
static Camera Initialize(Napi::Env env);
CoPrez marked this conversation as resolved.
Show resolved Hide resolved
CoPrez marked this conversation as resolved.
Show resolved Hide resolved

void SetTextureOverride(void* texturePtr);
static Napi::Value GetUserMedia(const Napi::CallbackInfo& info);
CoPrez marked this conversation as resolved.
Show resolved Hide resolved

private:
Camera(std::shared_ptr<Impl> impl);
std::shared_ptr<Impl> m_impl{};
Camera();
};
}
463 changes: 269 additions & 194 deletions Plugins/NativeCamera/Source/Android/NativeCameraImpl.cpp

Large diffs are not rendered by default.

69 changes: 0 additions & 69 deletions Plugins/NativeCamera/Source/Android/NativeCameraImpl.h

This file was deleted.

40 changes: 0 additions & 40 deletions Plugins/NativeCamera/Source/Apple/NativeCameraImpl.h

This file was deleted.

Loading