QueryJobListResult.cc 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. /*
  2. * Copyright 2009-2017 Alibaba Cloud All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #include <alibabacloud/mts/model/QueryJobListResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Mts;
  19. using namespace AlibabaCloud::Mts::Model;
  20. QueryJobListResult::QueryJobListResult() :
  21. ServiceResult()
  22. {}
  23. QueryJobListResult::QueryJobListResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. QueryJobListResult::~QueryJobListResult()
  29. {}
  30. void QueryJobListResult::parse(const std::string &payload)
  31. {
  32. Json::Reader reader;
  33. Json::Value value;
  34. reader.parse(payload, value);
  35. setRequestId(value["RequestId"].asString());
  36. auto allJobListNode = value["JobList"]["Job"];
  37. for (auto valueJobListJob : allJobListNode)
  38. {
  39. Job jobListObject;
  40. if(!valueJobListJob["JobId"].isNull())
  41. jobListObject.jobId = valueJobListJob["JobId"].asString();
  42. if(!valueJobListJob["State"].isNull())
  43. jobListObject.state = valueJobListJob["State"].asString();
  44. if(!valueJobListJob["Code"].isNull())
  45. jobListObject.code = valueJobListJob["Code"].asString();
  46. if(!valueJobListJob["Message"].isNull())
  47. jobListObject.message = valueJobListJob["Message"].asString();
  48. if(!valueJobListJob["Percent"].isNull())
  49. jobListObject.percent = std::stol(valueJobListJob["Percent"].asString());
  50. if(!valueJobListJob["PipelineId"].isNull())
  51. jobListObject.pipelineId = valueJobListJob["PipelineId"].asString();
  52. if(!valueJobListJob["CreationTime"].isNull())
  53. jobListObject.creationTime = valueJobListJob["CreationTime"].asString();
  54. if(!valueJobListJob["FinishTime"].isNull())
  55. jobListObject.finishTime = valueJobListJob["FinishTime"].asString();
  56. auto inputNode = value["Input"];
  57. if(!inputNode["Bucket"].isNull())
  58. jobListObject.input.bucket = inputNode["Bucket"].asString();
  59. if(!inputNode["Location"].isNull())
  60. jobListObject.input.location = inputNode["Location"].asString();
  61. if(!inputNode["Object"].isNull())
  62. jobListObject.input.object = inputNode["Object"].asString();
  63. auto outputNode = value["Output"];
  64. if(!outputNode["TemplateId"].isNull())
  65. jobListObject.output.templateId = outputNode["TemplateId"].asString();
  66. if(!outputNode["UserData"].isNull())
  67. jobListObject.output.userData = outputNode["UserData"].asString();
  68. if(!outputNode["Rotate"].isNull())
  69. jobListObject.output.rotate = outputNode["Rotate"].asString();
  70. if(!outputNode["VideoStreamMap"].isNull())
  71. jobListObject.output.videoStreamMap = outputNode["VideoStreamMap"].asString();
  72. if(!outputNode["AudioStreamMap"].isNull())
  73. jobListObject.output.audioStreamMap = outputNode["AudioStreamMap"].asString();
  74. if(!outputNode["DeWatermark"].isNull())
  75. jobListObject.output.deWatermark = outputNode["DeWatermark"].asString();
  76. if(!outputNode["Priority"].isNull())
  77. jobListObject.output.priority = outputNode["Priority"].asString();
  78. if(!outputNode["WaterMarkConfigUrl"].isNull())
  79. jobListObject.output.waterMarkConfigUrl = outputNode["WaterMarkConfigUrl"].asString();
  80. if(!outputNode["MergeConfigUrl"].isNull())
  81. jobListObject.output.mergeConfigUrl = outputNode["MergeConfigUrl"].asString();
  82. auto allWaterMarkListNode = outputNode["WaterMarkList"]["WaterMark"];
  83. for (auto outputNodeWaterMarkListWaterMark : allWaterMarkListNode)
  84. {
  85. Job::Output::WaterMark waterMarkObject;
  86. if(!outputNodeWaterMarkListWaterMark["WaterMarkTemplateId"].isNull())
  87. waterMarkObject.waterMarkTemplateId = outputNodeWaterMarkListWaterMark["WaterMarkTemplateId"].asString();
  88. if(!outputNodeWaterMarkListWaterMark["Width"].isNull())
  89. waterMarkObject.width = outputNodeWaterMarkListWaterMark["Width"].asString();
  90. if(!outputNodeWaterMarkListWaterMark["Height"].isNull())
  91. waterMarkObject.height = outputNodeWaterMarkListWaterMark["Height"].asString();
  92. if(!outputNodeWaterMarkListWaterMark["Dx"].isNull())
  93. waterMarkObject.dx = outputNodeWaterMarkListWaterMark["Dx"].asString();
  94. if(!outputNodeWaterMarkListWaterMark["Dy"].isNull())
  95. waterMarkObject.dy = outputNodeWaterMarkListWaterMark["Dy"].asString();
  96. if(!outputNodeWaterMarkListWaterMark["ReferPos"].isNull())
  97. waterMarkObject.referPos = outputNodeWaterMarkListWaterMark["ReferPos"].asString();
  98. if(!outputNodeWaterMarkListWaterMark["Type"].isNull())
  99. waterMarkObject.type = outputNodeWaterMarkListWaterMark["Type"].asString();
  100. auto inputFileNode = value["InputFile"];
  101. if(!inputFileNode["Bucket"].isNull())
  102. waterMarkObject.inputFile.bucket = inputFileNode["Bucket"].asString();
  103. if(!inputFileNode["Location"].isNull())
  104. waterMarkObject.inputFile.location = inputFileNode["Location"].asString();
  105. if(!inputFileNode["Object"].isNull())
  106. waterMarkObject.inputFile.object = inputFileNode["Object"].asString();
  107. jobListObject.output.waterMarkList.push_back(waterMarkObject);
  108. }
  109. auto allMergeListNode = outputNode["MergeList"]["Merge"];
  110. for (auto outputNodeMergeListMerge : allMergeListNode)
  111. {
  112. Job::Output::Merge mergeObject;
  113. if(!outputNodeMergeListMerge["MergeURL"].isNull())
  114. mergeObject.mergeURL = outputNodeMergeListMerge["MergeURL"].asString();
  115. if(!outputNodeMergeListMerge["Start"].isNull())
  116. mergeObject.start = outputNodeMergeListMerge["Start"].asString();
  117. if(!outputNodeMergeListMerge["Duration"].isNull())
  118. mergeObject.duration = outputNodeMergeListMerge["Duration"].asString();
  119. if(!outputNodeMergeListMerge["RoleArn"].isNull())
  120. mergeObject.roleArn = outputNodeMergeListMerge["RoleArn"].asString();
  121. jobListObject.output.mergeList.push_back(mergeObject);
  122. }
  123. auto allOpeningListNode = outputNode["OpeningList"]["Opening"];
  124. for (auto outputNodeOpeningListOpening : allOpeningListNode)
  125. {
  126. Job::Output::Opening openingObject;
  127. if(!outputNodeOpeningListOpening["openUrl"].isNull())
  128. openingObject.openUrl = outputNodeOpeningListOpening["openUrl"].asString();
  129. if(!outputNodeOpeningListOpening["Start"].isNull())
  130. openingObject.start = outputNodeOpeningListOpening["Start"].asString();
  131. if(!outputNodeOpeningListOpening["Width"].isNull())
  132. openingObject.width = outputNodeOpeningListOpening["Width"].asString();
  133. if(!outputNodeOpeningListOpening["Height"].isNull())
  134. openingObject.height = outputNodeOpeningListOpening["Height"].asString();
  135. jobListObject.output.openingList.push_back(openingObject);
  136. }
  137. auto allTailSlateListNode = outputNode["TailSlateList"]["TailSlate"];
  138. for (auto outputNodeTailSlateListTailSlate : allTailSlateListNode)
  139. {
  140. Job::Output::TailSlate tailSlateObject;
  141. if(!outputNodeTailSlateListTailSlate["TailUrl"].isNull())
  142. tailSlateObject.tailUrl = outputNodeTailSlateListTailSlate["TailUrl"].asString();
  143. if(!outputNodeTailSlateListTailSlate["Start"].isNull())
  144. tailSlateObject.start = outputNodeTailSlateListTailSlate["Start"].asString();
  145. if(!outputNodeTailSlateListTailSlate["BlendDuration"].isNull())
  146. tailSlateObject.blendDuration = outputNodeTailSlateListTailSlate["BlendDuration"].asString();
  147. if(!outputNodeTailSlateListTailSlate["Width"].isNull())
  148. tailSlateObject.width = outputNodeTailSlateListTailSlate["Width"].asString();
  149. if(!outputNodeTailSlateListTailSlate["Height"].isNull())
  150. tailSlateObject.height = outputNodeTailSlateListTailSlate["Height"].asString();
  151. if(!outputNodeTailSlateListTailSlate["IsMergeAudio"].isNull())
  152. tailSlateObject.isMergeAudio = outputNodeTailSlateListTailSlate["IsMergeAudio"].asString() == "true";
  153. if(!outputNodeTailSlateListTailSlate["BgColor"].isNull())
  154. tailSlateObject.bgColor = outputNodeTailSlateListTailSlate["BgColor"].asString();
  155. jobListObject.output.tailSlateList.push_back(tailSlateObject);
  156. }
  157. auto allOutSubtitleListNode = outputNode["OutSubtitleList"]["OutSubtitle"];
  158. for (auto outputNodeOutSubtitleListOutSubtitle : allOutSubtitleListNode)
  159. {
  160. Job::Output::OutSubtitle outSubtitleObject;
  161. if(!outputNodeOutSubtitleListOutSubtitle["Map"].isNull())
  162. outSubtitleObject.map = outputNodeOutSubtitleListOutSubtitle["Map"].asString();
  163. if(!outputNodeOutSubtitleListOutSubtitle["Success"].isNull())
  164. outSubtitleObject.success = outputNodeOutSubtitleListOutSubtitle["Success"].asString() == "true";
  165. if(!outputNodeOutSubtitleListOutSubtitle["Message"].isNull())
  166. outSubtitleObject.message = outputNodeOutSubtitleListOutSubtitle["Message"].asString();
  167. auto outSubtitleFileNode = value["OutSubtitleFile"];
  168. if(!outSubtitleFileNode["Bucket"].isNull())
  169. outSubtitleObject.outSubtitleFile.bucket = outSubtitleFileNode["Bucket"].asString();
  170. if(!outSubtitleFileNode["Location"].isNull())
  171. outSubtitleObject.outSubtitleFile.location = outSubtitleFileNode["Location"].asString();
  172. if(!outSubtitleFileNode["Object"].isNull())
  173. outSubtitleObject.outSubtitleFile.object = outSubtitleFileNode["Object"].asString();
  174. if(!outSubtitleFileNode["RoleArn"].isNull())
  175. outSubtitleObject.outSubtitleFile.roleArn = outSubtitleFileNode["RoleArn"].asString();
  176. jobListObject.output.outSubtitleList.push_back(outSubtitleObject);
  177. }
  178. auto outputFileNode = outputNode["OutputFile"];
  179. if(!outputFileNode["Bucket"].isNull())
  180. jobListObject.output.outputFile.bucket = outputFileNode["Bucket"].asString();
  181. if(!outputFileNode["Location"].isNull())
  182. jobListObject.output.outputFile.location = outputFileNode["Location"].asString();
  183. if(!outputFileNode["Object"].isNull())
  184. jobListObject.output.outputFile.object = outputFileNode["Object"].asString();
  185. if(!outputFileNode["RoleArn"].isNull())
  186. jobListObject.output.outputFile.roleArn = outputFileNode["RoleArn"].asString();
  187. auto m3U8NonStandardSupportNode = outputNode["M3U8NonStandardSupport"];
  188. auto tSNode = m3U8NonStandardSupportNode["TS"];
  189. if(!tSNode["Md5Support"].isNull())
  190. jobListObject.output.m3U8NonStandardSupport.tS.md5Support = tSNode["Md5Support"].asString() == "true";
  191. if(!tSNode["SizeSupport"].isNull())
  192. jobListObject.output.m3U8NonStandardSupport.tS.sizeSupport = tSNode["SizeSupport"].asString() == "true";
  193. auto propertiesNode = outputNode["Properties"];
  194. if(!propertiesNode["Width"].isNull())
  195. jobListObject.output.properties.width = propertiesNode["Width"].asString();
  196. if(!propertiesNode["Height"].isNull())
  197. jobListObject.output.properties.height = propertiesNode["Height"].asString();
  198. if(!propertiesNode["Bitrate"].isNull())
  199. jobListObject.output.properties.bitrate = propertiesNode["Bitrate"].asString();
  200. if(!propertiesNode["Duration"].isNull())
  201. jobListObject.output.properties.duration = propertiesNode["Duration"].asString();
  202. if(!propertiesNode["Fps"].isNull())
  203. jobListObject.output.properties.fps = propertiesNode["Fps"].asString();
  204. if(!propertiesNode["FileSize"].isNull())
  205. jobListObject.output.properties.fileSize = propertiesNode["FileSize"].asString();
  206. if(!propertiesNode["FileFormat"].isNull())
  207. jobListObject.output.properties.fileFormat = propertiesNode["FileFormat"].asString();
  208. auto allSourceLogosNode = propertiesNode["SourceLogos"]["SourceLogo"];
  209. for (auto propertiesNodeSourceLogosSourceLogo : allSourceLogosNode)
  210. {
  211. Job::Output::Properties::SourceLogo sourceLogoObject;
  212. if(!propertiesNodeSourceLogosSourceLogo["Source"].isNull())
  213. sourceLogoObject.source = propertiesNodeSourceLogosSourceLogo["Source"].asString();
  214. jobListObject.output.properties.sourceLogos.push_back(sourceLogoObject);
  215. }
  216. auto streamsNode = propertiesNode["Streams"];
  217. auto allVideoStreamListNode = streamsNode["VideoStreamList"]["VideoStream"];
  218. for (auto streamsNodeVideoStreamListVideoStream : allVideoStreamListNode)
  219. {
  220. Job::Output::Properties::Streams::VideoStream videoStreamObject;
  221. if(!streamsNodeVideoStreamListVideoStream["Index"].isNull())
  222. videoStreamObject.index = streamsNodeVideoStreamListVideoStream["Index"].asString();
  223. if(!streamsNodeVideoStreamListVideoStream["CodecName"].isNull())
  224. videoStreamObject.codecName = streamsNodeVideoStreamListVideoStream["CodecName"].asString();
  225. if(!streamsNodeVideoStreamListVideoStream["CodecLongName"].isNull())
  226. videoStreamObject.codecLongName = streamsNodeVideoStreamListVideoStream["CodecLongName"].asString();
  227. if(!streamsNodeVideoStreamListVideoStream["Profile"].isNull())
  228. videoStreamObject.profile = streamsNodeVideoStreamListVideoStream["Profile"].asString();
  229. if(!streamsNodeVideoStreamListVideoStream["CodecTimeBase"].isNull())
  230. videoStreamObject.codecTimeBase = streamsNodeVideoStreamListVideoStream["CodecTimeBase"].asString();
  231. if(!streamsNodeVideoStreamListVideoStream["CodecTagString"].isNull())
  232. videoStreamObject.codecTagString = streamsNodeVideoStreamListVideoStream["CodecTagString"].asString();
  233. if(!streamsNodeVideoStreamListVideoStream["CodecTag"].isNull())
  234. videoStreamObject.codecTag = streamsNodeVideoStreamListVideoStream["CodecTag"].asString();
  235. if(!streamsNodeVideoStreamListVideoStream["Width"].isNull())
  236. videoStreamObject.width = streamsNodeVideoStreamListVideoStream["Width"].asString();
  237. if(!streamsNodeVideoStreamListVideoStream["Height"].isNull())
  238. videoStreamObject.height = streamsNodeVideoStreamListVideoStream["Height"].asString();
  239. if(!streamsNodeVideoStreamListVideoStream["HasBFrames"].isNull())
  240. videoStreamObject.hasBFrames = streamsNodeVideoStreamListVideoStream["HasBFrames"].asString();
  241. if(!streamsNodeVideoStreamListVideoStream["Sar"].isNull())
  242. videoStreamObject.sar = streamsNodeVideoStreamListVideoStream["Sar"].asString();
  243. if(!streamsNodeVideoStreamListVideoStream["Dar"].isNull())
  244. videoStreamObject.dar = streamsNodeVideoStreamListVideoStream["Dar"].asString();
  245. if(!streamsNodeVideoStreamListVideoStream["PixFmt"].isNull())
  246. videoStreamObject.pixFmt = streamsNodeVideoStreamListVideoStream["PixFmt"].asString();
  247. if(!streamsNodeVideoStreamListVideoStream["Level"].isNull())
  248. videoStreamObject.level = streamsNodeVideoStreamListVideoStream["Level"].asString();
  249. if(!streamsNodeVideoStreamListVideoStream["Fps"].isNull())
  250. videoStreamObject.fps = streamsNodeVideoStreamListVideoStream["Fps"].asString();
  251. if(!streamsNodeVideoStreamListVideoStream["AvgFPS"].isNull())
  252. videoStreamObject.avgFPS = streamsNodeVideoStreamListVideoStream["AvgFPS"].asString();
  253. if(!streamsNodeVideoStreamListVideoStream["Timebase"].isNull())
  254. videoStreamObject.timebase = streamsNodeVideoStreamListVideoStream["Timebase"].asString();
  255. if(!streamsNodeVideoStreamListVideoStream["StartTime"].isNull())
  256. videoStreamObject.startTime = streamsNodeVideoStreamListVideoStream["StartTime"].asString();
  257. if(!streamsNodeVideoStreamListVideoStream["Duration"].isNull())
  258. videoStreamObject.duration = streamsNodeVideoStreamListVideoStream["Duration"].asString();
  259. if(!streamsNodeVideoStreamListVideoStream["Bitrate"].isNull())
  260. videoStreamObject.bitrate = streamsNodeVideoStreamListVideoStream["Bitrate"].asString();
  261. if(!streamsNodeVideoStreamListVideoStream["NumFrames"].isNull())
  262. videoStreamObject.numFrames = streamsNodeVideoStreamListVideoStream["NumFrames"].asString();
  263. if(!streamsNodeVideoStreamListVideoStream["Lang"].isNull())
  264. videoStreamObject.lang = streamsNodeVideoStreamListVideoStream["Lang"].asString();
  265. auto networkCostNode = value["NetworkCost"];
  266. if(!networkCostNode["PreloadTime"].isNull())
  267. videoStreamObject.networkCost.preloadTime = networkCostNode["PreloadTime"].asString();
  268. if(!networkCostNode["CostBandwidth"].isNull())
  269. videoStreamObject.networkCost.costBandwidth = networkCostNode["CostBandwidth"].asString();
  270. if(!networkCostNode["AvgBitrate"].isNull())
  271. videoStreamObject.networkCost.avgBitrate = networkCostNode["AvgBitrate"].asString();
  272. jobListObject.output.properties.streams.videoStreamList.push_back(videoStreamObject);
  273. }
  274. auto allAudioStreamListNode = streamsNode["AudioStreamList"]["AudioStream"];
  275. for (auto streamsNodeAudioStreamListAudioStream : allAudioStreamListNode)
  276. {
  277. Job::Output::Properties::Streams::AudioStream audioStreamObject;
  278. if(!streamsNodeAudioStreamListAudioStream["Index"].isNull())
  279. audioStreamObject.index = streamsNodeAudioStreamListAudioStream["Index"].asString();
  280. if(!streamsNodeAudioStreamListAudioStream["CodecName"].isNull())
  281. audioStreamObject.codecName = streamsNodeAudioStreamListAudioStream["CodecName"].asString();
  282. if(!streamsNodeAudioStreamListAudioStream["CodecTimeBase"].isNull())
  283. audioStreamObject.codecTimeBase = streamsNodeAudioStreamListAudioStream["CodecTimeBase"].asString();
  284. if(!streamsNodeAudioStreamListAudioStream["CodecLongName"].isNull())
  285. audioStreamObject.codecLongName = streamsNodeAudioStreamListAudioStream["CodecLongName"].asString();
  286. if(!streamsNodeAudioStreamListAudioStream["CodecTagString"].isNull())
  287. audioStreamObject.codecTagString = streamsNodeAudioStreamListAudioStream["CodecTagString"].asString();
  288. if(!streamsNodeAudioStreamListAudioStream["CodecTag"].isNull())
  289. audioStreamObject.codecTag = streamsNodeAudioStreamListAudioStream["CodecTag"].asString();
  290. if(!streamsNodeAudioStreamListAudioStream["SampleFmt"].isNull())
  291. audioStreamObject.sampleFmt = streamsNodeAudioStreamListAudioStream["SampleFmt"].asString();
  292. if(!streamsNodeAudioStreamListAudioStream["Samplerate"].isNull())
  293. audioStreamObject.samplerate = streamsNodeAudioStreamListAudioStream["Samplerate"].asString();
  294. if(!streamsNodeAudioStreamListAudioStream["Channels"].isNull())
  295. audioStreamObject.channels = streamsNodeAudioStreamListAudioStream["Channels"].asString();
  296. if(!streamsNodeAudioStreamListAudioStream["ChannelLayout"].isNull())
  297. audioStreamObject.channelLayout = streamsNodeAudioStreamListAudioStream["ChannelLayout"].asString();
  298. if(!streamsNodeAudioStreamListAudioStream["Timebase"].isNull())
  299. audioStreamObject.timebase = streamsNodeAudioStreamListAudioStream["Timebase"].asString();
  300. if(!streamsNodeAudioStreamListAudioStream["StartTime"].isNull())
  301. audioStreamObject.startTime = streamsNodeAudioStreamListAudioStream["StartTime"].asString();
  302. if(!streamsNodeAudioStreamListAudioStream["Duration"].isNull())
  303. audioStreamObject.duration = streamsNodeAudioStreamListAudioStream["Duration"].asString();
  304. if(!streamsNodeAudioStreamListAudioStream["Bitrate"].isNull())
  305. audioStreamObject.bitrate = streamsNodeAudioStreamListAudioStream["Bitrate"].asString();
  306. if(!streamsNodeAudioStreamListAudioStream["NumFrames"].isNull())
  307. audioStreamObject.numFrames = streamsNodeAudioStreamListAudioStream["NumFrames"].asString();
  308. if(!streamsNodeAudioStreamListAudioStream["Lang"].isNull())
  309. audioStreamObject.lang = streamsNodeAudioStreamListAudioStream["Lang"].asString();
  310. jobListObject.output.properties.streams.audioStreamList.push_back(audioStreamObject);
  311. }
  312. auto allSubtitleStreamListNode = streamsNode["SubtitleStreamList"]["SubtitleStream"];
  313. for (auto streamsNodeSubtitleStreamListSubtitleStream : allSubtitleStreamListNode)
  314. {
  315. Job::Output::Properties::Streams::SubtitleStream subtitleStreamObject;
  316. if(!streamsNodeSubtitleStreamListSubtitleStream["Index"].isNull())
  317. subtitleStreamObject.index = streamsNodeSubtitleStreamListSubtitleStream["Index"].asString();
  318. if(!streamsNodeSubtitleStreamListSubtitleStream["Lang"].isNull())
  319. subtitleStreamObject.lang = streamsNodeSubtitleStreamListSubtitleStream["Lang"].asString();
  320. jobListObject.output.properties.streams.subtitleStreamList.push_back(subtitleStreamObject);
  321. }
  322. auto formatNode = propertiesNode["Format"];
  323. if(!formatNode["NumStreams"].isNull())
  324. jobListObject.output.properties.format.numStreams = formatNode["NumStreams"].asString();
  325. if(!formatNode["NumPrograms"].isNull())
  326. jobListObject.output.properties.format.numPrograms = formatNode["NumPrograms"].asString();
  327. if(!formatNode["FormatName"].isNull())
  328. jobListObject.output.properties.format.formatName = formatNode["FormatName"].asString();
  329. if(!formatNode["FormatLongName"].isNull())
  330. jobListObject.output.properties.format.formatLongName = formatNode["FormatLongName"].asString();
  331. if(!formatNode["StartTime"].isNull())
  332. jobListObject.output.properties.format.startTime = formatNode["StartTime"].asString();
  333. if(!formatNode["Duration"].isNull())
  334. jobListObject.output.properties.format.duration = formatNode["Duration"].asString();
  335. if(!formatNode["Size"].isNull())
  336. jobListObject.output.properties.format.size = formatNode["Size"].asString();
  337. if(!formatNode["Bitrate"].isNull())
  338. jobListObject.output.properties.format.bitrate = formatNode["Bitrate"].asString();
  339. auto clipNode = outputNode["Clip"];
  340. auto timeSpanNode = clipNode["TimeSpan"];
  341. if(!timeSpanNode["Seek"].isNull())
  342. jobListObject.output.clip.timeSpan.seek = timeSpanNode["Seek"].asString();
  343. if(!timeSpanNode["Duration"].isNull())
  344. jobListObject.output.clip.timeSpan.duration = timeSpanNode["Duration"].asString();
  345. auto superResoNode = outputNode["SuperReso"];
  346. if(!superResoNode["IsHalfSample"].isNull())
  347. jobListObject.output.superReso.isHalfSample = superResoNode["IsHalfSample"].asString();
  348. auto subtitleConfigNode = outputNode["SubtitleConfig"];
  349. auto allSubtitleListNode = subtitleConfigNode["SubtitleList"]["Subtitle"];
  350. for (auto subtitleConfigNodeSubtitleListSubtitle : allSubtitleListNode)
  351. {
  352. Job::Output::SubtitleConfig::Subtitle subtitleObject;
  353. if(!subtitleConfigNodeSubtitleListSubtitle["Map"].isNull())
  354. subtitleObject.map = subtitleConfigNodeSubtitleListSubtitle["Map"].asString();
  355. jobListObject.output.subtitleConfig.subtitleList.push_back(subtitleObject);
  356. }
  357. auto allExtSubtitleListNode = subtitleConfigNode["ExtSubtitleList"]["ExtSubtitle"];
  358. for (auto subtitleConfigNodeExtSubtitleListExtSubtitle : allExtSubtitleListNode)
  359. {
  360. Job::Output::SubtitleConfig::ExtSubtitle extSubtitleObject;
  361. if(!subtitleConfigNodeExtSubtitleListExtSubtitle["FontName"].isNull())
  362. extSubtitleObject.fontName = subtitleConfigNodeExtSubtitleListExtSubtitle["FontName"].asString();
  363. if(!subtitleConfigNodeExtSubtitleListExtSubtitle["CharEnc"].isNull())
  364. extSubtitleObject.charEnc = subtitleConfigNodeExtSubtitleListExtSubtitle["CharEnc"].asString();
  365. auto input1Node = value["Input"];
  366. if(!input1Node["Bucket"].isNull())
  367. extSubtitleObject.input1.bucket = input1Node["Bucket"].asString();
  368. if(!input1Node["Location"].isNull())
  369. extSubtitleObject.input1.location = input1Node["Location"].asString();
  370. if(!input1Node["Object"].isNull())
  371. extSubtitleObject.input1.object = input1Node["Object"].asString();
  372. jobListObject.output.subtitleConfig.extSubtitleList.push_back(extSubtitleObject);
  373. }
  374. auto transConfigNode = outputNode["TransConfig"];
  375. if(!transConfigNode["TransMode"].isNull())
  376. jobListObject.output.transConfig.transMode = transConfigNode["TransMode"].asString();
  377. if(!transConfigNode["IsCheckReso"].isNull())
  378. jobListObject.output.transConfig.isCheckReso = transConfigNode["IsCheckReso"].asString();
  379. if(!transConfigNode["IsCheckResoFail"].isNull())
  380. jobListObject.output.transConfig.isCheckResoFail = transConfigNode["IsCheckResoFail"].asString();
  381. if(!transConfigNode["IsCheckVideoBitrate"].isNull())
  382. jobListObject.output.transConfig.isCheckVideoBitrate = transConfigNode["IsCheckVideoBitrate"].asString();
  383. if(!transConfigNode["IsCheckAudioBitrate"].isNull())
  384. jobListObject.output.transConfig.isCheckAudioBitrate = transConfigNode["IsCheckAudioBitrate"].asString();
  385. if(!transConfigNode["AdjDarMethod"].isNull())
  386. jobListObject.output.transConfig.adjDarMethod = transConfigNode["AdjDarMethod"].asString();
  387. if(!transConfigNode["IsCheckVideoBitrateFail"].isNull())
  388. jobListObject.output.transConfig.isCheckVideoBitrateFail = transConfigNode["IsCheckVideoBitrateFail"].asString();
  389. if(!transConfigNode["IsCheckAudioBitrateFail"].isNull())
  390. jobListObject.output.transConfig.isCheckAudioBitrateFail = transConfigNode["IsCheckAudioBitrateFail"].asString();
  391. auto muxConfigNode = outputNode["MuxConfig"];
  392. auto segmentNode = muxConfigNode["Segment"];
  393. if(!segmentNode["Duration"].isNull())
  394. jobListObject.output.muxConfig.segment.duration = segmentNode["Duration"].asString();
  395. auto gifNode = muxConfigNode["Gif"];
  396. if(!gifNode["Loop"].isNull())
  397. jobListObject.output.muxConfig.gif.loop = gifNode["Loop"].asString();
  398. if(!gifNode["FinalDelay"].isNull())
  399. jobListObject.output.muxConfig.gif.finalDelay = gifNode["FinalDelay"].asString();
  400. if(!gifNode["IsCustomPalette"].isNull())
  401. jobListObject.output.muxConfig.gif.isCustomPalette = gifNode["IsCustomPalette"].asString();
  402. if(!gifNode["DitherMode"].isNull())
  403. jobListObject.output.muxConfig.gif.ditherMode = gifNode["DitherMode"].asString();
  404. auto webpNode = muxConfigNode["Webp"];
  405. if(!webpNode["Loop"].isNull())
  406. jobListObject.output.muxConfig.webp.loop = webpNode["Loop"].asString();
  407. auto audioNode = outputNode["Audio"];
  408. if(!audioNode["Codec"].isNull())
  409. jobListObject.output.audio.codec = audioNode["Codec"].asString();
  410. if(!audioNode["Profile"].isNull())
  411. jobListObject.output.audio.profile = audioNode["Profile"].asString();
  412. if(!audioNode["Samplerate"].isNull())
  413. jobListObject.output.audio.samplerate = audioNode["Samplerate"].asString();
  414. if(!audioNode["Bitrate"].isNull())
  415. jobListObject.output.audio.bitrate = audioNode["Bitrate"].asString();
  416. if(!audioNode["Channels"].isNull())
  417. jobListObject.output.audio.channels = audioNode["Channels"].asString();
  418. if(!audioNode["Qscale"].isNull())
  419. jobListObject.output.audio.qscale = audioNode["Qscale"].asString();
  420. auto volumeNode = audioNode["Volume"];
  421. if(!volumeNode["Level"].isNull())
  422. jobListObject.output.audio.volume.level = volumeNode["Level"].asString();
  423. if(!volumeNode["Method"].isNull())
  424. jobListObject.output.audio.volume.method = volumeNode["Method"].asString();
  425. auto videoNode = outputNode["Video"];
  426. if(!videoNode["Codec"].isNull())
  427. jobListObject.output.video.codec = videoNode["Codec"].asString();
  428. if(!videoNode["Profile"].isNull())
  429. jobListObject.output.video.profile = videoNode["Profile"].asString();
  430. if(!videoNode["Bitrate"].isNull())
  431. jobListObject.output.video.bitrate = videoNode["Bitrate"].asString();
  432. if(!videoNode["Crf"].isNull())
  433. jobListObject.output.video.crf = videoNode["Crf"].asString();
  434. if(!videoNode["Width"].isNull())
  435. jobListObject.output.video.width = videoNode["Width"].asString();
  436. if(!videoNode["Height"].isNull())
  437. jobListObject.output.video.height = videoNode["Height"].asString();
  438. if(!videoNode["Fps"].isNull())
  439. jobListObject.output.video.fps = videoNode["Fps"].asString();
  440. if(!videoNode["Gop"].isNull())
  441. jobListObject.output.video.gop = videoNode["Gop"].asString();
  442. if(!videoNode["Preset"].isNull())
  443. jobListObject.output.video.preset = videoNode["Preset"].asString();
  444. if(!videoNode["ScanMode"].isNull())
  445. jobListObject.output.video.scanMode = videoNode["ScanMode"].asString();
  446. if(!videoNode["Bufsize"].isNull())
  447. jobListObject.output.video.bufsize = videoNode["Bufsize"].asString();
  448. if(!videoNode["Maxrate"].isNull())
  449. jobListObject.output.video.maxrate = videoNode["Maxrate"].asString();
  450. if(!videoNode["PixFmt"].isNull())
  451. jobListObject.output.video.pixFmt = videoNode["PixFmt"].asString();
  452. if(!videoNode["Degrain"].isNull())
  453. jobListObject.output.video.degrain = videoNode["Degrain"].asString();
  454. if(!videoNode["Qscale"].isNull())
  455. jobListObject.output.video.qscale = videoNode["Qscale"].asString();
  456. if(!videoNode["Crop"].isNull())
  457. jobListObject.output.video.crop = videoNode["Crop"].asString();
  458. if(!videoNode["Pad"].isNull())
  459. jobListObject.output.video.pad = videoNode["Pad"].asString();
  460. if(!videoNode["MaxFps"].isNull())
  461. jobListObject.output.video.maxFps = videoNode["MaxFps"].asString();
  462. if(!videoNode["ResoPriority"].isNull())
  463. jobListObject.output.video.resoPriority = videoNode["ResoPriority"].asString();
  464. auto bitrateBndNode = videoNode["BitrateBnd"];
  465. if(!bitrateBndNode["Max"].isNull())
  466. jobListObject.output.video.bitrateBnd.max = bitrateBndNode["Max"].asString();
  467. if(!bitrateBndNode["Min"].isNull())
  468. jobListObject.output.video.bitrateBnd.min = bitrateBndNode["Min"].asString();
  469. auto containerNode = outputNode["Container"];
  470. if(!containerNode["Format"].isNull())
  471. jobListObject.output.container.format = containerNode["Format"].asString();
  472. auto encryptionNode = outputNode["Encryption"];
  473. if(!encryptionNode["Type"].isNull())
  474. jobListObject.output.encryption.type = encryptionNode["Type"].asString();
  475. if(!encryptionNode["Id"].isNull())
  476. jobListObject.output.encryption.id = encryptionNode["Id"].asString();
  477. if(!encryptionNode["Key"].isNull())
  478. jobListObject.output.encryption.key = encryptionNode["Key"].asString();
  479. if(!encryptionNode["KeyUri"].isNull())
  480. jobListObject.output.encryption.keyUri = encryptionNode["KeyUri"].asString();
  481. if(!encryptionNode["KeyType"].isNull())
  482. jobListObject.output.encryption.keyType = encryptionNode["KeyType"].asString();
  483. if(!encryptionNode["SkipCnt"].isNull())
  484. jobListObject.output.encryption.skipCnt = encryptionNode["SkipCnt"].asString();
  485. auto mNSMessageResultNode = value["MNSMessageResult"];
  486. if(!mNSMessageResultNode["MessageId"].isNull())
  487. jobListObject.mNSMessageResult.messageId = mNSMessageResultNode["MessageId"].asString();
  488. if(!mNSMessageResultNode["ErrorMessage"].isNull())
  489. jobListObject.mNSMessageResult.errorMessage = mNSMessageResultNode["ErrorMessage"].asString();
  490. if(!mNSMessageResultNode["ErrorCode"].isNull())
  491. jobListObject.mNSMessageResult.errorCode = mNSMessageResultNode["ErrorCode"].asString();
  492. jobList_.push_back(jobListObject);
  493. }
  494. auto allNonExistJobIds = value["NonExistJobIds"]["String"];
  495. for (const auto &item : allNonExistJobIds)
  496. nonExistJobIds_.push_back(item.asString());
  497. }
  498. std::vector<std::string> QueryJobListResult::getNonExistJobIds()const
  499. {
  500. return nonExistJobIds_;
  501. }
  502. std::vector<QueryJobListResult::Job> QueryJobListResult::getJobList()const
  503. {
  504. return jobList_;
  505. }