summaryrefslogtreecommitdiff
path: root/voice_engine/include/voe_call_report.h
blob: de2c77818511c3573d42cb26b90f1dd2583dba06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
 *  Copyright (c) 2012 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.
 */

// This sub-API supports the following functionalities:
//
//  - Long-term speech and noise level metrics.
//  - Long-term echo metric statistics.
//  - Round Trip Time (RTT) statistics.
//  - Dead-or-Alive connection summary.
//  - Generation of call reports to text files.
//
// Usage example, omitting error checking:
//
//  using namespace webrtc;
//  VoiceEngine* voe = VoiceEngine::Create();
//  VoEBase* base = VoEBase::GetInterface(voe);
//  VoECallReport report = VoECallReport::GetInterface(voe);
//  base->Init();
//  LevelStatistics stats;
//  report->GetSpeechAndNoiseSummary(stats);
//  ...
//  base->Terminate();
//  base->Release();
//  report->Release();
//  VoiceEngine::Delete(voe);
//
#ifndef WEBRTC_VOICE_ENGINE_VOE_CALL_REPORT_H
#define WEBRTC_VOICE_ENGINE_VOE_CALL_REPORT_H

#include "webrtc/common_types.h"

namespace webrtc {

class VoiceEngine;

// VoECallReport
class WEBRTC_DLLEXPORT VoECallReport
{
public:
    // Factory for the VoECallReport sub-API. Increases an internal
    // reference counter if successful. Returns NULL if the API is not
    // supported or if construction fails.
    static VoECallReport* GetInterface(VoiceEngine* voiceEngine);

    // Releases the VoECallReport sub-API and decreases an internal
    // reference counter. Returns the new reference count. This value should
    // be zero for all sub-API:s before the VoiceEngine object can be safely
    // deleted.
    virtual int Release() = 0;

    // Performs a combined reset of all components involved in generating
    // the call report for a specified |channel|. Pass in -1 to reset
    // all channels.
    virtual int ResetCallReportStatistics(int channel) = 0;

    // Gets minimum, maximum and average levels for long-term echo metrics.
    virtual int GetEchoMetricSummary(EchoStatistics& stats) = 0;

    // Gets minimum, maximum and average levels for Round Trip Time (RTT)
    // measurements.
    virtual int GetRoundTripTimeSummary(int channel,
                                        StatVal& delaysMs) = 0;

    // Gets the total amount of dead and alive connection detections
    // during a VoIP session.
    virtual int GetDeadOrAliveSummary(int channel, int& numOfDeadDetections,
                                      int& numOfAliveDetections) = 0;

    // Creates a text file in ASCII format, which contains a summary
    // of all the statistics that can be obtained by the call report sub-API.
    virtual int WriteReportToFile(const char* fileNameUTF8) = 0;

protected:
    VoECallReport() { }
    virtual ~VoECallReport() { }
};

}  // namespace webrtc

#endif  //  WEBRTC_VOICE_ENGINE_VOE_CALL_REPORT_H