Table of Contents

Class Recorder

名前空間
easyar

Recorder は現在のレンダリング環境の画面録画機能を実装します。 現在の Recorder は Android(4.3 以降)および iOS の OpenGL ES 3.0 環境でのみ動作します。 OpenGLES に依存するため、このクラスのすべての関数(requestPermissions を除く、デストラクタを含む)は、OpenGLES コンテキストを含む単一のスレッドで呼び出す必要があります。 Unity Only Unity で Multi-threaded rendering 機能を使用する場合、スクリプトスレッドはレンダリングスレッドから分離され、レンダリングスレッド上で updateFrame を呼び出せません。そのため、画面録画機能を使用する必要がある場合は、Multi-threaded rendering 機能を無効にしてください。 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 プラットフォームでのみ有効です。他のプラットフォームでは、権限が付与済みであることを通知する callback を直接呼び出します。この関数は UI thread で呼び出してください。

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 callback でいくつかの状態変化と対応するログが通知されます。

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

texture を使用して 1 frame のデータを録画します。

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