Table of Contents

Class Recorder

名前空間
easyar

Recorderは、現在のレンダリング環境の画面録画機能を実装しています。 現在、RecorderはAndroid(4.3以降)およびiOSのOpenGL ES 3.0環境でのみ動作します。 OpenGLESに依存しているため、このクラスのすべての関数(requestPermissionsを除く、デストラクタを含む)は、OpenGLESコンテキストを含む単一のスレッドで呼び出さなければなりません。 Unity専用 Unityでマルチスレッドレンダリング機能を使用する場合、スクリプトスレッドはレンダリングスレッドから分離され、レンダリングスレッドでupdateFrameを呼び出すことができません。したがって、画面録画機能を使用する必要がある場合は、マルチスレッドレンダリング機能を無効にする必要があります。 Androidで使用する場合、AndroidManifest.xmlにandroid.permission.RECORD_AUDIO権限の宣言を追加する必要があります。 iOSで使用する場合、Info.plistにNSMicrophoneUsageDescription権限の宣言を追加する必要があります。

Recorder

メソッド

isAvailable

Android 4.3以上またはiOSプラットフォームでのみtrueを返します。

bool easyar_Recorder_isAvailable(void)
static bool isAvailable()
public static boolean isAvailable()
companion object fun isAvailable(): Boolean
+ (bool)isAvailable
public static func isAvailable() -> Bool
public static bool isAvailable()

戻り値

説明
Boolean

requestPermissions

画面録画に必要なシステム権限をリクエストします。この関数を使用するか、自分でシステム関数を呼び出して権限を申請するかを選択できます。AndroidおよびiOSプラットフォームでのみ有効であり、他のプラットフォームでは、コールバックを直接呼び出して権限が付与されたことを通知します。UIスレッドでこの関数を呼び出す必要があります。

void easyar_Recorder_requestPermissions(easyar_CallbackScheduler * callbackScheduler, easyar_OptionalOfFunctorOfVoidFromPermissionStatusAndString permissionCallback)
static void requestPermissions(std::shared_ptr<CallbackScheduler> callbackScheduler, std::optional<std::function<void(PermissionStatus, std::string)>> permissionCallback)
public static void requestPermissions(@Nonnull CallbackScheduler callbackScheduler, @Nullable FunctorOfVoidFromPermissionStatusAndString permissionCallback)
companion object fun requestPermissions(callbackScheduler: CallbackScheduler, permissionCallback: FunctorOfVoidFromPermissionStatusAndString?): Unit
+ (void)requestPermissions:(easyar_CallbackScheduler *)callbackScheduler permissionCallback:(void (^)(easyar_PermissionStatus status, NSString * value))permissionCallback
public static func requestPermissions(_ callbackScheduler: CallbackScheduler, _ permissionCallback: ((PermissionStatus, String) -> Void)?) -> Void
public static void requestPermissions(CallbackScheduler callbackScheduler, Optional<Action<PermissionStatus, string>> permissionCallback)

パラメーター

名前 説明
callbackScheduler CallbackScheduler
permissionCallback Optional<Action<PermissionStatus,String>>

戻り値

説明
Void

create

画面録画機能を作成および初期化します。statusCallbackコールバックで、いくつかの状態変化と対応するログが通知されます。

void easyar_Recorder_create(easyar_RecorderConfiguration * config, easyar_CallbackScheduler * callbackScheduler, easyar_OptionalOfFunctorOfVoidFromRecordStatusAndString statusCallback, easyar_Recorder * * Return)
static std::shared_ptr<Recorder> create(std::shared_ptr<RecorderConfiguration> config, std::shared_ptr<CallbackScheduler> callbackScheduler, std::optional<std::function<void(RecordStatus, std::string)>> statusCallback)
public static @Nonnull Recorder create(@Nonnull RecorderConfiguration config, @Nonnull CallbackScheduler callbackScheduler, @Nullable FunctorOfVoidFromRecordStatusAndString statusCallback)
companion object fun create(config: RecorderConfiguration, callbackScheduler: CallbackScheduler, statusCallback: FunctorOfVoidFromRecordStatusAndString?): Recorder
+ (easyar_Recorder *)create:(easyar_RecorderConfiguration *)config callbackScheduler:(easyar_CallbackScheduler *)callbackScheduler statusCallback:(void (^)(easyar_RecordStatus status, NSString * value))statusCallback
public static func create(_ config: RecorderConfiguration, _ callbackScheduler: CallbackScheduler, _ statusCallback: ((RecordStatus, String) -> Void)?) throws -> Recorder
public static Recorder create(RecorderConfiguration config, CallbackScheduler callbackScheduler, Optional<Action<RecordStatus, string>> statusCallback)

パラメーター

名前 説明
config RecorderConfiguration
callbackScheduler CallbackScheduler
statusCallback Optional<Action<RecordStatus,>>

戻り値

説明
Recorder

start

画面録画を開始します。

void easyar_Recorder_start(easyar_Recorder * This)
void start()
public void start()
fun start(): Unit
- (void)start
public func start() -> Void
public virtual void start()

戻り値

説明
Void

updateFrame

テクスチャを使用して1フレームのデータを録画します。

void easyar_Recorder_updateFrame(easyar_Recorder * This, easyar_TextureId * texture, int width, int height)
void updateFrame(std::shared_ptr<TextureId> texture, int width, int height)
public void updateFrame(@Nonnull TextureId texture, int width, int height)
fun updateFrame(texture: TextureId, width: Int, height: Int): Unit
- (void)updateFrame:(easyar_TextureId *)texture width:(int)width height:(int)height
public func updateFrame(_ texture: TextureId, _ width: Int32, _ height: Int32) -> Void
public virtual void updateFrame(TextureId texture, int width, int height)

パラメーター

名前 説明
texture TextureId
width Int32
height Int32

戻り値

説明
Void

stop

画面録画を停止します。stopを呼び出した後、ファイルの書き込みが終了するのを待ち、録画が成功したかどうかの結果を返します。

bool easyar_Recorder_stop(easyar_Recorder * This)
bool stop()
public boolean stop()
fun stop(): Boolean
- (bool)stop
public func stop() -> Bool
public virtual bool stop()

戻り値

説明
Boolean