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

Dev/1.9.1 #81

Merged
merged 4 commits into from
Jul 2, 2024
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
2 changes: 1 addition & 1 deletion demos/demo-android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ dependencies {
implementation 'com.jakewharton.timber:timber:5.0.1'
implementation 'io.coil-kt:coil-compose:2.2.2'
implementation "io.ktor:ktor-client-cio:2.3.9"
implementation "com.ricoh360.thetaclient:theta-client:1.9.0"
implementation "com.ricoh360.thetaclient:theta-client:1.9.1"

testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0'
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ target 'SdkSample' do
use_frameworks!

# Pods for SdkSample
pod 'THETAClient', '1.9.0'
pod 'THETAClient', '1.9.1'
end
2 changes: 1 addition & 1 deletion demos/demo-react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@react-navigation/native": "^6.1.0",
"@react-navigation/native-stack": "^6.9.5",
"theta-client-react-native": "1.9.0",
"theta-client-react-native": "1.9.1",
"react": "18.2.0",
"react-native": "0.71.14",
"react-native-safe-area-context": "^4.4.1",
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-android.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- モジュールの`build.gradle`の`dependencies`に次を追加します。
```
implementation "com.ricoh360.thetaclient:theta-client:1.9.0"
implementation "com.ricoh360.thetaclient:theta-client:1.9.1"
```
- 本 SDK を使用したアプリケーションが動作するスマートフォンと THETA を無線 LAN 接続しておきます。

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- Add following descriptions to the `dependencies` of your module's `build.gradle`.

```
implementation "com.ricoh360.thetaclient:theta-client:1.9.0"
implementation "com.ricoh360.thetaclient:theta-client:1.9.1"
```

- Connect the wireless LAN between THETA and the smartphone that runs on the application using this SDK.
Expand Down
2 changes: 1 addition & 1 deletion flutter/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ dependencies {
implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.9")
implementation("com.soywiz.korlibs.krypto:krypto:4.0.10")

implementation("com.ricoh360.thetaclient:theta-client:1.9.0")
implementation("com.ricoh360.thetaclient:theta-client:1.9.1")
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ class ThetaClientFlutterPlugin : FlutterPlugin, MethodCallHandler {
}
}

"getThetaLicense" -> {
scope.launch {
getThetaLicense(result)
}
}

"getThetaState" -> {
scope.launch {
getThetaState(result)
Expand Down Expand Up @@ -574,6 +580,19 @@ class ThetaClientFlutterPlugin : FlutterPlugin, MethodCallHandler {
}
}

suspend fun getThetaLicense(result: Result) {
if (thetaRepository == null) {
result.error(errorCode, messageNotInit, null)
return
}
try {
val response = thetaRepository!!.getThetaLicense()
result.success(response)
} catch (e: Exception) {
result.error(e.javaClass.simpleName, e.message, null)
}
}

suspend fun getThetaState(result: Result) {
if (thetaRepository == null) {
result.error(errorCode, messageNotInit, null)
Expand Down
27 changes: 25 additions & 2 deletions flutter/ios/Classes/SwiftThetaClientFlutterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public class SwiftThetaClientFlutterPlugin: NSObject, FlutterPlugin, FlutterStre
getThetaModel(result: result)
case "getThetaInfo":
getThetaInfo(result: result)
case "getThetaLicense":
getThetaLicense(result: result)
case "getThetaState":
getThetaState(result: result)
case "getLivePreview":
Expand Down Expand Up @@ -330,16 +332,37 @@ public class SwiftThetaClientFlutterPlugin: NSObject, FlutterPlugin, FlutterStre
}
}

func getThetaState(result: @escaping FlutterResult) {
func getThetaLicense(result: @escaping FlutterResult) {
if thetaRepository == nil {
let flutterError = FlutterError(code: SwiftThetaClientFlutterPlugin.errorCode, message: SwiftThetaClientFlutterPlugin.messageNotInit, details: nil)
result(flutterError)
return
}
thetaRepository!.getThetaState { response, error in
thetaRepository!.getThetaLicense(completionHandler: { response, error in
if let thetaError = error {
let flutterError = FlutterError(code: SwiftThetaClientFlutterPlugin.errorCode, message: thetaError.localizedDescription, details: nil)
result(flutterError)
} else {
if let response {
result(response)
} else {
let flutterError = FlutterError(code: SwiftThetaClientFlutterPlugin.errorCode, message: SwiftThetaClientFlutterPlugin.messageNoResult, details: nil)
result(flutterError)
}
}
})
}

func getThetaState(result: @escaping FlutterResult) {
if thetaRepository == nil {
let flutterError = FlutterError(code: SwiftThetaClientFlutterPlugin.errorCode, message: SwiftThetaClientFlutterPlugin.messageNotInit, details: nil)
result(flutterError)
return
}
thetaRepository!.getThetaState { response, error in
if let error {
let flutterError = FlutterError(code: SwiftThetaClientFlutterPlugin.errorCode, message: error.localizedDescription, details: nil)
result(flutterError)
} else {
let resultState = convertResult(thetaState: response!)
result(resultState)
Expand Down
4 changes: 2 additions & 2 deletions flutter/ios/theta_client_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'theta_client_flutter'
s.version = '1.9.0'
s.version = '1.9.1'
s.summary = 'theta-client plugin project.'
s.description = <<-DESC
theta-client Flutter plugin project.
Expand All @@ -17,7 +17,7 @@ Pod::Spec.new do |s|
s.dependency 'Flutter'
s.platform = :ios, '15.0'

s.dependency 'THETAClient', '1.9.0'
s.dependency 'THETAClient', '1.9.1'

# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
Expand Down
17 changes: 11 additions & 6 deletions flutter/lib/capture/capture.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,25 @@ class Capture {
Capture(this._options);
}

/// Common PhotoCapture class
class PhotoCaptureBase extends Capture {
PhotoCaptureBase(super.options);

/// Get photo file format.
PhotoFileFormatEnum? getFileFormat() {
return _options[TagNameEnum.photoFileFormat.rawValue];
}
}

/// Capture of Photo
class PhotoCapture extends Capture {
class PhotoCapture extends PhotoCaptureBase {
PhotoCapture(super.options);

/// Get image processing filter.
FilterEnum? getFilter() {
return _options[OptionNameEnum.filter.rawValue];
}

/// Get photo file format.
PhotoFileFormatEnum? getFileFormat() {
return _options[TagNameEnum.photoFileFormat.rawValue];
}

/// Get preset mode of Theta SC2 and Theta SC2 for business.
PresetEnum? getPreset() {
return _options[OptionNameEnum.preset.rawValue];
Expand Down
113 changes: 108 additions & 5 deletions flutter/lib/capture/capture_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,17 @@ class CaptureBuilder<T> {
}
}

/// Builder of [PhotoCapture]
class PhotoCaptureBuilder extends CaptureBuilder<PhotoCaptureBuilder> {
/// Common PhotoCaptureBuilder class
class PhotoCaptureBuilderBase<T> extends CaptureBuilder<T> {
/// Set photo file format.
PhotoCaptureBuilder setFileFormat(PhotoFileFormatEnum fileFormat) {
T setFileFormat(PhotoFileFormatEnum fileFormat) {
_options[TagNameEnum.photoFileFormat.rawValue] = fileFormat;
return this;
return this as T;
}
}

/// Builder of [PhotoCapture]
class PhotoCaptureBuilder extends PhotoCaptureBuilderBase<PhotoCaptureBuilder> {

/// Set image processing filter.
PhotoCaptureBuilder setFilter(FilterEnum filter) {
Expand All @@ -106,7 +110,8 @@ class PhotoCaptureBuilder extends CaptureBuilder<PhotoCaptureBuilder> {
Future<PhotoCapture> build() async {
var completer = Completer<PhotoCapture>();
try {
await ThetaClientFlutterPlatform.instance.buildPhotoCapture(_options);
await ThetaClientFlutterPlatform.instance
.buildPhotoCapture(_options);
completer.complete(PhotoCapture(_options));
} catch (e) {
completer.completeError(e);
Expand Down Expand Up @@ -456,6 +461,13 @@ enum VideoFileFormatEnum {
/// For RICOH THETA Z1 or V
video_2K(FileFormatEnum.video_2K),

/// Video File format.
/// type: mp4
/// size: 1920 x 960
///
/// For RICOH THETA SC2 or SC2 for business
video_2KnoCodec(FileFormatEnum.video_2KnoCodec),

/// Video File format.
/// type: mp4
/// size: 3840 x 1920
Expand All @@ -464,6 +476,13 @@ enum VideoFileFormatEnum {
/// For RICOH THETA Z1 or V
video_4K(FileFormatEnum.video_4K),

/// Video File format.
/// type: mp4
/// size: 3840 x 1920
///
/// For RICOH THETA SC2 or SC2 for business
video_4KnoCodec(FileFormatEnum.video_4KnoCodec),

/// Video File format.
/// type: mp4
/// size: 1920 x 960
Expand All @@ -482,6 +501,54 @@ enum VideoFileFormatEnum {
/// For RICOH THETA X or later
video_2K_60F(FileFormatEnum.video_2K_60F),

/// Video File format.
///
/// type: mp4
/// size: 2752 x 2752
/// codec: H.264/MPEG-4 AVC
/// frame rate: 2
///
/// RICOH THETA X firmware v2.50.2 or later.
/// This mode outputs two fisheye video for each lens.
/// The MP4 file name ending with _0 is the video file on the front lens, and _1 is back lens.
video_2_7K_2752_2F(FileFormatEnum.video_2_7K_2752_2F),

/// Video File format.
///
/// type: mp4
/// size: 2752 x 2752
/// codec: H.264/MPEG-4 AVC
/// frame rate: 5
///
/// RICOH THETA X firmware v2.50.2 or later.
/// This mode outputs two fisheye video for each lens.
/// The MP4 file name ending with _0 is the video file on the front lens, and _1 is back lens.
video_2_7K_2752_5F(FileFormatEnum.video_2_7K_2752_5F),

/// Video File format.
///
/// type: mp4
/// size: 2752 x 2752
/// codec: H.264/MPEG-4 AVC
/// frame rate: 10
///
/// RICOH THETA X firmware v2.50.2 or later.
/// This mode outputs two fisheye video for each lens.
/// The MP4 file name ending with _0 is the video file on the front lens, and _1 is back lens.
video_2_7K_2752_10F(FileFormatEnum.video_2_7K_2752_10F),

/// Video File format.
///
/// type: mp4
/// size: 2752 x 2752
/// codec: H.264/MPEG-4 AVC
/// frame rate: 30
///
/// RICOH THETA X firmware v2.50.2 or later.
/// This mode outputs two fisheye video for each lens.
/// The MP4 file name ending with _0 is the video file on the front lens, and _1 is back lens.
video_2_7K_2752_30F(FileFormatEnum.video_2_7K_2752_30F),

/// Video File format.
/// type: mp4
/// size: 2688 x 2688
Expand Down Expand Up @@ -530,6 +597,24 @@ enum VideoFileFormatEnum {
/// and _1 is back lens. This mode does not record audio track to MP4 file.
video_3_6K_2F(FileFormatEnum.video_3_6K_2F),

/// Video File format.
/// type: mp4
/// size: 3840 x 1920
/// codec: H.264/MPEG-4 AVC
/// frame rate: 10
///
/// For RICOH THETA X or later
video_4K_10F(FileFormatEnum.video_4K_10F),

/// Video File format.
/// type: mp4
/// size: 3840 x 1920
/// codec: H.264/MPEG-4 AVC
/// frame rate: 15
///
/// For RICOH THETA X or later
video_4K_15F(FileFormatEnum.video_4K_15F),

/// Video File format.
/// type: mp4
/// size: 3840 x 1920
Expand Down Expand Up @@ -566,6 +651,24 @@ enum VideoFileFormatEnum {
/// For RICOH THETA X or later
video_5_7K_5F(FileFormatEnum.video_5_7K_5F),

/// Video File format.
/// type: mp4
/// size: 5760 x 2880
/// codec: H.264/MPEG-4 AVC
/// frame rate: 10
///
/// For RICOH THETA X or later
video_5_7K_10F(FileFormatEnum.video_5_7K_10F),

/// Video File format.
/// type: mp4
/// size: 5760 x 2880
/// codec: H.264/MPEG-4 AVC
/// frame rate: 15
///
/// For RICOH THETA X or later
video_5_7K_15F(FileFormatEnum.video_5_7K_15F),

/// Video File format.
/// type: mp4
/// size: 5760 x 2880
Expand Down
Loading
Loading