• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 SetCpuOveruseOptions(int channel,
37                                    const CpuOveruseOptions& options);
38   virtual int GetCpuOveruseMetrics(int channel,
39                                    CpuOveruseMetrics* metrics);
40   virtual int CpuOveruseMeasures(int channel,
41                                  int* capture_jitter_ms,
42                                  int* avg_encode_time_ms,
43                                  int* encode_usage_percent,
44                                  int* capture_queue_delay_ms_per_s);
45   virtual int CreateChannel(int& video_channel);  // NOLINT
46   virtual int CreateChannel(int& video_channel,  // NOLINT
47                             const Config* config);
48   virtual int CreateChannel(int& video_channel,  // NOLINT
49                             int original_channel);
50   virtual int CreateReceiveChannel(int& video_channel,  // NOLINT
51                                    int original_channel);
52   virtual int DeleteChannel(const int video_channel);
53   virtual int ConnectAudioChannel(const int video_channel,
54                                   const int audio_channel);
55   virtual int DisconnectAudioChannel(const int video_channel);
56   virtual int StartSend(const int video_channel);
57   virtual int StopSend(const int video_channel);
58   virtual int StartReceive(const int video_channel);
59   virtual int StopReceive(const int video_channel);
60   virtual int GetVersion(char version[1024]);
61   virtual int LastError();
62 
63  protected:
64   explicit ViEBaseImpl(const Config& config);
65   virtual ~ViEBaseImpl();
66 
shared_data()67   ViESharedData* shared_data() { return &shared_data_; }
68 
69  private:
70   // Version functions.
71   int32_t AddViEVersion(char* str) const;
72   int32_t AddBuildInfo(char* str) const;
73   int32_t AddExternalTransportBuild(char* str) const;
74 
75   int CreateChannel(int& video_channel, int original_channel,  // NOLINT
76                     bool sender);
77 
78   // ViEBaseImpl owns ViESharedData used by all interface implementations.
79   ViESharedData shared_data_;
80 };
81 
82 }  // namespace webrtc
83 
84 #endif  // WEBRTC_VIDEO_ENGINE_VIE_BASE_IMPL_H_
85