blob: 2fd543a632e144741b5f5bc83e792771ad28af04 [file] [log] [blame]
Markus Handell411639e2023-08-22 10:58:471/*
2 * Copyright (c) 2023 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef VIDEO_FRAME_DUMPING_ENCODER_H_
12#define VIDEO_FRAME_DUMPING_ENCODER_H_
13
14#include <memory>
15
16#include "api/field_trials_view.h"
17#include "api/video_codecs/video_encoder.h"
18
19namespace webrtc {
20
21// Creates an encoder that wraps another passed encoder and dumps its encoded
22// frames out into a unique IVF file into the directory specified by the
23// "WebRTC-EncoderDataDumpDirectory" field trial. Each file generated is
24// suffixed by the simulcast index of the encoded frames. If the passed encoder
25// is nullptr, or the field trial is not setup, the function just returns the
26// passed encoder. The directory specified by the field trial parameter should
27// be delimited by ';'.
28std::unique_ptr<VideoEncoder> MaybeCreateFrameDumpingEncoderWrapper(
29 std::unique_ptr<VideoEncoder> encoder,
30 const FieldTrialsView& field_trials);
31
32} // namespace webrtc
33
34#endif // VIDEO_FRAME_DUMPING_ENCODER_H_