Table of Contents

Class Recorder

Spazio dei nomi
easyar

Recorder implementa la funzionalità di registrazione dello schermo per l'ambiente di rendering corrente. Attualmente Recorder funziona solo su Android (4.3 o successivi) e in ambienti iOS con OpenGL ES 3.0. A causa della dipendenza da OpenGLES, tutte le funzioni di questa classe (eccetto requestPermissions, incluso il distruttore) devono essere chiamate in un singolo thread contenente il contesto OpenGLES. Solo Unity In Unity, se si utilizza la funzionalità Multi-threaded rendering, il thread dello script sarà separato dal thread di rendering, rendendo impossibile chiamare updateFrame sul thread di rendering. Pertanto, se è necessario utilizzare la registrazione dello schermo, disabilitare la funzionalità Multi-threaded rendering. Su Android è necessario dichiarare il permesso android.permission.RECORD_AUDIO in AndroidManifest.xml. Su iOS è necessario dichiarare il permesso NSMicrophoneUsageDescription in Info.plist.

Recorder

Metodi

isAvailable

Restituisce true solo su Android 4.3 o superiore o su 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. Puoi scegliere di usare questa funzione o richiedere i permessi chiamando autonomamente le funzioni di sistema. Efficace solo su Android e iOS, su altre piattaforme chiamerà direttamente il callback per notificare che i permessi sono concessi. Deve essere chiamata nel thread 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)

Parametri

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

Valore restituito

Tipo Descrizione
Void

create

Crea e inizializza la funzionalità di registrazione schermo. Lo statusCallback notificherà cambi di stato e 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 fotogramma utilizzando una 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

Interrompe la registrazione dello schermo. Dopo la chiamata a stop, attende la scrittura del file e restituisce l'esito della registrazione.

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