blob: f43fafd9a897ed4a588131a025511a53aef0adfc [file] [log] [blame]
philipelc707ab72016-04-01 02:01:54 -07001/*
2 * Copyright (c) 2016 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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_VIDEO_CODING_FRAME_OBJECT_H_
12#define MODULES_VIDEO_CODING_FRAME_OBJECT_H_
philipelc707ab72016-04-01 02:01:54 -070013
Danil Chapovalov0040b662018-06-18 10:48:16 +020014#include "absl/types/optional.h"
philipeld5a272f2018-02-21 14:30:34 +010015#include "api/video/encoded_frame.h"
Danil Chapovalovbc1750d2020-02-11 16:53:51 +000016#include "modules/rtp_rtcp/source/rtp_generic_frame_descriptor.h"
Danil Chapovalove209fe62020-02-12 19:25:57 +010017#include "rtc_base/deprecation.h"
philipelc707ab72016-04-01 02:01:54 -070018
19namespace webrtc {
20namespace video_coding {
21
philipele7c891f2018-02-22 14:35:06 +010022class RtpFrameObject : public EncodedFrame {
philipelc707ab72016-04-01 02:01:54 -070023 public:
Danil Chapovalove209fe62020-02-12 19:25:57 +010024 RtpFrameObject(uint16_t first_seq_num,
25 uint16_t last_seq_num,
26 bool markerBit,
27 int times_nacked,
28 int64_t first_packet_received_time,
29 int64_t last_packet_received_time,
30 uint32_t rtp_timestamp,
31 int64_t ntp_time_ms,
32 const VideoSendTiming& timing,
33 uint8_t payload_type,
34 VideoCodecType codec,
35 VideoRotation rotation,
36 VideoContentType content_type,
37 const RTPVideoHeader& video_header,
38 const absl::optional<webrtc::ColorSpace>& color_space,
39 RtpPacketInfos packet_infos,
40 rtc::scoped_refptr<EncodedImageBuffer> image_buffer);
41
42 RTC_DEPRECATED
Danil Chapovalovbc1750d2020-02-11 16:53:51 +000043 RtpFrameObject(
44 uint16_t first_seq_num,
45 uint16_t last_seq_num,
46 bool markerBit,
47 int times_nacked,
48 int64_t first_packet_received_time,
49 int64_t last_packet_received_time,
50 uint32_t rtp_timestamp,
51 int64_t ntp_time_ms,
52 const VideoSendTiming& timing,
53 uint8_t payload_type,
54 VideoCodecType codec,
55 VideoRotation rotation,
56 VideoContentType content_type,
57 const RTPVideoHeader& video_header,
58 const absl::optional<webrtc::ColorSpace>& color_space,
59 const absl::optional<RtpGenericFrameDescriptor>& generic_descriptor,
60 RtpPacketInfos packet_infos,
61 rtc::scoped_refptr<EncodedImageBuffer> image_buffer);
philipel85d5c192019-09-25 17:15:37 +020062
Benjamin Wright00765292018-11-30 16:18:26 -080063 ~RtpFrameObject() override;
philipelf4139332016-04-20 10:26:34 +020064 uint16_t first_seq_num() const;
65 uint16_t last_seq_num() const;
philipel5ceaaae2016-05-24 10:20:47 +020066 int times_nacked() const;
Niels Möller87e2d782019-03-07 10:18:23 +010067 VideoFrameType frame_type() const;
philipel02447bc2016-05-13 06:01:03 -070068 VideoCodecType codec_type() const;
philipelb4d31082016-07-11 08:46:29 -070069 int64_t ReceivedTime() const override;
70 int64_t RenderTime() const override;
philipele0754302017-01-25 08:56:23 -080071 bool delayed_by_retransmission() const override;
Johannes Krona3705562019-08-26 16:37:11 +020072 const RTPVideoHeader& GetRtpVideoHeader() const;
Johannes Krona3705562019-08-26 16:37:11 +020073 const FrameMarking& GetFrameMarking() const;
philipelc707ab72016-04-01 02:01:54 -070074
75 private:
Johannes Krona3705562019-08-26 16:37:11 +020076 RTPVideoHeader rtp_video_header_;
philipel02447bc2016-05-13 06:01:03 -070077 VideoCodecType codec_type_;
78 uint16_t first_seq_num_;
79 uint16_t last_seq_num_;
Ilya Nikolaevskiy4348ce22018-12-07 16:26:56 +010080 int64_t last_packet_received_time_;
philipel5ceaaae2016-05-24 10:20:47 +020081
82 // Equal to times nacked of the packet with the highet times nacked
83 // belonging to this frame.
84 int times_nacked_;
philipelc707ab72016-04-01 02:01:54 -070085};
86
87} // namespace video_coding
88} // namespace webrtc
89
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020090#endif // MODULES_VIDEO_CODING_FRAME_OBJECT_H_