blob: a60446dbdccccae22ee82d974b5b0496dca447a7 [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
mflodman@webrtc.org6d26ef72011-11-24 08:31:06 +000011// ViESender is responsible for encrypting, if enabled, packets and send to
12// network.
niklase@google.com470e71d2011-07-07 08:21:25 +000013
mflodman@webrtc.org6d26ef72011-11-24 08:31:06 +000014#ifndef WEBRTC_VIDEO_ENGINE_VIE_SENDER_H_
15#define WEBRTC_VIDEO_ENGINE_VIE_SENDER_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000016
niklase@google.com470e71d2011-07-07 08:21:25 +000017#include "common_types.h"
mflodman@webrtc.org6d26ef72011-11-24 08:31:06 +000018#include "engine_configurations.h"
mflodman@webrtc.orgd32c4472011-12-22 14:17:53 +000019#include "system_wrappers/interface/scoped_ptr.h"
mflodman@webrtc.org6d26ef72011-11-24 08:31:06 +000020#include "typedefs.h"
21#include "vie_defines.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000022
23namespace webrtc {
mflodman@webrtc.org6d26ef72011-11-24 08:31:06 +000024
niklase@google.com470e71d2011-07-07 08:21:25 +000025class CriticalSectionWrapper;
26class RtpDump;
niklase@google.com470e71d2011-07-07 08:21:25 +000027class Transport;
28class VideoCodingModule;
29
mflodman@webrtc.org6d26ef72011-11-24 08:31:06 +000030class ViESender: public Transport {
31 public:
32 ViESender(int engine_id, int channel_id);
33 ~ViESender();
niklase@google.com470e71d2011-07-07 08:21:25 +000034
mflodman@webrtc.org6d26ef72011-11-24 08:31:06 +000035 // Registers an encryption class to use before sending packets.
36 int RegisterExternalEncryption(Encryption* encryption);
37 int DeregisterExternalEncryption();
niklase@google.com470e71d2011-07-07 08:21:25 +000038
mflodman@webrtc.org6d26ef72011-11-24 08:31:06 +000039 // Registers transport to use for sending RTP and RTCP.
40 int RegisterSendTransport(Transport* transport);
41 int DeregisterSendTransport();
niklase@google.com470e71d2011-07-07 08:21:25 +000042
mflodman@webrtc.org6d26ef72011-11-24 08:31:06 +000043 // Stores all incoming packets to file.
44 int StartRTPDump(const char file_nameUTF8[1024]);
45 int StopRTPDump();
niklase@google.com470e71d2011-07-07 08:21:25 +000046
mflodman@webrtc.org6d26ef72011-11-24 08:31:06 +000047 // 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.com470e71d2011-07-07 08:21:25 +000050
mflodman@webrtc.org6d26ef72011-11-24 08:31:06 +000051 private:
52 int engine_id_;
53 int channel_id_;
niklase@google.com470e71d2011-07-07 08:21:25 +000054
mflodman@webrtc.orgd32c4472011-12-22 14:17:53 +000055 scoped_ptr<CriticalSectionWrapper> critsect_;
niklase@google.com470e71d2011-07-07 08:21:25 +000056
mflodman@webrtc.org6d26ef72011-11-24 08:31:06 +000057 Encryption* external_encryption_;
58 WebRtc_UWord8* encryption_buffer_;
59 Transport* transport_;
60 RtpDump* rtp_dump_;
niklase@google.com470e71d2011-07-07 08:21:25 +000061};
62
mflodman@webrtc.org6d26ef72011-11-24 08:31:06 +000063} // namespace webrtc
64
65#endif // WEBRTC_VIDEO_ENGINE_VIE_SENDER_H_