vitasdk
Documentation of the vitasdk
avplayer.h
Go to the documentation of this file.
1 
6 #ifndef _PSP2_AVPLAYER_H_
7 #define _PSP2_AVPLAYER_H_
8 
9 #include <vitasdk/build_utils.h>
10 #include <psp2/types.h>
11 #include <stdint.h>
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 typedef int SceAvPlayerHandle;
19 
20 typedef enum SceAvPlayerErrorCode {
24 
25 typedef enum SceAvPlayerTrickSpeeds {
36 
37 typedef enum SceAvPlayerStreamType {
42 
43 typedef void* (*SceAvPlayerAlloc)(void *arg, uint32_t alignment, uint32_t size);
44 typedef void (*SceAvPlayerFree)(void *arg, void *ptr);
45 typedef void* (*SceAvPlayerAllocFrame)(void *arg, uint32_t alignment, uint32_t size);
46 typedef void (*SceAvPlayerFreeFrame)(void *arg, void *ptr);
47 
48 typedef int (*SceAvPlayerOpenFile)(void *p, const char *filename);
49 typedef int (*SceAvPlayerCloseFile)(void *p);
50 typedef int (*SceAvPlayerReadOffsetFile)(void *p, uint8_t *buffer, uint64_t position, uint32_t length);
51 typedef uint64_t (*SceAvPlayerSizeFile)(void *p);
52 
53 typedef void (*SceAvPlayerEventCallback)(void *p, int32_t argEventId, int32_t argSourceId, void *argEventData);
54 
55 typedef struct SceAvPlayerMemReplacement {
63 
72 
78 
79 typedef struct SceAvPlayerInitData {
83  int32_t debugLevel;
84  uint32_t basePriority;
87  uint8_t reserved[3];
88  const char *defaultLanguage;
91 
92 typedef struct SceAvPlayerAudio {
93  uint16_t channelCount;
94  uint8_t reserved[2];
95  uint32_t sampleRate;
96  uint32_t size;
97  uint32_t languageCode;
100 
101 typedef struct SceAvPlayerVideo {
102  uint32_t width;
103  uint32_t height;
104  float aspectRatio;
105  uint32_t languageCode;
108 
109 typedef struct SceAvPlayerTextPosition{
110  uint16_t top;
111  uint16_t left;
112  uint16_t bottom;
113  uint16_t right;
116 
117 typedef struct SceAvPlayerTimedText {
118  uint32_t languageCode;
119  uint16_t textSize;
120  uint16_t fontSize;
124 
126  uint32_t reserved[4];
132 
133 typedef struct SceAvPlayerFrameInfo {
134  uint8_t *pData;
135  uint32_t reserved;
136  uint64_t timeStamp;
140 
141 typedef struct SceAvPlayerStreamInfo {
142  uint32_t type;
143  uint32_t reserved;
145  uint64_t duration;
146  uint64_t startTime;
149 
156 
163 
170 
177 
184 
192 
199 
206 int sceAvPlayerAddSource(SceAvPlayerHandle handle, const char *filename);
207 
214 
222 
230 
237 
244 int sceAvPlayerJumpToTime(SceAvPlayerHandle handle, uint64_t offset);
245 
253 
262 
263 #ifdef __cplusplus
264 }
265 #endif
266 
267 #endif /* _PSP2_AVPLAYER_H_ */
uint8_t reserved[3]
Reserved data.
Definition: avplayer.h:87
SceAvPlayerTimedText subs
Subtitles details.
Definition: avplayer.h:129
int(* SceAvPlayerOpenFile)(void *p, const char *filename)
Definition: avplayer.h:48
const char * defaultLanguage
Definition: avplayer.h:88
void * objectPointer
Definition: avplayer.h:74
SceAvPlayerOpenFile open
File open.
Definition: avplayer.h:66
uint32_t reserved[4]
Reserved data.
Definition: avplayer.h:126
uint16_t left
Definition: avplayer.h:111
SceAvPlayerAlloc allocate
Memory allocator for generic data.
Definition: avplayer.h:57
uint8_t reserved[2]
Reserved data.
Definition: avplayer.h:94
SceAvPlayerAllocFrame allocateTexture
Memory allocator for video frames.
Definition: avplayer.h:59
SceAvPlayerSizeFile size
File size.
Definition: avplayer.h:69
void * objectPointer
Definition: avplayer.h:56
int(* SceAvPlayerReadOffsetFile)(void *p, uint8_t *buffer, uint64_t position, uint32_t length)
Definition: avplayer.h:50
uint32_t reserved
Reserved data
Definition: avplayer.h:143
uint64_t(* SceAvPlayerSizeFile)(void *p)
Definition: avplayer.h:51
SceAvPlayerStreamType
Definition: avplayer.h:37
uint16_t textSize
The size of the subtitles.
Definition: avplayer.h:119
int sceAvPlayerClose(SceAvPlayerHandle handle)
SceAvPlayerFree deallocate
Memory deallocator for generic data.
Definition: avplayer.h:58
SceBool sceAvPlayerGetVideoData(SceAvPlayerHandle handle, SceAvPlayerFrameInfo *info)
uint32_t size
The size of the audio frame in bytes.
Definition: avplayer.h:96
uint8_t * pData
Pointer to the frame data.
Definition: avplayer.h:134
void *(* SceAvPlayerAllocFrame)(void *arg, uint32_t alignment, uint32_t size)
Definition: avplayer.h:45
int32_t debugLevel
Definition: avplayer.h:83
int sceAvPlayerPause(SceAvPlayerHandle handle)
uint64_t sceAvPlayerCurrentTime(SceAvPlayerHandle handle)
SceBool autoStart
Flag indicating whether the video player should start playback automatically.
Definition: avplayer.h:86
uint32_t languageCode
The language code of the subtitles.
Definition: avplayer.h:118
uint64_t timeStamp
Timestamp of the frame in milliseconds.
Definition: avplayer.h:136
SceAvPlayerTextPosition position
The position of the subtitles.
Definition: avplayer.h:121
SceBool sceAvPlayerGetAudioData(SceAvPlayerHandle handle, SceAvPlayerFrameInfo *info)
SceAvPlayerFreeFrame deallocateTexture
Memory deallocator for video frames.
Definition: avplayer.h:60
VITASDK_BUILD_ASSERT_EQ(4, SceAvPlayerHandle)
int sceAvPlayerStop(SceAvPlayerHandle handle)
void(* SceAvPlayerFree)(void *arg, void *ptr)
Definition: avplayer.h:44
int sceAvPlayerResume(SceAvPlayerHandle handle)
uint16_t channelCount
The number of audio channels of the audio frame.
Definition: avplayer.h:93
void(* SceAvPlayerEventCallback)(void *p, int32_t argEventId, int32_t argSourceId, void *argEventData)
Definition: avplayer.h:53
uint32_t sampleRate
The samplerate of the audio frame in Hz.
Definition: avplayer.h:95
float aspectRatio
The aspect ratio of the video frame.
Definition: avplayer.h:104
SceAvPlayerCloseFile close
File close.
Definition: avplayer.h:67
int sceAvPlayerJumpToTime(SceAvPlayerHandle handle, uint64_t offset)
SceAvPlayerReadOffsetFile readOffset
File read from offset.
Definition: avplayer.h:68
int sceAvPlayerAddSource(SceAvPlayerHandle handle, const char *filename)
SceAvPlayerMemReplacement memoryReplacement
Memory allocator replacement.
Definition: avplayer.h:80
SceAvPlayerTrickSpeeds
Definition: avplayer.h:25
void * objectPointer
Definition: avplayer.h:65
int(* SceAvPlayerCloseFile)(void *p)
Definition: avplayer.h:49
uint32_t languageCode
The language code of the audio frame.
Definition: avplayer.h:97
void(* SceAvPlayerFreeFrame)(void *arg, void *ptr)
Definition: avplayer.h:46
SceAvPlayerVideo video
Video details.
Definition: avplayer.h:128
SceAvPlayerErrorCode
Definition: avplayer.h:20
int32_t numOutputVideoFrameBuffers
Definition: avplayer.h:85
uint16_t top
Definition: avplayer.h:110
uint32_t height
The height of the video frame in pixels.
Definition: avplayer.h:103
uint32_t basePriority
Base priority of the thread running the video player.
Definition: avplayer.h:84
SceAvPlayerEventCallback eventCallback
Definition: avplayer.h:75
int SceAvPlayerHandle
Definition: avplayer.h:17
int sceAvPlayerSetTrickSpeed(SceAvPlayerHandle handle, int speed)
SceAvPlayerAudio audio
Audio details.
Definition: avplayer.h:127
SceAvPlayerStreamDetails details
The frame details.
Definition: avplayer.h:137
uint64_t duration
Total duration of the stream in milliseconds.
Definition: avplayer.h:145
SceAvPlayerStreamDetails details
The stream details.
Definition: avplayer.h:144
uint16_t fontSize
The size of the subtitles.
Definition: avplayer.h:120
SceBool sceAvPlayerIsActive(SceAvPlayerHandle handle)
int sceAvPlayerGetStreamInfo(SceAvPlayerHandle handle, uint32_t id, SceAvPlayerStreamInfo *info)
int sceAvPlayerSetLooping(SceAvPlayerHandle handle, SceBool looping)
uint16_t bottom
Definition: avplayer.h:112
int sceAvPlayerStart(SceAvPlayerHandle handle)
SceAvPlayerHandle sceAvPlayerInit(SceAvPlayerInitData *data)
void *(* SceAvPlayerAlloc)(void *arg, uint32_t alignment, uint32_t size)
Definition: avplayer.h:43
SceAvPlayerFileReplacement fileReplacement
File I/O replacement.
Definition: avplayer.h:81
SceAvPlayerEventReplacement eventReplacement
Event callback replacement.
Definition: avplayer.h:82
uint32_t languageCode
The language code of the video frame.
Definition: avplayer.h:105
uint32_t type
Type of the stream (One of SceAvPlayerStreamType)
Definition: avplayer.h:142
uint64_t startTime
Starting time of the stream in milliseconds.
Definition: avplayer.h:146
uint16_t right
Definition: avplayer.h:113
uint32_t width
The width of the video frame in pixels.
Definition: avplayer.h:102
uint32_t reserved
Reserved data.
Definition: avplayer.h:135
@ SCE_AVPLAYER_TIMEDTEXT
Timed text (subtitles) stream type.
Definition: avplayer.h:40
@ SCE_AVPLAYER_AUDIO
Audio stream type.
Definition: avplayer.h:39
@ SCE_AVPLAYER_VIDEO
Video stream type.
Definition: avplayer.h:38
@ SCE_AVPLAYER_TRICK_SPEED_FAST_FORWARD_16X
Fast Forward 16x.
Definition: avplayer.h:33
@ SCE_AVPLAYER_TRICK_SPEED_REWIND_32X
Rewind 32x.
Definition: avplayer.h:26
@ SCE_AVPLAYER_TRICK_SPEED_NORMAL
Normal Speed.
Definition: avplayer.h:29
@ SCE_AVPLAYER_TRICK_SPEED_FAST_FORWARD_32X
Fast Forward 32x.
Definition: avplayer.h:34
@ SCE_AVPLAYER_TRICK_SPEED_FAST_FORWARD_4X
Fast Forward 4x.
Definition: avplayer.h:31
@ SCE_AVPLAYER_TRICK_SPEED_FAST_FORWARD_8X
Fast Forward 8x.
Definition: avplayer.h:32
@ SCE_AVPLAYER_TRICK_SPEED_REWIND_8X
Rewind 8x.
Definition: avplayer.h:28
@ SCE_AVPLAYER_TRICK_SPEED_REWIND_16X
Rewind 16x.
Definition: avplayer.h:27
@ SCE_AVPLAYER_TRICK_SPEED_FAST_FORWARD_2X
Fast Forward 2x.
Definition: avplayer.h:30
@ SCE_AVPLAYER_ERROR_INVALID_PARAM
Definition: avplayer.h:21
@ SCE_AVPLAYER_ERROR_OUT_OF_MEMORY
Definition: avplayer.h:22
Definition: avplayer.h:92
Definition: avplayer.h:73
Definition: avplayer.h:64
Definition: avplayer.h:133
Definition: avplayer.h:79
Definition: avplayer.h:55
Definition: avplayer.h:141
Definition: avplayer.h:109
Definition: avplayer.h:117
Definition: avplayer.h:101
Definition: avplayer.h:125
void * buffer
Definition: bt.h:6
uint32_t length
Definition: bt.h:7
SceSize size
struct size(variable size)
Definition: debug.h:0
int SceBool
Definition: types.h:59