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 // ViESender is responsible for sending packets to network. 12 13 #ifndef WEBRTC_VIDEO_ENGINE_VIE_SENDER_H_ 14 #define WEBRTC_VIDEO_ENGINE_VIE_SENDER_H_ 15 16 #include "webrtc/common_types.h" 17 #include "webrtc/engine_configurations.h" 18 #include "webrtc/system_wrappers/interface/scoped_ptr.h" 19 #include "webrtc/typedefs.h" 20 #include "webrtc/video_engine/vie_defines.h" 21 22 namespace webrtc { 23 24 class CriticalSectionWrapper; 25 class RtpDump; 26 class Transport; 27 class VideoCodingModule; 28 29 class ViESender: public Transport { 30 public: 31 explicit ViESender(const int32_t channel_id); 32 ~ViESender(); 33 34 // Registers transport to use for sending RTP and RTCP. 35 int RegisterSendTransport(Transport* transport); 36 int DeregisterSendTransport(); 37 38 // Stores all incoming packets to file. 39 int StartRTPDump(const char file_nameUTF8[1024]); 40 int StopRTPDump(); 41 42 // Implements Transport. 43 virtual int SendPacket(int vie_id, const void* data, int len); 44 virtual int SendRTCPPacket(int vie_id, const void* data, int len); 45 46 private: 47 const int32_t channel_id_; 48 49 scoped_ptr<CriticalSectionWrapper> critsect_; 50 51 Transport* transport_; 52 RtpDump* rtp_dump_; 53 }; 54 55 } // namespace webrtc 56 57 #endif // WEBRTC_VIDEO_ENGINE_VIE_SENDER_H_ 58