niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
| 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.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 12 | // - External encryption and decryption. |
| 13 | |
mflodman@webrtc.org | d5a4d9b | 2012-01-02 13:04:05 +0000 | [diff] [blame] | 14 | #ifndef WEBRTC_VIDEO_ENGINE_INCLUDE_VIE_ENCRYPTION_H_ |
| 15 | #define WEBRTC_VIDEO_ENGINE_INCLUDE_VIE_ENCRYPTION_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 16 | |
| 17 | #include "common_types.h" |
| 18 | |
mflodman@webrtc.org | d5a4d9b | 2012-01-02 13:04:05 +0000 | [diff] [blame] | 19 | namespace webrtc { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 20 | class VideoEngine; |
| 21 | |
mflodman@webrtc.org | d5a4d9b | 2012-01-02 13:04:05 +0000 | [diff] [blame] | 22 | class 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.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 28 | |
mflodman@webrtc.org | d5a4d9b | 2012-01-02 13:04:05 +0000 | [diff] [blame] | 29 | // 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.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 34 | |
mflodman@webrtc.org | d5a4d9b | 2012-01-02 13:04:05 +0000 | [diff] [blame] | 35 | // 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.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 39 | |
mflodman@webrtc.org | d5a4d9b | 2012-01-02 13:04:05 +0000 | [diff] [blame] | 40 | // This function deregisters a registered encryption derived instance |
| 41 | // and disables external encryption. |
| 42 | virtual int DeregisterExternalEncryption(const int video_channel) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 43 | |
mflodman@webrtc.org | d5a4d9b | 2012-01-02 13:04:05 +0000 | [diff] [blame] | 44 | protected: |
| 45 | ViEEncryption() {} |
| 46 | virtual ~ViEEncryption() {} |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 47 | }; |
mflodman@webrtc.org | d5a4d9b | 2012-01-02 13:04:05 +0000 | [diff] [blame] | 48 | |
| 49 | } // namespace webrtc |
| 50 | |
| 51 | #endif // WEBRTC_VIDEO_ENGINE_INCLUDE_VIE_ENCRYPTION_H_ |