Table of Contents

Class Recorder

Spazio dei nomi
easyar

Recorder implementa la registrazione dello schermo per l'ambiente di rendering corrente. L'attuale Recorder funziona solo su Android (4.3 o versioni successive) e nell'ambiente OpenGL ES 3.0 su iOS. Poiché dipende da OpenGLES, tutte le funzioni di questa classe (tranne requestPermissions, incluso il distruttore) devono essere chiamate in un singolo thread che contiene un contesto OpenGLES. Unity Only In Unity, se si usa Multi-threaded rendering, il thread degli script sarà separato dal thread di rendering e updateFrame non potrà essere chiamato sul thread di rendering. Pertanto, se è necessaria la registrazione dello schermo, la funzione Multi-threaded rendering deve essere disabilitata. Quando si usa su Android, la dichiarazione del permesso android.permission.RECORD_AUDIO deve essere aggiunta ad AndroidManifest.xml. Quando si usa su iOS, la dichiarazione del permesso NSMicrophoneUsageDescription deve essere aggiunta a Info.plist.

Recorder

Metodi

isAvailable

Restituisce true solo su Android 4.3 o versioni successive, oppure sulla piattaforma iOS.

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()

Valore restituito

Tipo Descrizione
Boolean

requestPermissions

Richiede i permessi di sistema necessari per la registrazione dello schermo. È possibile scegliere di usare questa funzione oppure chiamare autonomamente le funzioni di sistema per richiedere i permessi. È valida solo sulle piattaforme Android e iOS. Su altre piattaforme il comportamento consiste nel chiamare direttamente il callback per notificare che il permesso è stato concesso. Questa funzione deve essere chiamata sul 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)

Parametri

Nome Tipo Descrizione
callbackScheduler CallbackScheduler
permissionCallback Optional<Action<PermissionStatus,String>>

Valore restituito

Tipo Descrizione
Void

create

Crea e inizializza la funzione di registrazione dello schermo. Il callback statusCallback notifica alcune variazioni di stato e i log corrispondenti.

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)

Parametri

Nome Tipo Descrizione
config RecorderConfiguration
callbackScheduler CallbackScheduler
statusCallback Optional<Action<RecordStatus,>>

Valore restituito

Tipo Descrizione
Recorder

start

Avvia la registrazione dello schermo.

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()

Valore restituito

Tipo Descrizione
Void

updateFrame

Registra un frame di dati usando texture.

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)

Parametri

Nome Tipo Descrizione
texture TextureId
width Int32
height Int32

Valore restituito

Tipo Descrizione
Void

stop

Arresta la registrazione dello schermo. Dopo la chiamata a stop, attende la fine della scrittura del file e restituisce se la registrazione è riuscita.

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()

Valore restituito

Tipo Descrizione
Boolean