vitasdk
Documentation of the vitasdk

Exports for User. More...

Data Structures

struct  SceMp4RecRecorder
 
struct  SceMp4RecInitParam
 
struct  SceMp4RecFrame
 
struct  SceMp4RecTermParam
 

Macros

#define SCE_MP4REC_COMMON_DENOM_TIMESCALE   240000
 Common denominator timescale between audio and video.
 
#define SCE_MP4REC_VIDEO_TIMESCALE   30000
 Video timescale in hz.
 
#define SCE_MP4REC_AUDIO_TIMESCALE   48000
 Audio timescale in hz.
 
#define SCE_MP4REC_VIDEO_SAMPLE_DURATION   1001
 Duration of a single video sample in ms.
 
#define SCE_MP4REC_AUDIO_SAMPLE_DURATION   1024
 Duration of a single audio sample in ms.
 
#define SCE_MP4REC_AUDIO_BUFFER_SIZE   4096
 Size in bytes of the audio buffer used during recording.
 

Enumerations

enum  SceMp4RecPixelFormat { SCE_MP4REC_PIXELFORMAT_A8B8G8R8 = 0x00000000 , SCE_MP4REC_PIXELFORMAT_YUV420_PACKED = 0x00000020 }
 
enum  SceMp4RecMode {
  SCE_MP4REC_MODE_640_368_2MBPS , SCE_MP4REC_MODE_640_368_1MBPS , SCE_MP4REC_MODE_480_272_2MBPS , SCE_MP4REC_MODE_480_272_1MBPS ,
  SCE_MP4REC_MODE_368_208_2MBPS , SCE_MP4REC_MODE_368_208_1MBPS
}
 

Functions

int sceMp4RecCreateRecorder (SceMp4RecRecorder *rec)
 Create a new MP4 video recorder.
 
int sceMp4RecDeleteRecorder (SceMp4RecRecorder *rec)
 Delete an existing MP4 video recorder.
 
int sceMp4RecQueryPhysicalMemSize (SceMp4RecRecorder *rec, int mode, uint32_t *encoder_size, uint32_t *av_size)
 Queries the required memory size for video and audio encoding.
 
int sceMp4RecInit (SceMp4RecRecorder *rec, SceMp4RecInitParam *params)
 Init a new video recording session.
 
int sceMp4RecTerm (SceMp4RecRecorder *rec, SceMp4RecTermParam *params)
 Terminate an ongoing recording session.
 
int sceMp4RecCsc (SceMp4RecFrame *dst, SceMp4RecFrame *src)
 Perform hardware accelerated rescaling and colorspace conversion.
 
int sceMp4RecAddVideoSample (SceMp4RecRecorder *rec, void *buffer, int size)
 Add a new video sample to the ongoing recording recording session.
 
int sceMp4RecAddAudioSample (SceMp4RecRecorder *rec, void *buffer, int size)
 Add a new audio sample to the ongoing recording recording session.
 

Variables

SceSize SceMp4RecRecorder::size
 sizeof(SceMp4RecRecorder)
 
void * SceMp4RecRecorder::base
 Pointer to the base address of the recorder memblock.
 
uint32_t SceMp4RecRecorder::base_size
 Size of the recorder memblock in bytes.
 
int SceMp4RecRecorder::unk
 Unknown area.
 
SceSize SceMp4RecInitParam::size
 sizeof(SceMp4RecInitParam)
 
uint32_t SceMp4RecInitParam::mode
 One of SceMp4RecMode.
 
void * SceMp4RecInitParam::encoder_mem
 Pointer to base address of a physically contiguous memory block to use for video encoding.
 
uint32_t SceMp4RecInitParam::encoder_size
 Size of the memory block used for video encoding in bytes.
 
void * SceMp4RecInitParam::av_mem
 Pointer to base address of a physically contiguous memory block to use for audio encoding.
 
uint32_t SceMp4RecInitParam::av_size
 Size of the memory block used for audio encoding in bytes.
 
int SceMp4RecInitParam::affinity
 CPU affinity mask for the recorder thread.
 
int SceMp4RecInitParam::priority
 Priority for the recoreder thread.
 
SceSize SceMp4RecFrame::size
 sizeof(SceMp4RecFrame)
 
int SceMp4RecFrame::pixelformat
 Pixelformat (One of SceMp4RecPixelFormat)
 
int SceMp4RecFrame::stride
 Frame stride in pixels.
 
int SceMp4RecFrame::width
 Frame width in pixels.
 
int SceMp4RecFrame::height
 Frame height in pixels.
 
char SceMp4RecFrame::unk [16]
 Unknown area.
 
void * SceMp4RecFrame::buffer
 Pointer to the frame buffer.
 
uint32_t SceMp4RecFrame::reserved
 Reserved area.
 
SceSize SceMp4RecTermParam::size
 sizeof(SceMp4RecTermParam)
 
SceBool SceMp4RecTermParam::discard
 Wether to save or discard the final video file.
 
uint32_t SceMp4RecTermParam::reserved [128]
 Reserved area.
 
void * SceMp4RecTermParam::metadata
 Metadata of the final video file.
 

Detailed Description

Exports for User.


Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceLibMp4Recorder_stub


Load the required module:

int sceSysmoduleLoadModule(SceSysmoduleModuleId id)
Load a module.
@ SCE_SYSMODULE_MP4_RECORDER
MP4 Recorder module.
Definition sysmodule.h:108




Data Structure Documentation

◆ SceMp4RecRecorder

struct SceMp4RecRecorder
Data Fields
SceSize size sizeof(SceMp4RecRecorder)
void * base Pointer to the base address of the recorder memblock.
uint32_t base_size Size of the recorder memblock in bytes.
int unk Unknown area.

◆ SceMp4RecInitParam

struct SceMp4RecInitParam
Data Fields
SceSize size sizeof(SceMp4RecInitParam)
uint32_t mode One of SceMp4RecMode.
void * encoder_mem Pointer to base address of a physically contiguous memory block to use for video encoding.
uint32_t encoder_size Size of the memory block used for video encoding in bytes.
void * av_mem Pointer to base address of a physically contiguous memory block to use for audio encoding.
uint32_t av_size Size of the memory block used for audio encoding in bytes.
int affinity CPU affinity mask for the recorder thread.
int priority Priority for the recoreder thread.

◆ SceMp4RecFrame

struct SceMp4RecFrame
Data Fields
SceSize size sizeof(SceMp4RecFrame)
int pixelformat Pixelformat (One of SceMp4RecPixelFormat)
int stride Frame stride in pixels.
int width Frame width in pixels.
int height Frame height in pixels.
char unk[16] Unknown area.
void * buffer Pointer to the frame buffer.
uint32_t reserved Reserved area.

◆ SceMp4RecTermParam

struct SceMp4RecTermParam
Data Fields
SceSize size sizeof(SceMp4RecTermParam)
SceBool discard Wether to save or discard the final video file.
uint32_t reserved[128] Reserved area.
void * metadata Metadata of the final video file.

Macro Definition Documentation

◆ SCE_MP4REC_COMMON_DENOM_TIMESCALE

#define SCE_MP4REC_COMMON_DENOM_TIMESCALE   240000

Common denominator timescale between audio and video.

◆ SCE_MP4REC_VIDEO_TIMESCALE

#define SCE_MP4REC_VIDEO_TIMESCALE   30000

Video timescale in hz.

◆ SCE_MP4REC_AUDIO_TIMESCALE

#define SCE_MP4REC_AUDIO_TIMESCALE   48000

Audio timescale in hz.

◆ SCE_MP4REC_VIDEO_SAMPLE_DURATION

#define SCE_MP4REC_VIDEO_SAMPLE_DURATION   1001

Duration of a single video sample in ms.

◆ SCE_MP4REC_AUDIO_SAMPLE_DURATION

#define SCE_MP4REC_AUDIO_SAMPLE_DURATION   1024

Duration of a single audio sample in ms.

◆ SCE_MP4REC_AUDIO_BUFFER_SIZE

#define SCE_MP4REC_AUDIO_BUFFER_SIZE   4096

Size in bytes of the audio buffer used during recording.

Enumeration Type Documentation

◆ SceMp4RecPixelFormat

Enumerator
SCE_MP4REC_PIXELFORMAT_A8B8G8R8 

32-bit ABGR format

SCE_MP4REC_PIXELFORMAT_YUV420_PACKED 

Packed YUV420 format.

◆ SceMp4RecMode

Enumerator
SCE_MP4REC_MODE_640_368_2MBPS 

640x368 with 2mbps bitrate

SCE_MP4REC_MODE_640_368_1MBPS 

640x368 with 1mbps bitrate

SCE_MP4REC_MODE_480_272_2MBPS 

480x272 with 2mbps bitrate

SCE_MP4REC_MODE_480_272_1MBPS 

480x272 with 1mbps bitrate

SCE_MP4REC_MODE_368_208_2MBPS 

368x208 with 2mbps bitrate

SCE_MP4REC_MODE_368_208_1MBPS 

368x208 with 1mbps bitrate

Function Documentation

◆ sceMp4RecCreateRecorder()

int sceMp4RecCreateRecorder ( SceMp4RecRecorder rec)

Create a new MP4 video recorder.

Parameters
[in]rec- Struct describing memory layout for the new recorder.
Returns
0 on success, < 0 on error.

◆ sceMp4RecDeleteRecorder()

int sceMp4RecDeleteRecorder ( SceMp4RecRecorder rec)

Delete an existing MP4 video recorder.

Parameters
[in]rec- Struct describing memory layout for the recorder to delete.
Returns
0 on success, < 0 on error.

◆ sceMp4RecQueryPhysicalMemSize()

int sceMp4RecQueryPhysicalMemSize ( SceMp4RecRecorder rec,
int  mode,
uint32_t *  encoder_size,
uint32_t *  av_size 
)

Queries the required memory size for video and audio encoding.

Parameters
[in]rec- Struct describing memory layout for the recorder to use.
[in]mode- The recorder mode to use (One of SceMp4RecMode).
[out]encoder_size- The required size in bytes for the video encoding memory block.
[out]av_size- The required size in bytes for the audio encoding memory block.
Returns
0 on success, < 0 on error.

◆ sceMp4RecInit()

int sceMp4RecInit ( SceMp4RecRecorder rec,
SceMp4RecInitParam params 
)

Init a new video recording session.

Parameters
[in]rec- Struct describing memory layout for the recorder to use.
[in]params- Struct describing the recording session parameters to use.
Returns
0 on success, < 0 on error.

◆ sceMp4RecTerm()

int sceMp4RecTerm ( SceMp4RecRecorder rec,
SceMp4RecTermParam params 
)

Terminate an ongoing recording session.

Parameters
[in]rec- Struct describing memory layout for the recorder to use.
[in]params- Struct describing the recording session parameters to use for the final video file.
Returns
0 on success, < 0 on error.
Note
- If the video is not discarded, it will be auomatically saved in ux0:video.

◆ sceMp4RecCsc()

int sceMp4RecCsc ( SceMp4RecFrame dst,
SceMp4RecFrame src 
)

Perform hardware accelerated rescaling and colorspace conversion.

Parameters
[in]dst- Struct describing the desired frame output setup.
[in]src- Struct describing the frame input setup.
Returns
0 on success, < 0 on error.

◆ sceMp4RecAddVideoSample()

int sceMp4RecAddVideoSample ( SceMp4RecRecorder rec,
void *  buffer,
int  size 
)

Add a new video sample to the ongoing recording recording session.

Parameters
[in]rec- Struct describing memory layout for the recorder to use.
[in]buffer- Buffer pointing to the frame buffer to add to the recording.
[in]size- Size in bytes of the passed frame buffer.
Returns
0 on success, < 0 on error.

◆ sceMp4RecAddAudioSample()

int sceMp4RecAddAudioSample ( SceMp4RecRecorder rec,
void *  buffer,
int  size 
)

Add a new audio sample to the ongoing recording recording session.

Parameters
[in]rec- Struct describing memory layout for the recorder to use.
[in]buffer- Buffer pointing to the audio buffer to add to the recording.
[in]size- Size in bytes of the passed audio buffer (Must be SCE_MP4REC_AUDIO_BUFFER_SIZE)
Returns
0 on success, < 0 on error.

Variable Documentation

◆ size [1/4]

SceSize SceMp4RecRecorder::size

sizeof(SceMp4RecRecorder)

◆ base

void* SceMp4RecRecorder::base

Pointer to the base address of the recorder memblock.

◆ base_size

uint32_t SceMp4RecRecorder::base_size

Size of the recorder memblock in bytes.

◆ unk [1/2]

int SceMp4RecRecorder::unk

Unknown area.

◆ size [2/4]

SceSize SceMp4RecInitParam::size

sizeof(SceMp4RecInitParam)

◆ mode

uint32_t SceMp4RecInitParam::mode

One of SceMp4RecMode.

◆ encoder_mem

void* SceMp4RecInitParam::encoder_mem

Pointer to base address of a physically contiguous memory block to use for video encoding.

◆ encoder_size

uint32_t SceMp4RecInitParam::encoder_size

Size of the memory block used for video encoding in bytes.

◆ av_mem

void* SceMp4RecInitParam::av_mem

Pointer to base address of a physically contiguous memory block to use for audio encoding.

◆ av_size

uint32_t SceMp4RecInitParam::av_size

Size of the memory block used for audio encoding in bytes.

◆ affinity

int SceMp4RecInitParam::affinity

CPU affinity mask for the recorder thread.

◆ priority

int SceMp4RecInitParam::priority

Priority for the recoreder thread.

◆ size [3/4]

SceSize SceMp4RecFrame::size

sizeof(SceMp4RecFrame)

◆ pixelformat

int SceMp4RecFrame::pixelformat

Pixelformat (One of SceMp4RecPixelFormat)

◆ stride

int SceMp4RecFrame::stride

Frame stride in pixels.

◆ width

int SceMp4RecFrame::width

Frame width in pixels.

◆ height

int SceMp4RecFrame::height

Frame height in pixels.

◆ unk [2/2]

char SceMp4RecFrame::unk[16]

Unknown area.

◆ buffer

void* SceMp4RecFrame::buffer

Pointer to the frame buffer.

◆ reserved [1/2]

uint32_t SceMp4RecFrame::reserved

Reserved area.

◆ size [4/4]

SceSize SceMp4RecTermParam::size

sizeof(SceMp4RecTermParam)

◆ discard

SceBool SceMp4RecTermParam::discard

Wether to save or discard the final video file.

◆ reserved [2/2]

uint32_t SceMp4RecTermParam::reserved[128]

Reserved area.

◆ metadata

void* SceMp4RecTermParam::metadata

Metadata of the final video file.