Files
platform-external-webrtc/webrtc/modules/audio_coding/main/acm2/acm_dump.h
Ivo Creusen 747d5f6268 Reland "Added ACM_dump protobuf, class for reading/writing and...", commit e9bdfd859c309991b4ea759587f39eecdbd42bd4.
Changed the BUILD.gn file that was lacking some necessary items which caused Chromium to break.
Original review: https://webrtc-codereview.appspot.com/52059005/

The revert of the original CL was commit 7a75415419cbd52d798f9226010e9190e1cbad53.

BUG=webrtc:4741
R=henrik.lundin@webrtc.org

Review URL: https://codereview.webrtc.org/1200833002.

Cr-Commit-Position: refs/heads/master@{#9489}
2015-06-23 08:08:17 +00:00

60 lines
2.0 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 WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_DUMP_H_
#define WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_DUMP_H_
#include <string>
#include "webrtc/base/scoped_ptr.h"
namespace webrtc {
// Forward declaration of storage class that is automatically generated from
// the protobuf file.
class ACMDumpEventStream;
class AcmDumpImpl;
class AcmDump {
public:
// The types of debug events that are currently supported for logging.
enum class DebugEvent { kLogStart, kLogEnd, kAudioPlayout };
virtual ~AcmDump() {}
static rtc::scoped_ptr<AcmDump> Create();
// Starts logging for the specified duration to the specified file.
// The logging will stop automatically after the specified duration.
// If the file already exists it will be overwritten.
// The function will return false on failure.
virtual void StartLogging(const std::string& file_name, int duration_ms) = 0;
// Logs an incoming or outgoing RTP packet.
virtual void LogRtpPacket(bool incoming,
const uint8_t* packet,
size_t length) = 0;
// Logs a debug event, with optional message.
virtual void LogDebugEvent(DebugEvent event_type,
const std::string& event_message) = 0;
virtual void LogDebugEvent(DebugEvent event_type) = 0;
// Reads an AcmDump file and returns true when reading was successful.
// The result is stored in the given ACMDumpEventStream object.
static bool ParseAcmDump(const std::string& file_name,
ACMDumpEventStream* result);
};
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_DUMP_H_