webrtc/test/call_config_utils.h
Benjamin Wright 9db8b88bd4 Added JSON generator for VideoReceiveStream::Config objects.
This change adds a new way for test code to serialize the important information
from a VideoReceiveStream::Config so that it can be stored as configuration data
for WebRTC fuzzers. This code isn't included in the object itself as it is only
going to be used to generate new configurations for the fuzzer each time a new
error_correction or video format is added to WebRTC.

Bug: webrtc:10117
Change-Id: I9b6fb8e0345890ab16f6d319d91e4e316d1f2888
Reviewed-on: https://webrtc-review.googlesource.com/c/116920
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26255}
2019-01-15 00:51:29 +00:00

33 lines
1.1 KiB
C++

/*
* Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef TEST_CALL_CONFIG_UTILS_H_
#define TEST_CALL_CONFIG_UTILS_H_
#include "call/video_receive_stream.h"
#include "rtc_base/strings/json.h"
namespace webrtc {
namespace test {
// Deserializes a JSON representation of the VideoReceiveStream::Config back
// into a valid object. This will not initialize the decoders or the renderer.
VideoReceiveStream::Config ParseVideoReceiveStreamJsonConfig(
webrtc::Transport* transport,
const Json::Value& json);
// Serialize a VideoReceiveStream::Config into a Json object.
Json::Value GenerateVideoReceiveStreamJsonConfig(
const VideoReceiveStream::Config& config);
} // namespace test
} // namespace webrtc
#endif // TEST_CALL_CONFIG_UTILS_H_