webOS Userland
Native system APIs for webOS
 
Loading...
Searching...
No Matches
StarfishMediaAPIs.h
1#pragma once
2
3#include <string>
4#include <cstdint>
5
6#include <boost/shared_ptr.hpp>
7
8namespace mediapipeline {
9 class Player;
10}
11
12namespace smp {
13 class ProgramInfo;
14 class SourceInfo;
15 class VideoTrack;
16
17 namespace util {
18 bool isPlatformFhd(const std::string& platform);
19 bool isPlatformMStar(const std::string& platform);
20 bool isPlatformSIC(const std::string& platform);
21 bool isPlatformRealtek(const std::string& platform);
22 bool isPlatformSupportSoftwareAudioDecoder(std::string platform);
23
24 bool isSupportedAudio(std::string audio, int32_t version, int32_t channel);
25 bool isSupportedVideo(std::string video, int32_t width, int32_t height, int32_t frameRate, int64_t bitRate);
26 bool isSupportedVideo(std::string video, int32_t width, int32_t height, int32_t frameRate, int64_t bitRate, std::string decodeType);
27
28 bool getMaxVideoResolution(std::string video, int32_t* width, int32_t* height, int32_t* frameRate);
29 bool getMaxVideoResolution(std::string video, int32_t* width, int32_t* height, int32_t* frameRate, std::string decodeType);
30 }
31}
32
34{
35public:
36 StarfishMediaAPIs(const char *uid = nullptr);
38
39 bool Exit();
40 std::string Feed(const char *payload);
41 bool flush();
42 bool flush(const char *payload);
43 int64_t getCurrentPlaytime();
44 bool getVideoRenderQueueLength(int &length);
45 bool getAudioBufferSize(int &total, int &used);
46 const char *getMediaID();
47 const char *getVolume();
48 bool Load(const char *payload, void(callback)(int type, int64_t numValue, const char *strValue));
49 bool Load(const char *payload, void(callback)(int type, int64_t numValue, const char *strValue, void *data), void *data);
50 bool notifyBackground();
51 bool notifyForeground();
52 bool Pause();
53 bool Play();
54 bool pushEOS();
55 void setCurrentPlaytime(int64_t playtime);
56 bool Seek(const char *millis);
57 bool setAudioMute(const char *message);
58 void setDrmOperation(const char* message);
59 bool setHdrInfo(const char* message);
60 bool SetPlayRate(const char* message);
61 bool SetProperty(const char* message);
62 bool setTimeToDecode(const char *);
63 bool setVolume(const char *);
64 bool setWindowId(const char* message);
65 bool Stop();
66 bool takeSnapshot(const char *message);
67 bool Unload();
68 bool changeAudioCodec(const std::string& acodec, const std::string& optInfo);
69#ifdef __G_MAIN_H__
70 void setExternalContext(GMainContext *);
71 void unsetExternalContext();
72#endif
73private:
74 char unknown[76];
75public:
76 boost::shared_ptr<mediapipeline::Player> player;
77private:
78 // Must include big enough storage size. On some system it has 300 bytes, 4KB here should be fairly enough
79 char padding[4096];
80};
81
82enum PF_EVENT_T
83{
84 PF_EVENT_TYPE_FRAMEREADY = 0x0,
85 PF_EVENT_TYPE_STR_STREAMING_INFO_PERI = 0x1,
86 PF_EVENT_TYPE_INT_BUFFER_RANGE_INFO = 0x2,
87 PF_EVENT_TYPE_INT_DURATION = 0x3,
88 PF_EVENT_TYPE_STR_VIDEO_INFO = 0x4,
89 PF_EVENT_TYPE_STR_VIDEO_TRACK_INFO = 0x5,
90 PF_EVENT_TYPE_STR_AUDIO_INFO = 0x7,
91 PF_EVENT_TYPE_STR_AUDIO_TRACK_INFO = 0x8,
92 PF_EVENT_TYPE_STR_SUBT_TRACK_INFO = 0x9,
93 PF_EVENT_TYPE_STR_BUFF_EVENT = 0xa,
94 PF_EVENT_TYPE_STR_SOURCE_INFO = 0xb,
95 PF_EVENT_TYPE_INT_NUM_PROGRAM = 0xd,
96 PF_EVENT_TYPE_INT_NUM_VIDEO_TRACK = 0xe,
97 PF_EVENT_TYPE_INT_NUM_AUDIO_TRACK = 0xf,
98 PF_EVENT_TYPE_STR_RESOURCE_INFO = 0x11,
99 PF_EVENT_TYPE_INT_ERROR = 0x12,
100 PF_EVENT_TYPE_STR_ERROR = 0x13,
101 PF_EVENT_TYPE_STR_STATE_UPDATE__PRELOADCOMPLETED = 0x15,
102 PF_EVENT_TYPE_STR_STATE_UPDATE__LOADCOMPLETED = 0x16,
103 PF_EVENT_TYPE_STR_STATE_UPDATE__UNLOADCOMPLETED = 0x17,
104 PF_EVENT_TYPE_STR_STATE_UPDATE__TRACKSELECTED = 0x18,
105 PF_EVENT_TYPE_STR_STATE_UPDATE__SEEKDONE = 0x19,
106 PF_EVENT_TYPE_STR_STATE_UPDATE__PLAYING = 0x1a,
107 PF_EVENT_TYPE_STR_STATE_UPDATE__PAUSED = 0x1b,
108 PF_EVENT_TYPE_STR_STATE_UPDATE__ENDOFSTREAM = 0x1c,
109 PF_EVENT_TYPE_STR_CUSTOM = 0x1d,
110 PF_EVENT_TYPE_INT_NEED_DATA = 0x26,
111 PF_EVENT_TYPE_INT_ENOUGH_DATA = 0x27,
112 PF_EVENT_TYPE_INT_SVP_VDEC_READY = 0x2b,
113 PF_EVENT_TYPE_INT_BUFFERLOW = 0x2c,
114 PF_EVENT_TYPE_STR_BUFFERFULL = 0x2d,
115 PF_EVENT_TYPE_STR_BUFFERLOW = 0x2e,
116 PF_EVENT_TYPE_DROPPED_FRAME = 0x30,
117 PF_EVENT_USER_DEFINED = 0x270,
118};
Definition StarfishMediaAPIs.h:34