Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / video_engine / vie_base_impl.h
1 /*
2  *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3  *
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
11 #ifndef WEBRTC_VIDEO_ENGINE_VIE_BASE_IMPL_H_
12 #define WEBRTC_VIDEO_ENGINE_VIE_BASE_IMPL_H_
13
14 #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"
18
19 namespace webrtc {
20
21 class Config;
22 class Module;
23 class VoiceEngine;
24
25 class ViEBaseImpl
26     : public ViEBase,
27       public ViERefCount {
28  public:
29   virtual int Release();
30
31   // Implements ViEBase.
32   virtual int Init();
33   virtual int SetVoiceEngine(VoiceEngine* voice_engine);
34   virtual int RegisterCpuOveruseObserver(int channel,
35                                          CpuOveruseObserver* observer);
36   virtual int CpuOveruseMeasures(int channel,
37                                  int* capture_jitter_ms,
38                                  int* avg_encode_time_ms,
39                                  int* encode_usage_percent,
40                                  int* capture_queue_delay_ms_per_s);
41   virtual int CreateChannel(int& video_channel);  // NOLINT
42   virtual int CreateChannel(int& video_channel,  // NOLINT
43                             const Config* config);
44   virtual int CreateChannel(int& video_channel,  // NOLINT
45                             int original_channel);
46   virtual int CreateReceiveChannel(int& video_channel,  // NOLINT
47                                    int original_channel);
48   virtual int DeleteChannel(const int video_channel);
49   virtual int ConnectAudioChannel(const int video_channel,
50                                   const int audio_channel);
51   virtual int DisconnectAudioChannel(const int video_channel);
52   virtual int StartSend(const int video_channel);
53   virtual int StopSend(const int video_channel);
54   virtual int StartReceive(const int video_channel);
55   virtual int StopReceive(const int video_channel);
56   virtual int GetVersion(char version[1024]);
57   virtual int LastError();
58
59  protected:
60   explicit ViEBaseImpl(const Config& config);
61   virtual ~ViEBaseImpl();
62
63   ViESharedData* shared_data() { return &shared_data_; }
64
65  private:
66   // Version functions.
67   int32_t AddViEVersion(char* str) const;
68   int32_t AddBuildInfo(char* str) const;
69   int32_t AddExternalTransportBuild(char* str) const;
70
71   int CreateChannel(int& video_channel, int original_channel,  // NOLINT
72                     bool sender);
73
74   // ViEBaseImpl owns ViESharedData used by all interface implementations.
75   ViESharedData shared_data_;
76 };
77
78 }  // namespace webrtc
79
80 #endif  // WEBRTC_VIDEO_ENGINE_VIE_BASE_IMPL_H_