chromium/chrome/browser/media/webrtc/webrtc_rtp_dump_writer.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/media/webrtc/webrtc_rtp_dump_writer.h"

#include <string.h>

#include "base/containers/extend.h"
#include "base/containers/span.h"
#include "base/containers/span_writer.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/numerics/byte_conversions.h"
#include "base/task/thread_pool.h"
#include "content/public/browser/browser_thread.h"
#include "third_party/zlib/zlib.h"

namespace {

static const size_t kMinimumGzipOutputBufferSize =;  // In bytes.

const char kRtpDumpFileHeaderFirstLine[] =;
static const size_t kRtpDumpFileHeaderSize =;  // In bytes.

// A helper for writing the header of the dump file.
void WriteRtpDumpFileHeaderBigEndian(base::TimeTicks start,
                                     std::vector<uint8_t>* output) {}

// The header size for each packet dump.
static const size_t kPacketDumpHeaderSize =;  // In bytes.

// A helper for writing the header for each packet dump.
// |start| is the time when the recording is started.
// |dump_length| is the length of the packet dump including this header.
// |packet_length| is the length of the RTP packet header.
void WritePacketDumpHeaderBigEndian(const base::TimeTicks& start,
                                    uint16_t dump_length,
                                    uint16_t packet_length,
                                    std::vector<uint8_t>* output) {}

}  // namespace

// This class runs on the backround task runner, compresses and writes the
// dump buffer to disk.
class WebRtcRtpDumpWriter::FileWorker {};

WebRtcRtpDumpWriter::WebRtcRtpDumpWriter(
    const base::FilePath& incoming_dump_path,
    const base::FilePath& outgoing_dump_path,
    size_t max_dump_size,
    base::RepeatingClosure max_dump_size_reached_callback)
    :{}

WebRtcRtpDumpWriter::~WebRtcRtpDumpWriter() {}

void WebRtcRtpDumpWriter::WriteRtpPacket(const uint8_t* packet_header,
                                         size_t header_length,
                                         size_t packet_length,
                                         bool incoming) {}

void WebRtcRtpDumpWriter::EndDump(RtpDumpType type,
                                  EndDumpCallback finished_callback) {}

size_t WebRtcRtpDumpWriter::max_dump_size() const {}

WebRtcRtpDumpWriter::EndDumpContext::EndDumpContext(RtpDumpType type,
                                                    EndDumpCallback callback)
    :{}

WebRtcRtpDumpWriter::EndDumpContext::EndDumpContext(EndDumpContext&& other) =
    default;

WebRtcRtpDumpWriter::EndDumpContext::~EndDumpContext() = default;

void WebRtcRtpDumpWriter::FlushBuffer(bool incoming,
                                      bool end_stream,
                                      FlushDoneCallback callback) {}

void WebRtcRtpDumpWriter::OnFlushDone(
    FlushDoneCallback callback,
    const std::unique_ptr<FlushResult>& result,
    const std::unique_ptr<size_t>& bytes_written) {}

void WebRtcRtpDumpWriter::OnDumpEnded(EndDumpContext context,
                                      bool incoming,
                                      bool success) {}