Use ';' to escape '/' characters in path to dumped received video stream

Currently used ':' is bad because it prevents from specifying absolute
path on windows (e.g. "C:\directory").

Now to specify path on windows, it can be passed unchanged in field trial:
"WebRTC-DecoderDataDumpDirectory/C:\path\on\windows/"

On linux ';' has to be used instead of '/':
"WebRTC-DecoderDataDumpDirectory/;path;on;linux/"

Bug: none
Change-Id: Ia46c94bdfab95385618dde4fd3f2857e9ddf2d1c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138832
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28085}
This commit is contained in:
Ilya Nikolaevskiy 2019-05-28 12:58:28 +02:00 committed by Commit Bot
parent 4ffed7ca67
commit 9a57350c6b

View File

@ -348,9 +348,13 @@ void VideoReceiveStream::Start() {
std::string decoded_output_file =
field_trial::FindFullName("WebRTC-DecoderDataDumpDirectory");
// Because '/' can't be used inside a field trial parameter, we use ':'
// Because '/' can't be used inside a field trial parameter, we use ';'
// instead.
absl::c_replace(decoded_output_file, ':', '/');
// This is only relevant to WebRTC-DecoderDataDumpDirectory
// field trial. ';' is chosen arbitrary. Even though it's a legal character
// in some file systems, we can sacrifice ability to use it in the path to
// dumped video, since it's developers-only feature for debugging.
absl::c_replace(decoded_output_file, ';', '/');
if (!decoded_output_file.empty()) {
char filename_buffer[256];
rtc::SimpleStringBuilder ssb(filename_buffer);