Table Of Contents

Previous topic

QRCodeScanner Class

Next topic

RecordProfile Enum

Recorder Class

Description

Recorder is a video recorder for the rendering context.

The current Recorder only works in OpenGL ES 2.0 contexts on Android (4.3 and later) and iOS.

Constructor

C: void easyar_Recorder__ctor(easyar_Recorder** Return)
C++11: Recorder()
Traditional C++: Recorder()
Java: public Recorder()
Objective-C: + (easyar_Recorder *) create
Swift (since EasyAR SDK 2.1.0): public convenience init()

setOutputFile

Set absolute path for output video file. It must be set before start.

C: void easyar_Recorder_setOutputFile(easyar_Recorder* This, easyar_String* path)
C++11: void setOutputFile(std::string path)
Traditional C++: void setOutputFile(String* path)
Java: public native void setOutputFile(java.lang.String path)
Objective-C: - (void)setOutputFile:(NSString *)path
Swift (since EasyAR SDK 2.1.0): public func setOutputFile(_ path: String) -> Void

setInputTexture

Set texture to be recorded. It must be set before start.

texPtr should be set to the texture id in OpenGL, usually you can do this by cast it to void* using reinterpret_cast in C++.

Texture can be changed during recording.

C: void easyar_Recorder_setInputTexture(easyar_Recorder* This, void* texPtr, int width, int height)
C++11: void setInputTexture(void * texPtr, int width, int height)
Traditional C++: void setInputTexture(void* texPtr, int width, int height)
Java: public native void setInputTexture(long texPtr, int width, int height)
Objective-C: - (void)setInputTexture:(void *)texPtr width:(int)width height:(int)height
Swift (since EasyAR SDK 2.1.0): public func setInputTexture(_ texPtr: OpaquePointer, _ width: Int32, _ height: Int32) -> Void

requestPermissions

Request platform permission for recording. You can choose to call this or request permissions by yourself.

C: void easyar_Recorder_requestPermissions(easyar_Recorder* This, easyar_FunctorOfVoidFromPermissionStatusAndString permissionCallback)
C++11: void requestPermissions(std::function<void(PermissionStatus, std::string)> permissionCallback)
Traditional C++: void requestPermissions(FunctorOfVoidFromPermissionStatusAndString permissionCallback)
Java: public native void requestPermissions(FunctorOfVoidFromPermissionStatusAndString permissionCallback)
Objective-C: - (void)requestPermissions:(void (^)(easyar_PermissionStatus status, NSString * value))permissionCallback
Swift (since EasyAR SDK 2.1.0): public func requestPermissions(_ permissionCallback: @escaping (PermissionStatus, String) -> Void) -> Void

open

Initialize recorder functions.

C: bool easyar_Recorder_open(easyar_Recorder* This, easyar_FunctorOfVoidFromRecordStatusAndString statusCallback)
C++11: bool open(std::function<void(RecordStatus, std::string)> statusCallback)
Traditional C++: bool open(FunctorOfVoidFromRecordStatusAndString statusCallback)
Java: public native boolean open(FunctorOfVoidFromRecordStatusAndString statusCallback)
Objective-C: - (bool)open:(void (^)(easyar_RecordStatus status, NSString * value))statusCallback
Swift (since EasyAR SDK 2.1.0): public func `open`(_ statusCallback: @escaping (RecordStatus, String) -> Void) -> Bool

start

Start recording. This should be called in the renderer thread.

C: void easyar_Recorder_start(easyar_Recorder* This)
C++11: void start()
Traditional C++: void start()
Java: public native void start()
Objective-C: - (void)start
Swift (since EasyAR SDK 2.1.0): public func start() -> Void

updateFrame

Update and record a frame using texture data. This should be called in the renderer thread.

C: void easyar_Recorder_updateFrame(easyar_Recorder* This)
C++11: void updateFrame()
Traditional C++: void updateFrame()
Java: public native void updateFrame()
Objective-C: - (void)updateFrame
Swift (since EasyAR SDK 2.1.0): public func updateFrame() -> Void

stop

Stop recording. After calling stop, the recording will not stop immediately, make sure to check callbacks to get recording stop event.

C: void easyar_Recorder_stop(easyar_Recorder* This)
C++11: void stop()
Traditional C++: void stop()
Java: public native void stop()
Objective-C: - (void)stop
Swift (since EasyAR SDK 2.1.0): public func stop() -> Void

close

Close the recorder. After calling close, all resources will be released. So if you call close before the recording really ends, it may block until the recording finish.

C: void easyar_Recorder_close(easyar_Recorder* This)
C++11: void close()
Traditional C++: void close()
Java: public native void close()
Objective-C: - (void)close
Swift (since EasyAR SDK 2.1.0): public func close() -> Void

setProfile

Set recording profile. Default value is Quality_720P_Middle. It will take effect only if called before start.

This is an all-in-one configration, you can control in more advanced mode with other APIs.

C: bool easyar_Recorder_setProfile(easyar_Recorder* This, easyar_RecordProfile profile)
C++11: bool setProfile(RecordProfile profile)
Traditional C++: bool setProfile(RecordProfile profile)
Java: public native boolean setProfile(/* RecordProfile */ int profile)
Objective-C: - (bool)setProfile:(easyar_RecordProfile)profile
Swift (since EasyAR SDK 2.1.0): public func setProfile(_ profile: RecordProfile) -> Bool

setVideoSize

Set recording video size. Default value is Vid720p. It will take effect only if called before start.

C: void easyar_Recorder_setVideoSize(easyar_Recorder* This, easyar_RecordVideoSize framesize)
C++11: void setVideoSize(RecordVideoSize framesize)
Traditional C++: void setVideoSize(RecordVideoSize framesize)
Java: public native void setVideoSize(/* RecordVideoSize */ int framesize)
Objective-C: - (void)setVideoSize:(easyar_RecordVideoSize)framesize
Swift (since EasyAR SDK 2.1.0): public func setVideoSize(_ framesize: RecordVideoSize) -> Void

setVideoBitrate

Set recording video bitrate. Default value is 2500000. It will take effect only if called before start.

C: void easyar_Recorder_setVideoBitrate(easyar_Recorder* This, int bitrate)
C++11: void setVideoBitrate(int bitrate)
Traditional C++: void setVideoBitrate(int bitrate)
Java: public native void setVideoBitrate(int bitrate)
Objective-C: - (void)setVideoBitrate:(int)bitrate
Swift (since EasyAR SDK 2.1.0): public func setVideoBitrate(_ bitrate: Int32) -> Void

setChannelCount

Set recording audio channel count. Default value is 1. It will take effect only if called before start.

C: void easyar_Recorder_setChannelCount(easyar_Recorder* This, int count)
C++11: void setChannelCount(int count)
Traditional C++: void setChannelCount(int count)
Java: public native void setChannelCount(int count)
Objective-C: - (void)setChannelCount:(int)count
Swift (since EasyAR SDK 2.1.0): public func setChannelCount(_ count: Int32) -> Void

setAudioSampleRate

Set recording audio sample rate. Default value is 44100. It will take effect only if called before start.

C: void easyar_Recorder_setAudioSampleRate(easyar_Recorder* This, int samplerate)
C++11: void setAudioSampleRate(int samplerate)
Traditional C++: void setAudioSampleRate(int samplerate)
Java: public native void setAudioSampleRate(int samplerate)
Objective-C: - (void)setAudioSampleRate:(int)samplerate
Swift (since EasyAR SDK 2.1.0): public func setAudioSampleRate(_ samplerate: Int32) -> Void

setAudioBitrate

Set recording audio bitrate. Default value is 96000. It will take effect only if called before start.

C: void easyar_Recorder_setAudioBitrate(easyar_Recorder* This, int bitrate)
C++11: void setAudioBitrate(int bitrate)
Traditional C++: void setAudioBitrate(int bitrate)
Java: public native void setAudioBitrate(int bitrate)
Objective-C: - (void)setAudioBitrate:(int)bitrate
Swift (since EasyAR SDK 2.1.0): public func setAudioBitrate(_ bitrate: Int32) -> Void

setVideoOrientation

Set recording video orientation. Default value is Landscape. It will take effect only if called before start.

C: void easyar_Recorder_setVideoOrientation(easyar_Recorder* This, easyar_RecordVideoOrientation mode)
C++11: void setVideoOrientation(RecordVideoOrientation mode)
Traditional C++: void setVideoOrientation(RecordVideoOrientation mode)
Java: public native void setVideoOrientation(/* RecordVideoOrientation */ int mode)
Objective-C: - (void)setVideoOrientation:(easyar_RecordVideoOrientation)mode
Swift (since EasyAR SDK 2.1.0): public func setVideoOrientation(_ mode: RecordVideoOrientation) -> Void

setZoomMode

Set recording zoom mode. Default value is NoZoomAndClip. It will take effect only if called before start.

C: void easyar_Recorder_setZoomMode(easyar_Recorder* This, easyar_RecordZoomMode mode)
C++11: void setZoomMode(RecordZoomMode mode)
Traditional C++: void setZoomMode(RecordZoomMode mode)
Java: public native void setZoomMode(/* RecordZoomMode */ int mode)
Objective-C: - (void)setZoomMode:(easyar_RecordZoomMode)mode
Swift (since EasyAR SDK 2.1.0): public func setZoomMode(_ mode: RecordZoomMode) -> Void