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 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_VIDEO_H_ 12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_VIDEO_H_ 13 14 #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h" 15 #include "webrtc/modules/rtp_rtcp/source/bitrate.h" 16 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h" 17 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" 18 #include "webrtc/system_wrappers/interface/scoped_ptr.h" 19 #include "webrtc/typedefs.h" 20 21 namespace webrtc { 22 23 class RTPReceiverVideo : public RTPReceiverStrategy { 24 public: 25 RTPReceiverVideo(RtpData* data_callback); 26 27 virtual ~RTPReceiverVideo(); 28 29 virtual int32_t ParseRtpPacket( 30 WebRtcRTPHeader* rtp_header, 31 const PayloadUnion& specific_payload, 32 bool is_red, 33 const uint8_t* packet, 34 uint16_t packet_length, 35 int64_t timestamp, 36 bool is_first_packet) OVERRIDE; 37 GetTelephoneEventHandler()38 TelephoneEventHandler* GetTelephoneEventHandler() { 39 return NULL; 40 } 41 42 int GetPayloadTypeFrequency() const OVERRIDE; 43 44 virtual RTPAliveType ProcessDeadOrAlive(uint16_t last_payload_length) const 45 OVERRIDE; 46 47 virtual bool ShouldReportCsrcChanges(uint8_t payload_type) const OVERRIDE; 48 49 virtual int32_t OnNewPayloadTypeCreated( 50 const char payload_name[RTP_PAYLOAD_NAME_SIZE], 51 int8_t payload_type, 52 uint32_t frequency) OVERRIDE; 53 54 virtual int32_t InvokeOnInitializeDecoder( 55 RtpFeedback* callback, 56 int32_t id, 57 int8_t payload_type, 58 const char payload_name[RTP_PAYLOAD_NAME_SIZE], 59 const PayloadUnion& specific_payload) const OVERRIDE; 60 61 void SetPacketOverHead(uint16_t packet_over_head); 62 63 protected: 64 int32_t ReceiveGenericCodec(WebRtcRTPHeader* rtp_header, 65 const uint8_t* payload_data, 66 uint16_t payload_data_length); 67 68 int32_t ReceiveVp8Codec(WebRtcRTPHeader* rtp_header, 69 const uint8_t* payload_data, 70 uint16_t payload_data_length); 71 72 int32_t BuildRTPheader(const WebRtcRTPHeader* rtp_header, 73 uint8_t* data_buffer) const; 74 75 private: 76 int32_t ParseVideoCodecSpecific( 77 WebRtcRTPHeader* rtp_header, 78 const uint8_t* payload_data, 79 uint16_t payload_data_length, 80 RtpVideoCodecTypes video_type, 81 int64_t now_ms, 82 bool is_first_packet); 83 }; 84 } // namespace webrtc 85 86 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_VIDEO_H_ 87