blob: 8e7c955419a45be42c7805b17d0ab8d3975d3f15 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
2 * Copyright (c) 2011 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// This sub-API supports the following functionalities:
niklase@google.com470e71d2011-07-07 08:21:25 +000012// - External encryption and decryption.
13
mflodman@webrtc.orgd5a4d9b2012-01-02 13:04:05 +000014#ifndef WEBRTC_VIDEO_ENGINE_INCLUDE_VIE_ENCRYPTION_H_
15#define WEBRTC_VIDEO_ENGINE_INCLUDE_VIE_ENCRYPTION_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000016
17#include "common_types.h"
18
mflodman@webrtc.orgd5a4d9b2012-01-02 13:04:05 +000019namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000020class VideoEngine;
21
mflodman@webrtc.orgd5a4d9b2012-01-02 13:04:05 +000022class WEBRTC_DLLEXPORT ViEEncryption {
23 public:
24 // Factory for the ViEEncryption sub‐API and increases an internal reference
25 // counter if successful. Returns NULL if the API is not supported or if
26 // construction fails.
27 static ViEEncryption* GetInterface(VideoEngine* video_engine);
niklase@google.com470e71d2011-07-07 08:21:25 +000028
mflodman@webrtc.orgd5a4d9b2012-01-02 13:04:05 +000029 // Releases the ViEEncryption sub-API and decreases an internal reference
30 // counter.
31 // Returns the new reference count. This value should be zero
32 // for all sub-API:s before the VideoEngine object can be safely deleted.
33 virtual int Release() = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000034
mflodman@webrtc.orgd5a4d9b2012-01-02 13:04:05 +000035 // This function registers a encryption derived instance and enables
36 // external encryption for the specified channel.
37 virtual int RegisterExternalEncryption(const int video_channel,
38 Encryption& encryption) = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000039
mflodman@webrtc.orgd5a4d9b2012-01-02 13:04:05 +000040 // This function deregisters a registered encryption derived instance
41 // and disables external encryption.
42 virtual int DeregisterExternalEncryption(const int video_channel) = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000043
mflodman@webrtc.orgd5a4d9b2012-01-02 13:04:05 +000044 protected:
45 ViEEncryption() {}
46 virtual ~ViEEncryption() {}
niklase@google.com470e71d2011-07-07 08:21:25 +000047};
mflodman@webrtc.orgd5a4d9b2012-01-02 13:04:05 +000048
49} // namespace webrtc
50
51#endif // WEBRTC_VIDEO_ENGINE_INCLUDE_VIE_ENCRYPTION_H_