1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_CJ_AVSESSION_PROTOTYPES_H 17 #define OHOS_CJ_AVSESSION_PROTOTYPES_H 18 19 #include <cstdint> 20 21 #ifdef __cplusplus 22 #if __cplusplus 23 extern "C" { 24 #endif 25 #endif 26 27 /* Value Type =====================*/ 28 typedef struct { 29 void* head; 30 uint64_t size; 31 } CArray; 32 33 typedef struct { 34 int32_t kind; 35 char* string; 36 int64_t pixelMap; 37 } StringPixelMapParameter; 38 39 typedef struct { 40 int32_t valueType; 41 char* key; 42 void* value; 43 int64_t size; 44 } CParameters; 45 46 /* CangJie Struct =====================*/ 47 48 typedef struct { 49 int32_t state; 50 bool muted; 51 } CAVCallState; 52 53 typedef struct { 54 char* name; 55 char* phoneNumber; 56 int64_t avatar; 57 } CAVCallMetaData; 58 59 typedef struct { 60 int64_t elapsedTime; 61 int64_t updateTime; 62 } CPlaybackPosition; 63 64 typedef struct { 65 int32_t state; 66 double speed; 67 CPlaybackPosition position; 68 int64_t bufferedTime; 69 int32_t loopMode; 70 bool isFavorite; 71 int32_t activeItemId; 72 int32_t volume; 73 int32_t maxVolume; 74 bool muted; 75 int32_t duration; 76 int32_t videoWidth; 77 int32_t videoHeight; 78 CArray extras; 79 } CAVPlaybackState; 80 81 typedef struct { 82 char* assetId; 83 char* title; 84 char* artist; 85 char* author; 86 char* avQueueName; 87 char* avQueueId; 88 StringPixelMapParameter avQueueImage; 89 char* album; 90 char* writer; 91 char* composer; 92 int64_t duration; 93 StringPixelMapParameter mediaImage; 94 int64_t publishDate; 95 char* subtitle; 96 char* description; 97 char* lyric; 98 char* previousAssetId; 99 char* nextAssetId; 100 int32_t filter; 101 CArray drmSchemes; 102 int32_t skipIntervals; 103 int32_t displayTags; 104 int32_t mediaLength; 105 int32_t avQueueLength; 106 } CAVMetaData; 107 108 typedef struct { 109 int32_t castCategory; 110 int32_t deviceType; 111 char* deviceId; 112 char* deviceName; 113 int32_t supportedProtocols; 114 CArray supportedDrmCapabilities; 115 } CDeviceInfo; 116 117 typedef struct { 118 CArray devices; 119 } COutputDeviceInfo; 120 121 typedef struct { 122 int32_t fd; 123 int64_t offset; 124 int64_t length; 125 } CAVFileDescriptor; 126 127 typedef struct { 128 int64_t fileSize; 129 int64_t callback; 130 } CAVDataSrcDescriptor; 131 132 typedef struct { 133 char* mediaId; 134 char* title; 135 char* subtitle; 136 char* description; 137 char* mediaUri; 138 StringPixelMapParameter mediaImage; 139 CArray extras; 140 char* mediaType; 141 int32_t mediaSize; 142 char* albumTitle; 143 char* albumCoverUri; 144 char* lyricContent; 145 char* lyricUri; 146 char* artist; 147 CAVFileDescriptor fdSrc; 148 char* drmScheme; 149 CAVDataSrcDescriptor dataSrc; 150 int32_t duration; 151 int32_t startPosition; 152 int32_t creditsPosition; 153 char* appName; 154 int32_t displayTags; 155 } CAVMediaDescription; 156 157 typedef struct { 158 int32_t itemId; 159 CAVMediaDescription description; 160 } CAVQueueItem; 161 162 typedef struct { 163 int32_t command; 164 CParameters parameter; 165 } CAVSessionCommand; 166 167 typedef struct { 168 int32_t kind; 169 void* data; 170 void* data2; 171 int32_t error; 172 } CCallbackData; 173 174 typedef struct { 175 uint64_t id; 176 char* name; 177 int32_t displayState; 178 int32_t width; 179 int32_t height; 180 } CCastDisplayInfo; 181 182 typedef struct { 183 int32_t id; 184 int32_t deviceId; 185 int64_t actionTime; 186 int32_t screenId; 187 int32_t windowId; 188 } CInputEvent; 189 190 typedef struct { 191 int32_t code; 192 int64_t pressedTime; 193 int32_t deviceId; 194 } CKey; 195 196 typedef struct { 197 CInputEvent base; 198 int32_t action; 199 CKey key; 200 uint32_t unicodeChar; 201 CKey* keys; 202 int64_t keysLength; 203 bool ctrlKey; 204 bool altKey; 205 bool shiftKey; 206 bool logoKey; 207 bool fnKey; 208 bool capsLock; 209 bool numLock; 210 bool scrollLock; 211 } CKeyEvent; 212 213 #ifdef __cplusplus 214 #if __cplusplus 215 } 216 #endif 217 #endif 218 #endif /* OHOS_CJ_AVSESSION_PROTOTYPES_H */