-
Notifications
You must be signed in to change notification settings - Fork 6
Description
As a background, I realized that on my integration of the iOS enterprise SDK version v1.8.2_build4, I can remove INSCoreMedia from the list of modules to be imported into the iOS application's Swift code.
However, INSCameraSDK has a dependency to INSCoreMedia. To elaborate more on this, please read the following:
INSCameraSDK v1.8.2-build4 has implicit dependencies on INSCoreMedia even for applications that only need basic camera control functionality. This results in:
- Linking Failures: The
INSInstaCameraInputsymbol is referenced inINSCameraSDK - Forced Dependencies: All INSCameraSDK users must include or link
INSCoreMediaframework that providesINSInstaCameraInputsymbol - No clear separation between core camera control and media playback features
Root Cause
The current framework structure tightly couples camera control with media processing:
- INSCameraSDK references
INSInstaCameraInputbut doesn't implement it - INSCoreMedia.xcframework located in
iOS_v1.8.2_build4/INSCameraSDKSample-bluetooth/Carthage/Build/INSCoreMedia.xcframeworkdoesn't implement it - INSCoreMedia.xcframework located in
iOS_v1.8.2_build4/INSCameraSDKSample-bluetooth/Frameworks/INSCoreMedia.xcframeworkcontains the implementation
This creates a situation where developers must choose between:
- Using the lite framework and getting linker errors
- Using the full framework and shipping unnecessary media processing code
Technical Details
Symbol Analysis
- Missing Symbol:
_OBJC_CLASS_$_INSInstaCameraInputand_OBJC_METACLASS_$_INSInstaCameraInput
nm -gU INSCoreMedia.xcframework/ios-arm64/INSCoreMedia.framework/INSCoreMedia | grep INSInstaCameraInput
0000000004a3d518 S _OBJC_CLASS_$_INSInstaCameraInput
0000000004a3d4f0 S _OBJC_METACLASS_$_INSInstaCameraInput- Referenced In:
INSCameraSDK.framework(undefined references) - Available In: Full
INSCoreMedia.xcframeworkonly - Missing From:
INSCoreMedia.xcframework(lite version)
Here are the ways to determine if INSInstaCameraInput is loaded at runtime from INSCameraSDK.xcframework:
- Using nm (Symbol Table Analysis)
nm INSCameraSDK.xcframework/ios-arm64/INSCameraSDK.framework/INSCameraSDK | grep -i instacamerainput
U _OBJC_CLASS_$_INSInstaCameraInput
- Shows
U _OBJC_CLASS_$_INSInstaCameraInput(undefined symbol) - The "U" indicates it's an undefined reference, meaning it's expected to be resolved at runtime
- Using objdump
objdump -t INSCameraSDK.xcframework/ios-arm64/INSCameraSDK.framework/INSCameraSDK | grep -i instacamerainput
0000000000000000 *UND* _OBJC_CLASS_$_INSInstaCameraInput
- Shows
*UND*(undefined) symbol for_OBJC_CLASS_$_INSInstaCameraInput
- Using strings
strings INSCameraSDK.xcframework/ios-arm64/INSCameraSDK.framework/INSCameraSDK | grep -i instacamerainput
T@"INSInstaCameraInput",&,N,V_input
@"INSInstaCameraInput"
- Shows string references including
@"INSInstaCameraInput"
- Using otool for Dependencies
otool -L INSCameraSDK.xcframework/ios-arm64/INSCameraSDK.framework/INSCameraSDK | grep -i inscoremedia
@rpath/INSCoreMedia.framework/INSCoreMedia (compatibility version 1.0.0, current version 1.0.0)
- Shows INSCoreMedia.framework as a dependency where INSInstaCameraInput likely resides
Affected Components
The following 10 headers in INSCameraSDK create hard dependencies on INSCoreMedia:
Player/Render/Session Layer:
INSCameraPreviewPlayer.h,INSCameraSessionPlayer.h,INSCameraPlayerRender.hINSCameraPlayerRenderView.h,INSCameraPlayerRenderSession.h,INSOffsetCalculator+Convert.h
Processing/Stabilization Layer:
INSCameraFlatPanoOutput.h,INSCameraStabilizer.h,INSDisplayInfo.h,INSCameraMediaSession.h
Reproduction Steps
- Create new iOS project
- Add
INSCameraSDK.xcframeworkandINSCoreMedia.xcframeworkfromiOS_v1.8.2_build4/INSCameraSDKSample-bluetooth/Carthage/Build/INSCoreMedia.xcframework - Use any live session features (e.g.,
INSInstaCameraSession) or simply launch the app withINSCameraSDKimported - Build for arm64 → Dynamic Linker Error: Symbol not found:
_OBJC_CLASS_$_INSInstaCameraInput
dyld[77717]: Symbol not found: _OBJC_CLASS_$_INSInstaCameraInput
Referenced from: <5E604B2F-FCF9-34B7-9D84-8A8E8E7D8CC9> /private/var/folders/6j/h78c119x50q2q347jj98w9yw0000gp/X/8ADC0B3D-5480-56A9-8586-F2955355A8A6/d/Wrapper/SCEApp.app/Frameworks/INSCameraSDK.framework/INSCameraSDK
Expected in: <A24D0769-FB1B-3D7D-9598-1BC7E33B21E5> /private/var/folders/6j/h78c119x50q2q347jj98w9yw0000gp/X/8ADC0B3D-5480-56A9-8586-F2955355A8A6/d/Wrapper/SCEApp.app/Frameworks/INSCoreMedia.framework/INSCoreMedia
Current State Impact
Developer Experience Issues
- Unclear Dependencies: Inconsistent documentation explaining implicit dependencies to
INSCoreMedia - Binary Size: Apps requiring only camera control forced to ship large media processing framework
- Build Complexity: Developers must manually manage framework variants
INSInstaCameraInput Usage References
The problematic symbol is referenced in:
INSCameraPlayerRenderSession.h:19- parameter in method signatureINSInstaCameraSession.h:10,49,57- import, property, and initializer parameter- Multiple header files referencing the class definition
Proposed Solution: Framework Architecture Refactor
The following is only a suggestion or proposal, the framework name such as INSCameraSDKCore or INSCameraSDKPlayer can be replaced based on a suitable naming convention.
1. Framework Split Strategy
Current Structure:
INSCameraSDK.framework → INSCoreMedia.framework, INSCameraServiceSDK.framework (forced dependency)
Proposed Structure:
INSCameraSDKCore.framework # Camera control only, no INSCoreMedia dependency
INSCameraSDKPlayer.framework # Media playback, depends on INSCoreMedia
INSCameraServiceSDK.framework (it should not depend on the other frameworks)
2. Component Separation
INSCameraSDKCore (lightweight):
- Camera connection and control
- Bluetooth pairing and commands
- Device activation and management
- Basic stitching and timelapse
- No media processing dependencies
INSCameraSDKPlayer (media-focused):
- Preview and session players
- Real-time stabilization
- Flat panorama output
- Live session management
- Depends on full INSCoreMedia
3. INSCoreMedia Variants
If they can be separated, provide clear framework variants:
- INSCoreMedia-Lite.xcframework: Offline rendering only (~8MB)
- INSCoreMedia.xcframework: Live sessions + offline (~20MB)
4. Benefits
For Developers:
- Smaller Apps: Reduction in framework size for camera-only apps
- Clearer Dependencies: Explicit choice between core vs full functionality
- Better Documentation: Clear separation of concerns
For Insta360:
- Reduced Support: Fewer dependency-related issues
- Faster Development: Independent evolution of camera and media layers
- Better Testing: Isolated testing of components
Implementation Suggestion
Analysis & Planning
- Audit all
INSCoreMediadependencies inINSCameraSDK - Define public APIs for Core vs Player frameworks
- Create module map specifications
Core Framework Creation
- Extract camera control code to
INSCameraSDKCore - Remove INSCoreMedia dependencies from
INSCameraSDKCore - Implement optional/weak linking patterns for frameworks that are optional
Player Framework Creation
- Move media processing code to INSCameraSDKPlayer
- Ensure proper INSCoreMedia integration
- Add re-export module maps
Distribution & Documentation
- Create
xcframeworkbinaries for arm64 architecture (iphonesimulator),x86_64is no longer needed - Update documentation and migration guides
Environment
- SDK Version: 1.8.2-build4
- Platform: iOS arm64
- Xcode: 16.4+