• Home
  • Raw
  • Download

Lines Matching refs:root

208 bool AudioConstraints::ParseAndValidate(const Json::Value& root,  in ParseAndValidate()  argument
210 if (!json::ParseAndValidateInt(root[kMaxSampleRate], in ParseAndValidate()
212 !json::ParseAndValidateInt(root[kMaxChannels], &(out->max_channels)) || in ParseAndValidate()
213 !json::ParseAndValidateInt(root[kMaxBitRate], &(out->max_bit_rate))) { in ParseAndValidate()
218 if (json::ParseAndValidateMilliseconds(root[kMaxDelay], &max_delay)) { in ParseAndValidate()
222 if (!json::ParseAndValidateInt(root[kMinBitRate], &(out->min_bit_rate))) { in ParseAndValidate()
230 Json::Value root; in ToJson() local
231 root[kMaxSampleRate] = max_sample_rate; in ToJson()
232 root[kMaxChannels] = max_channels; in ToJson()
233 root[kMinBitRate] = min_bit_rate; in ToJson()
234 root[kMaxBitRate] = max_bit_rate; in ToJson()
236 root[kMaxDelay] = Json::Value::Int64(max_delay->count()); in ToJson()
238 return root; in ToJson()
246 bool Dimensions::ParseAndValidate(const Json::Value& root, Dimensions* out) { in ParseAndValidate() argument
247 if (!json::ParseAndValidateInt(root[kWidth], &(out->width)) || in ParseAndValidate()
248 !json::ParseAndValidateInt(root[kHeight], &(out->height)) || in ParseAndValidate()
249 !json::ParseAndValidateSimpleFraction(root[kFrameRate], in ParseAndValidate()
262 Json::Value root; in ToJson() local
263 root[kWidth] = width; in ToJson()
264 root[kHeight] = height; in ToJson()
265 root[kFrameRate] = frame_rate.ToString(); in ToJson()
266 return root; in ToJson()
270 bool VideoConstraints::ParseAndValidate(const Json::Value& root, in ParseAndValidate() argument
272 if (!Dimensions::ParseAndValidate(root[kMaxDimensions], in ParseAndValidate()
274 !json::ParseAndValidateInt(root[kMaxBitRate], &(out->max_bit_rate)) || in ParseAndValidate()
275 !ParseOptional<Dimensions>(root[kMinDimensions], in ParseAndValidate()
281 if (json::ParseAndValidateMilliseconds(root[kMaxDelay], &max_delay)) { in ParseAndValidate()
286 if (json::ParseAndValidateDouble(root[kMaxPixelsPerSecond], in ParseAndValidate()
291 if (!json::ParseAndValidateInt(root[kMinBitRate], &(out->min_bit_rate))) { in ParseAndValidate()
308 Json::Value root; in ToJson() local
309 root[kMaxDimensions] = max_dimensions.ToJson(); in ToJson()
310 root[kMinBitRate] = min_bit_rate; in ToJson()
311 root[kMaxBitRate] = max_bit_rate; in ToJson()
313 root[kMaxPixelsPerSecond] = max_pixels_per_second.value(); in ToJson()
317 root[kMinDimensions] = min_dimensions->ToJson(); in ToJson()
321 root[kMaxDelay] = Json::Value::Int64(max_delay->count()); in ToJson()
323 return root; in ToJson()
327 bool Constraints::ParseAndValidate(const Json::Value& root, Constraints* out) { in ParseAndValidate() argument
328 if (!AudioConstraints::ParseAndValidate(root[kAudio], &(out->audio)) || in ParseAndValidate()
329 !VideoConstraints::ParseAndValidate(root[kVideo], &(out->video))) { in ParseAndValidate()
341 Json::Value root; in ToJson() local
342 root[kAudio] = audio.ToJson(); in ToJson()
343 root[kVideo] = video.ToJson(); in ToJson()
344 return root; in ToJson()
348 bool DisplayDescription::ParseAndValidate(const Json::Value& root, in ParseAndValidate() argument
350 if (!ParseOptional<Dimensions>(root[kDimensions], &(out->dimensions)) || in ParseAndValidate()
351 !ParseOptional<AspectRatio>(root[kAspectRatio], &(out->aspect_ratio))) { in ParseAndValidate()
356 if (AspectRatioConstraintParseAndValidate(root[kScaling], &constraint)) { in ParseAndValidate()
390 Json::Value root; in ToJson() local
392 root[kAspectRatio] = absl::StrCat( in ToJson()
396 root[kDimensions] = dimensions->ToJson(); in ToJson()
399 root[kScaling] = in ToJson()
402 return root; in ToJson()
405 bool Answer::ParseAndValidate(const Json::Value& root, Answer* out) { in ParseAndValidate() argument
406 if (!json::ParseAndValidateInt(root[kUdpPort], &(out->udp_port)) || in ParseAndValidate()
407 !json::ParseAndValidateIntArray(root[kSendIndexes], in ParseAndValidate()
409 !json::ParseAndValidateUintArray(root[kSsrcs], &(out->ssrcs)) || in ParseAndValidate()
410 !ParseOptional<Constraints>(root[kConstraints], &(out->constraints)) || in ParseAndValidate()
411 !ParseOptional<DisplayDescription>(root[kDisplay], &(out->display))) { in ParseAndValidate()
414 if (!json::ParseBool(root[kReceiverGetStatus], in ParseAndValidate()
421 json::ParseAndValidateIntArray(root[kReceiverRtcpEventLog], in ParseAndValidate()
423 json::ParseAndValidateIntArray(root[kReceiverRtcpDscp], in ParseAndValidate()
425 json::ParseAndValidateStringArray(root[kRtpExtensions], in ParseAndValidate()
454 Json::Value root; in ToJson() local
456 root[kConstraints] = constraints->ToJson(); in ToJson()
459 root[kDisplay] = display->ToJson(); in ToJson()
461 root[kUdpPort] = udp_port; in ToJson()
462 root[kReceiverGetStatus] = supports_wifi_status_reporting; in ToJson()
463 root[kSendIndexes] = PrimitiveVectorToJson(send_indexes); in ToJson()
464 root[kSsrcs] = PrimitiveVectorToJson(ssrcs); in ToJson()
468 root[kReceiverRtcpEventLog] = in ToJson()
472 root[kReceiverRtcpDscp] = PrimitiveVectorToJson(receiver_rtcp_dscp); in ToJson()
475 root[kRtpExtensions] = PrimitiveVectorToJson(rtp_extensions); in ToJson()
477 return root; in ToJson()