Table of Contents

Class Recorder

Espacio de nombres
easyar

Recorder implementa la grabación de pantalla para el entorno de renderización actual. El Recorder actual solo funciona en Android (4.3 o posterior) y en el entorno OpenGL ES 3.0 de iOS. Como depende de OpenGLES, todas las funciones de esta clase (excepto requestPermissions, incluido el destructor) deben llamarse en un único thread que contenga un contexto OpenGLES. Unity Only En Unity, si se usa Multi-threaded rendering, el thread de scripts se separa del thread de renderización y updateFrame no puede llamarse en el thread de renderización. Por lo tanto, si se necesita grabación de pantalla, se debe deshabilitar Multi-threaded rendering. Al usarlo en Android, debe agregarse la declaración de permiso android.permission.RECORD_AUDIO a AndroidManifest.xml. Al usarlo en iOS, debe agregarse la declaración de permiso NSMicrophoneUsageDescription a Info.plist.

Recorder

Métodos

isAvailable

Devuelve true solo en Android 4.3 o posterior, o en la plataforma 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()

Devuelve

Tipo Descripción
Boolean

requestPermissions

Solicita los permisos del sistema necesarios para la grabación de pantalla. Puede elegir usar esta función o llamar usted mismo a funciones del sistema para solicitar permisos. Solo es válida en Android e iOS. En otras plataformas, el comportamiento es llamar directamente al callback para notificar que el permiso se ha concedido. Esta función debe llamarse en el 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)

Parámetros

Nombre Tipo Descripción
callbackScheduler CallbackScheduler
permissionCallback Optional<Action<PermissionStatus,String>>

Devuelve

Tipo Descripción
Void

create

Crea e inicializa la función de grabación de pantalla. El callback statusCallback notificará algunos cambios de estado y los logs correspondientes.

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)

Parámetros

Nombre Tipo Descripción
config RecorderConfiguration
callbackScheduler CallbackScheduler
statusCallback Optional<Action<RecordStatus,>>

Devuelve

Tipo Descripción
Recorder

start

Inicia la grabación de pantalla.

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

Devuelve

Tipo Descripción
Void

updateFrame

Graba un frame de datos 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)

Parámetros

Nombre Tipo Descripción
texture TextureId
width Int32
height Int32

Devuelve

Tipo Descripción
Void

stop

Detiene la grabación de pantalla. Después de llamar a stop, espera a que termine la escritura del archivo y devuelve si la grabación tuvo éxito.

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

Devuelve

Tipo Descripción
Boolean