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 | |
mflodman@webrtc.org | 6d26ef7 | 2011-11-24 08:31:06 +0000 | [diff] [blame] | 11 | // ViESender is responsible for encrypting, if enabled, packets and send to |
| 12 | // network. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | |
mflodman@webrtc.org | 6d26ef7 | 2011-11-24 08:31:06 +0000 | [diff] [blame] | 14 | #ifndef WEBRTC_VIDEO_ENGINE_VIE_SENDER_H_ |
| 15 | #define WEBRTC_VIDEO_ENGINE_VIE_SENDER_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 16 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 17 | #include "common_types.h" |
mflodman@webrtc.org | 6d26ef7 | 2011-11-24 08:31:06 +0000 | [diff] [blame] | 18 | #include "engine_configurations.h" |
mflodman@webrtc.org | d32c447 | 2011-12-22 14:17:53 +0000 | [diff] [blame] | 19 | #include "system_wrappers/interface/scoped_ptr.h" |
mflodman@webrtc.org | 6d26ef7 | 2011-11-24 08:31:06 +0000 | [diff] [blame] | 20 | #include "typedefs.h" |
| 21 | #include "vie_defines.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 22 | |
| 23 | namespace webrtc { |
mflodman@webrtc.org | 6d26ef7 | 2011-11-24 08:31:06 +0000 | [diff] [blame] | 24 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 25 | class CriticalSectionWrapper; |
| 26 | class RtpDump; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 27 | class Transport; |
| 28 | class VideoCodingModule; |
| 29 | |
mflodman@webrtc.org | 6d26ef7 | 2011-11-24 08:31:06 +0000 | [diff] [blame] | 30 | class ViESender: public Transport { |
| 31 | public: |
| 32 | ViESender(int engine_id, int channel_id); |
| 33 | ~ViESender(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 34 | |
mflodman@webrtc.org | 6d26ef7 | 2011-11-24 08:31:06 +0000 | [diff] [blame] | 35 | // Registers an encryption class to use before sending packets. |
| 36 | int RegisterExternalEncryption(Encryption* encryption); |
| 37 | int DeregisterExternalEncryption(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 38 | |
mflodman@webrtc.org | 6d26ef7 | 2011-11-24 08:31:06 +0000 | [diff] [blame] | 39 | // Registers transport to use for sending RTP and RTCP. |
| 40 | int RegisterSendTransport(Transport* transport); |
| 41 | int DeregisterSendTransport(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 42 | |
mflodman@webrtc.org | 6d26ef7 | 2011-11-24 08:31:06 +0000 | [diff] [blame] | 43 | // Stores all incoming packets to file. |
| 44 | int StartRTPDump(const char file_nameUTF8[1024]); |
| 45 | int StopRTPDump(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 46 | |
mflodman@webrtc.org | 6d26ef7 | 2011-11-24 08:31:06 +0000 | [diff] [blame] | 47 | // Implements Transport. |
| 48 | virtual int SendPacket(int vie_id, const void* data, int len); |
| 49 | virtual int SendRTCPPacket(int vie_id, const void* data, int len); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 50 | |
mflodman@webrtc.org | 6d26ef7 | 2011-11-24 08:31:06 +0000 | [diff] [blame] | 51 | private: |
| 52 | int engine_id_; |
| 53 | int channel_id_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 54 | |
mflodman@webrtc.org | d32c447 | 2011-12-22 14:17:53 +0000 | [diff] [blame] | 55 | scoped_ptr<CriticalSectionWrapper> critsect_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 56 | |
mflodman@webrtc.org | 6d26ef7 | 2011-11-24 08:31:06 +0000 | [diff] [blame] | 57 | Encryption* external_encryption_; |
| 58 | WebRtc_UWord8* encryption_buffer_; |
| 59 | Transport* transport_; |
| 60 | RtpDump* rtp_dump_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 61 | }; |
| 62 | |
mflodman@webrtc.org | 6d26ef7 | 2011-11-24 08:31:06 +0000 | [diff] [blame] | 63 | } // namespace webrtc |
| 64 | |
| 65 | #endif // WEBRTC_VIDEO_ENGINE_VIE_SENDER_H_ |