#include "chrome/browser/media/webrtc/webrtc_rtp_dump_handler.h"
#include <utility>
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/time/time.h"
#include "chrome/browser/media/webrtc/webrtc_rtp_dump_writer.h"
namespace {
static const size_t kMaxOngoingRtpDumpsAllowed = …;
static size_t g_ongoing_rtp_dumps = …;
void FireGenericDoneCallback(WebRtcRtpDumpHandler::GenericDoneCallback callback,
bool success,
const std::string& error_message) { … }
bool DumpTypeContainsIncoming(RtpDumpType type) { … }
bool DumpTypeContainsOutgoing(RtpDumpType type) { … }
}
WebRtcRtpDumpHandler::WebRtcRtpDumpHandler(const base::FilePath& dump_dir)
: … { … }
WebRtcRtpDumpHandler::~WebRtcRtpDumpHandler() { … }
bool WebRtcRtpDumpHandler::StartDump(RtpDumpType type,
std::string* error_message) { … }
void WebRtcRtpDumpHandler::StopDump(RtpDumpType type,
GenericDoneCallback callback) { … }
bool WebRtcRtpDumpHandler::ReadyToRelease() const { … }
WebRtcRtpDumpHandler::ReleasedDumps WebRtcRtpDumpHandler::ReleaseDumps() { … }
void WebRtcRtpDumpHandler::OnRtpPacket(const uint8_t* packet_header,
size_t header_length,
size_t packet_length,
bool incoming) { … }
void WebRtcRtpDumpHandler::StopOngoingDumps(base::OnceClosure callback) { … }
void WebRtcRtpDumpHandler::SetDumpWriterForTesting(
std::unique_ptr<WebRtcRtpDumpWriter> writer) { … }
void WebRtcRtpDumpHandler::OnMaxDumpSizeReached() { … }
void WebRtcRtpDumpHandler::OnDumpEnded(base::OnceClosure callback,
RtpDumpType ended_type,
bool incoming_success,
bool outgoing_success) { … }