blob: d6a046e608e0b3bc5194940f50a59ae95128560a [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
mflodman@webrtc.org9ec883e2012-03-05 17:12:41 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
mflodman@webrtc.orge06ca3c2012-06-29 13:20:14 +000011#ifndef WEBRTC_VIDEO_ENGINE_VIE_BASE_IMPL_H_
12#define WEBRTC_VIDEO_ENGINE_VIE_BASE_IMPL_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013
pbos@webrtc.orgf5d4cb12013-05-17 13:44:48 +000014#include "webrtc/video_engine/include/vie_base.h"
15#include "webrtc/video_engine/vie_defines.h"
16#include "webrtc/video_engine/vie_ref_count.h"
17#include "webrtc/video_engine/vie_shared_data.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000018
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000019namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000020
andresp@webrtc.org7707d062013-05-13 10:50:50 +000021class Config;
niklase@google.com470e71d2011-07-07 08:21:25 +000022class Module;
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000023class VoiceEngine;
niklase@google.com470e71d2011-07-07 08:21:25 +000024
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000025class ViEBaseImpl
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000026 : public ViEBase,
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000027 public ViERefCount {
28 public:
29 virtual int Release();
niklase@google.com470e71d2011-07-07 08:21:25 +000030
mflodman@webrtc.org9ec883e2012-03-05 17:12:41 +000031 // Implements ViEBase.
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000032 virtual int Init();
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000033 virtual int SetVoiceEngine(VoiceEngine* voice_engine);
mflodman@webrtc.org6879c8a2013-07-23 11:35:00 +000034 virtual int RegisterCpuOveruseObserver(int channel,
35 CpuOveruseObserver* observer);
asapersson@webrtc.org8a8c3ef2014-03-20 13:15:01 +000036 virtual int SetCpuOveruseOptions(int channel,
37 const CpuOveruseOptions& options);
asapersson@webrtc.orgab6bf4f2014-05-27 07:43:15 +000038 virtual int GetCpuOveruseMetrics(int channel,
39 CpuOveruseMetrics* metrics);
asapersson@webrtc.orgc7ff8f92013-11-26 11:12:33 +000040 virtual int CpuOveruseMeasures(int channel,
41 int* capture_jitter_ms,
asapersson@webrtc.org9e5b0342013-12-04 13:47:44 +000042 int* avg_encode_time_ms,
43 int* encode_usage_percent,
44 int* capture_queue_delay_ms_per_s);
mflodman@webrtc.org9ba151b2012-06-21 10:02:13 +000045 virtual int CreateChannel(int& video_channel); // NOLINT
46 virtual int CreateChannel(int& video_channel, // NOLINT
henrik.lundin@webrtc.org41907742014-01-29 08:47:15 +000047 const Config* config);
48 virtual int CreateChannel(int& video_channel, // NOLINT
mflodman@webrtc.org9ba151b2012-06-21 10:02:13 +000049 int original_channel);
50 virtual int CreateReceiveChannel(int& video_channel, // NOLINT
51 int original_channel);
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000052 virtual int DeleteChannel(const int video_channel);
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000053 virtual int ConnectAudioChannel(const int video_channel,
54 const int audio_channel);
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000055 virtual int DisconnectAudioChannel(const int video_channel);
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000056 virtual int StartSend(const int video_channel);
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000057 virtual int StopSend(const int video_channel);
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000058 virtual int StartReceive(const int video_channel);
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000059 virtual int StopReceive(const int video_channel);
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000060 virtual int GetVersion(char version[1024]);
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000061 virtual int LastError();
niklase@google.com470e71d2011-07-07 08:21:25 +000062
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000063 protected:
mflodman@webrtc.org6879c8a2013-07-23 11:35:00 +000064 explicit ViEBaseImpl(const Config& config);
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000065 virtual ~ViEBaseImpl();
niklase@google.com470e71d2011-07-07 08:21:25 +000066
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000067 ViESharedData* shared_data() { return &shared_data_; }
68
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000069 private:
70 // Version functions.
pbos@webrtc.orgb238d122013-04-09 13:41:51 +000071 int32_t AddViEVersion(char* str) const;
72 int32_t AddBuildInfo(char* str) const;
73 int32_t AddExternalTransportBuild(char* str) const;
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000074
mflodman@webrtc.org9ba151b2012-06-21 10:02:13 +000075 int CreateChannel(int& video_channel, int original_channel, // NOLINT
76 bool sender);
mflodman@webrtc.org9ec883e2012-03-05 17:12:41 +000077
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000078 // ViEBaseImpl owns ViESharedData used by all interface implementations.
79 ViESharedData shared_data_;
niklase@google.com470e71d2011-07-07 08:21:25 +000080};
81
mflodman@webrtc.org27a82a62011-11-30 18:04:26 +000082} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000083
mflodman@webrtc.orge06ca3c2012-06-29 13:20:14 +000084#endif // WEBRTC_VIDEO_ENGINE_VIE_BASE_IMPL_H_