2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
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.
11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_VIDEO_H_
12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_VIDEO_H_
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"
23 class RTPReceiverVideo : public RTPReceiverStrategy {
25 RTPReceiverVideo(RtpData* data_callback);
27 virtual ~RTPReceiverVideo();
29 virtual int32_t ParseRtpPacket(
30 WebRtcRTPHeader* rtp_header,
31 const PayloadUnion& specific_payload,
33 const uint8_t* packet,
34 uint16_t packet_length,
36 bool is_first_packet) OVERRIDE;
38 TelephoneEventHandler* GetTelephoneEventHandler() {
42 int GetPayloadTypeFrequency() const OVERRIDE;
44 virtual RTPAliveType ProcessDeadOrAlive(uint16_t last_payload_length) const
47 virtual bool ShouldReportCsrcChanges(uint8_t payload_type) const OVERRIDE;
49 virtual int32_t OnNewPayloadTypeCreated(
50 const char payload_name[RTP_PAYLOAD_NAME_SIZE],
52 uint32_t frequency) OVERRIDE;
54 virtual int32_t InvokeOnInitializeDecoder(
55 RtpFeedback* callback,
58 const char payload_name[RTP_PAYLOAD_NAME_SIZE],
59 const PayloadUnion& specific_payload) const OVERRIDE;
61 void SetPacketOverHead(uint16_t packet_over_head);
64 int32_t ReceiveGenericCodec(WebRtcRTPHeader* rtp_header,
65 const uint8_t* payload_data,
66 uint16_t payload_data_length);
68 int32_t ReceiveVp8Codec(WebRtcRTPHeader* rtp_header,
69 const uint8_t* payload_data,
70 uint16_t payload_data_length);
72 int32_t ReceiveH264Codec(WebRtcRTPHeader* rtp_header,
73 const uint8_t* payload_data,
74 uint16_t payload_data_length);
76 int32_t BuildRTPheader(const WebRtcRTPHeader* rtp_header,
77 uint8_t* data_buffer) const;
79 int32_t ParseVideoCodecSpecific(
80 WebRtcRTPHeader* rtp_header,
81 const uint8_t* payload_data,
82 uint16_t payload_data_length,
83 RtpVideoCodecTypes video_type,
85 bool is_first_packet);
89 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_VIDEO_H_