Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / rtp_rtcp / source / rtp_receiver_video.h
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   explicit RTPReceiverVideo(RtpData* data_callback);
26
27   virtual ~RTPReceiverVideo();
28
29   virtual int32_t ParseRtpPacket(WebRtcRTPHeader* rtp_header,
30                                  const PayloadUnion& specific_payload,
31                                  bool is_red,
32                                  const uint8_t* packet,
33                                  uint16_t packet_length,
34                                  int64_t timestamp,
35                                  bool is_first_packet) OVERRIDE;
36
37   TelephoneEventHandler* GetTelephoneEventHandler() { return NULL; }
38
39   int GetPayloadTypeFrequency() const OVERRIDE;
40
41   virtual RTPAliveType ProcessDeadOrAlive(
42       uint16_t last_payload_length) const OVERRIDE;
43
44   virtual bool ShouldReportCsrcChanges(uint8_t payload_type) const OVERRIDE;
45
46   virtual int32_t OnNewPayloadTypeCreated(
47       const char payload_name[RTP_PAYLOAD_NAME_SIZE],
48       int8_t payload_type,
49       uint32_t frequency) OVERRIDE;
50
51   virtual int32_t InvokeOnInitializeDecoder(
52       RtpFeedback* callback,
53       int32_t id,
54       int8_t payload_type,
55       const char payload_name[RTP_PAYLOAD_NAME_SIZE],
56       const PayloadUnion& specific_payload) const OVERRIDE;
57
58   void SetPacketOverHead(uint16_t packet_over_head);
59
60  private:
61   int32_t BuildRTPheader(const WebRtcRTPHeader* rtp_header,
62                          uint8_t* data_buffer) const;
63 };
64 }  // namespace webrtc
65
66 #endif  // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_VIDEO_H_