Table of Contents

Class Recorder

Espaço de nomes
easyar

Recorder implementa gravação de tela para o ambiente de renderização atual. O Recorder atual funciona apenas no Android (4.3 ou posterior) e no ambiente OpenGL ES 3.0 no iOS. Como depende de OpenGLES, todas as funções desta classe (exceto requestPermissions, incluindo o destrutor) devem ser chamadas em uma única thread que contenha um contexto OpenGLES. Unity Only No Unity, se Multi-threaded rendering for usado, a thread de script será separada da thread de renderização, e updateFrame não poderá ser chamado na thread de renderização. Portanto, se a gravação de tela for necessária, Multi-threaded rendering deve ser desativado. Ao usar no Android, a declaração de permissão android.permission.RECORD_AUDIO deve ser adicionada a AndroidManifest.xml. Ao usar no iOS, a declaração de permissão NSMicrophoneUsageDescription deve ser adicionada a Info.plist.

Recorder

Métodos

isAvailable

Retorna true somente no Android 4.3 ou posterior, ou na 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()

Retorna

Tipo Descrição
Boolean

requestPermissions

Solicita as permissões do sistema necessárias para gravação de tela. Você pode optar por usar esta função ou chamar funções do sistema por conta própria para solicitar permissões. É válida apenas nas plataformas Android e iOS. Em outras plataformas, o comportamento é chamar diretamente o callback para notificar que a permissão foi concedida. Esta função deve ser chamada na 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

Nome Tipo Descrição
callbackScheduler CallbackScheduler
permissionCallback Optional<Action<PermissionStatus,String>>

Retorna

Tipo Descrição
Void

create

Cria e inicializa a função de gravação de tela. O callback statusCallback notificará algumas mudanças de status e os logs correspondentes.

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

Nome Tipo Descrição
config RecorderConfiguration
callbackScheduler CallbackScheduler
statusCallback Optional<Action<RecordStatus,>>

Retorna

Tipo Descrição
Recorder

start

Inicia a gravação de tela.

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

Retorna

Tipo Descrição
Void

updateFrame

Grava um frame de dados 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

Nome Tipo Descrição
texture TextureId
width Int32
height Int32

Retorna

Tipo Descrição
Void

stop

Para a gravação de tela. Depois que stop é chamado, aguarda o término da escrita do arquivo e retorna se a gravação foi bem-sucedida.

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

Retorna

Tipo Descrição
Boolean