Table of Contents

Class Recorder

Espace de noms
easyar

Recorder implémente la fonctionnalité d'enregistrement d'écran pour l'environnement de rendu actuel. Actuellement, Recorder fonctionne uniquement dans les environnements Android (4.3 ou plus récent) et iOS avec OpenGL ES 3.0. En raison de sa dépendance à OpenGLES, toutes les fonctions de cette classe (à l'exception de requestPermissions, y compris le destructeur) doivent être appelées dans un unique thread contenant un contexte OpenGLES. Unity Uniquement Dans Unity, si la fonctionnalité Multi-threaded rendering est utilisée, le thread de script sera séparé du thread de rendu, rendant impossible l'appel de updateFrame sur le thread de rendu. Par conséquent, si vous avez besoin d'utiliser l'enregistrement d'écran, vous devriez désactiver la fonctionnalité Multi-threaded rendering. Pour une utilisation sur Android, la déclaration de permission android.permission.RECORD_AUDIO doit être ajoutée dans AndroidManifest.xml. Pour une utilisation sur iOS, la déclaration de permission NSMicrophoneUsageDescription doit être ajoutée dans Info.plist.

Recorder

Méthodes

isAvailable

Uniquement sur Android 4.3 ou supérieur ou plateforme iOS renvoie 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()

Retours

Type Description
Boolean

requestPermissions

Demander les autorisations système requises pour l'enregistrement d'écran. Vous pouvez choisir d'utiliser cette fonction ou d'appeler vous-même les fonctions système pour demander l'autorisation. Valide uniquement sur les plateformes Android et iOS, sur les autres plateformes, le comportement consiste à appeler directement le callback pour notifier que l'autorisation est accordée. Doit être appelée dans le 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)

Paramètres

Nom Type Description
callbackScheduler CallbackScheduler
permissionCallback Optional<Action<PermissionStatus,String>>

Retours

Type Description
Void

create

Créer et initialiser la fonction d'enregistrement d'écran. Le callback statusCallback informe des changements d'état et des logs correspondants.

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)

Paramètres

Nom Type Description
config RecorderConfiguration
callbackScheduler CallbackScheduler
statusCallback Optional<Action<RecordStatus,>>

Retours

Type Description
Recorder

start

Commencer l'enregistrement.

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

Retours

Type Description
Void

updateFrame

Enregistrer une trame de données à l'aide de 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)

Paramètres

Nom Type Description
texture TextureId
width Int32
height Int32

Retours

Type Description
Void

stop

Arrêter l'enregistrement d'écran. Après avoir appelé stop, il attendra que l'écriture du fichier se termine et renverra le résultat indiquant si l'enregistrement a réussi.

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

Retours

Type Description
Boolean