MCPcopy Create free account
hub / github.com/alibaba/CicadaPlayer / getPropertyJSONStr

Method getPropertyJSONStr

mediaPlayer/MediaPlayerAnalyticsUtil.cpp:189–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189void MediaPlayerAnalyticsUtil::getPropertyJSONStr(const std::string &name, CicadaJSONArray &array, bool isArray,
190 std::deque<StreamInfo *> &streamInfoQueue, demuxer_service *service)
191{
192 if (nullptr == service) {
193 return;
194 }
195
196 for (auto &it : streamInfoQueue) {
197 std::string str = service->GetProperty(it->streamIndex, name);
198
199 if (str.empty()) {
200 continue;
201 }
202
203 if (isArray) {
204 CicadaJSONArray subArray(str);
205
206 for (int i = 0; i < subArray.getSize(); ++i) {
207 CicadaJSONItem &tempItem = subArray.getItem(i);
208 addPropertyType(tempItem, it->type);
209 array.addJSON(tempItem);
210 }
211 } else {
212 CicadaJSONItem loopItem(str);
213 addPropertyType(loopItem, it->type);
214 array.addJSON(loopItem);
215 }
216 }
217}
218
219void MediaPlayerAnalyticsUtil::addPropertyType(CicadaJSONItem &item, StreamType type)
220{

Callers

nothing calls this directly

Calls 5

addJSONMethod · 0.80
GetPropertyMethod · 0.45
emptyMethod · 0.45
getSizeMethod · 0.45
getItemMethod · 0.45

Tested by

no test coverage detected