webrtc_m130/api/rtc_event_log/rtc_event_log.h
Danil Chapovalov 678607501c Revert "Comment unused variables in implemented functions"
This reverts commit 05043e1cef47f33e81bc7ba83b4cc2c407111397.

Reason for revert: breaks compilation of .c files

Original change's description:
> Comment unused variables in implemented functions
>
> Compiling webrtc with `-Werror=unused-parameters` is failling duo to
> those parameters.
> Also, it shouldn't harm us to put those in comment for code readability as
> well.
>
> Bug: webrtc:370878648
> Change-Id: I0ab2eafd26e46312e4595f302b92006c9e23d5d2
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364340
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43157}

Bug: webrtc:370878648
Change-Id: I4ea50baa2c3d0d162759c8255171e95c6199ed26
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364580
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Owners-Override: Danil Chapovalov <danilchap@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43162}
2024-10-03 11:51:29 +00:00

69 lines
2.3 KiB
C++

/*
* Copyright (c) 2015 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 API_RTC_EVENT_LOG_RTC_EVENT_LOG_H_
#define API_RTC_EVENT_LOG_RTC_EVENT_LOG_H_
#include <cstddef>
#include <cstdint>
#include <functional>
#include <memory>
#include "api/rtc_event_log/rtc_event.h"
#include "api/rtc_event_log_output.h"
namespace webrtc {
class RtcEventLog {
public:
enum : size_t { kUnlimitedOutput = 0 };
enum : int64_t { kImmediateOutput = 0 };
// TODO(eladalon): Get rid of the legacy encoding and this enum once all
// clients have migrated to the new format.
enum class EncodingType { Legacy, NewFormat, ProtoFree };
virtual ~RtcEventLog() = default;
// Starts logging to a given output. The output might be limited in size,
// and may close itself once it has reached the maximum size.
virtual bool StartLogging(std::unique_ptr<RtcEventLogOutput> output,
int64_t output_period_ms) = 0;
// Stops logging to file and waits until the file has been closed, after
// which it would be permissible to read and/or modify it.
virtual void StopLogging() = 0;
// Stops logging to file and calls `callback` when the file has been closed.
// Note that it is not safe to call any other members, including the
// destructor, until the callback has been called.
// TODO(srte): Remove default implementation when it's safe to do so.
virtual void StopLogging(std::function<void()> callback) {
StopLogging();
callback();
}
// Log an RTC event (the type of event is determined by the subclass).
virtual void Log(std::unique_ptr<RtcEvent> event) = 0;
};
// No-op implementation is used if flag is not set, or in tests.
class RtcEventLogNull final : public RtcEventLog {
public:
bool StartLogging(std::unique_ptr<RtcEventLogOutput> output,
int64_t output_period_ms) override;
void StopLogging() override {}
void Log(std::unique_ptr<RtcEvent> event) override {}
};
} // namespace webrtc
#endif // API_RTC_EVENT_LOG_RTC_EVENT_LOG_H_