Table of Contents

Class Recorder

네임스페이스
easyar

Recorder는 현재 렌더링 환경의 화면 녹화 기능을 구현하였습니다. 현재 Recorder는 Android(4.3 이상) 및 iOS의 OpenGL ES 3.0 환경에서만 작동합니다. OpenGLES에 대한 의존성으로 인해, 이 클래스의 모든 함수(requestPermissions 제외, 소멸자 포함)는 OpenGLES 컨텍스트를 포함하는 단일 스레드 내에서 호출되어야 합니다. 유니티 전용 Unity에서 Multi-threaded rendering 기능을 사용하는 경우, 스크립트 스레드가 렌더링 스레드와 분리되어 updateFrame을 렌더링 스레드에서 호출할 수 없습니다. 따라서 화면 녹화 기능을 사용해야 하는 경우 Multi-threaded rendering 기능을 비활성화해야 합니다. Android 사용 시 AndroidManifest.xml에 android.permission.RECORD_AUDIO 권한 선언을 추가해야 합니다. iOS 사용 시 Info.plist에 NSMicrophoneUsageDescription(마이크 사용 권한에 대한 설명) 권한 선언을 추가해야 합니다.

Recorder

메서드

isAvailable

Android 4.3 이상 또는 iOS 플랫폼에서만 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()

반환 값

형식 설명
Boolean

requestPermissions

화면 녹화에 필요한 시스템 권한을 요청합니다. 이 함수를 사용하거나 직접 시스템 함수를 호출하여 권한을 신청할 수 있습니다. Android 및 iOS 플랫폼에서만 유효하며, 다른 플랫폼에서는 콜백을 직접 호출하여 권한이 부여되었음을 통지합니다. 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)

매개 변수

이름 형식 설명
callbackScheduler CallbackScheduler
permissionCallback Optional<Action<PermissionStatus,String>>

반환 값

형식 설명
Void

create

화면 녹화 기능을 생성하고 초기화합니다. statusCallback 콜백에서 일부 상태 변화와 해당 로그가 알림됩니다.

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)

매개 변수

이름 형식 설명
config RecorderConfiguration
callbackScheduler CallbackScheduler
statusCallback Optional<Action<RecordStatus,>>

반환 값

형식 설명
Recorder

start

화면 녹화를 시작합니다.

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

반환 값

형식 설명
Void

updateFrame

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)

매개 변수

이름 형식 설명
texture TextureId
width Int32
height Int32

반환 값

형식 설명
Void

stop

화면 녹화를 중지합니다. stop 호출 후, 파일 쓰기가 완료될 때까지 기다렸다가 녹화가 성공적으로 되었는지의 결과를 반환합니다.

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

반환 값

형식 설명
Boolean