philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 1 | /* |
| 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 Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef MODULES_VIDEO_CODING_FRAME_OBJECT_H_ |
| 12 | #define MODULES_VIDEO_CODING_FRAME_OBJECT_H_ |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 13 | |
Danil Chapovalov | 0040b66 | 2018-06-18 10:48:16 +0200 | [diff] [blame] | 14 | #include "absl/types/optional.h" |
philipel | d5a272f | 2018-02-21 14:30:34 +0100 | [diff] [blame] | 15 | #include "api/video/encoded_frame.h" |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 16 | |
| 17 | namespace webrtc { |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 18 | |
philipel | e7c891f | 2018-02-22 14:35:06 +0100 | [diff] [blame] | 19 | class RtpFrameObject : public EncodedFrame { |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 20 | public: |
Danil Chapovalov | e209fe6 | 2020-02-12 19:25:57 +0100 | [diff] [blame] | 21 | RtpFrameObject(uint16_t first_seq_num, |
| 22 | uint16_t last_seq_num, |
| 23 | bool markerBit, |
| 24 | int times_nacked, |
| 25 | int64_t first_packet_received_time, |
| 26 | int64_t last_packet_received_time, |
| 27 | uint32_t rtp_timestamp, |
| 28 | int64_t ntp_time_ms, |
| 29 | const VideoSendTiming& timing, |
| 30 | uint8_t payload_type, |
| 31 | VideoCodecType codec, |
| 32 | VideoRotation rotation, |
| 33 | VideoContentType content_type, |
| 34 | const RTPVideoHeader& video_header, |
| 35 | const absl::optional<webrtc::ColorSpace>& color_space, |
| 36 | RtpPacketInfos packet_infos, |
| 37 | rtc::scoped_refptr<EncodedImageBuffer> image_buffer); |
| 38 | |
Benjamin Wright | 0076529 | 2018-11-30 16:18:26 -0800 | [diff] [blame] | 39 | ~RtpFrameObject() override; |
philipel | f413933 | 2016-04-20 10:26:34 +0200 | [diff] [blame] | 40 | uint16_t first_seq_num() const; |
| 41 | uint16_t last_seq_num() const; |
philipel | 5ceaaae | 2016-05-24 10:20:47 +0200 | [diff] [blame] | 42 | int times_nacked() const; |
Niels Möller | 87e2d78 | 2019-03-07 10:18:23 +0100 | [diff] [blame] | 43 | VideoFrameType frame_type() const; |
philipel | 02447bc | 2016-05-13 06:01:03 -0700 | [diff] [blame] | 44 | VideoCodecType codec_type() const; |
philipel | b4d3108 | 2016-07-11 08:46:29 -0700 | [diff] [blame] | 45 | int64_t ReceivedTime() const override; |
| 46 | int64_t RenderTime() const override; |
philipel | e075430 | 2017-01-25 08:56:23 -0800 | [diff] [blame] | 47 | bool delayed_by_retransmission() const override; |
Johannes Kron | a370556 | 2019-08-26 16:37:11 +0200 | [diff] [blame] | 48 | const RTPVideoHeader& GetRtpVideoHeader() const; |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 49 | |
Niels Möller | 08ae7ce | 2020-09-23 15:58:12 +0200 | [diff] [blame] | 50 | uint8_t* mutable_data() { return image_buffer_->data(); } |
| 51 | |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 52 | private: |
Niels Möller | 08ae7ce | 2020-09-23 15:58:12 +0200 | [diff] [blame] | 53 | // Reference for mutable access. |
| 54 | rtc::scoped_refptr<EncodedImageBuffer> image_buffer_; |
Johannes Kron | a370556 | 2019-08-26 16:37:11 +0200 | [diff] [blame] | 55 | RTPVideoHeader rtp_video_header_; |
philipel | 02447bc | 2016-05-13 06:01:03 -0700 | [diff] [blame] | 56 | VideoCodecType codec_type_; |
| 57 | uint16_t first_seq_num_; |
| 58 | uint16_t last_seq_num_; |
Ilya Nikolaevskiy | 4348ce2 | 2018-12-07 16:26:56 +0100 | [diff] [blame] | 59 | int64_t last_packet_received_time_; |
philipel | 5ceaaae | 2016-05-24 10:20:47 +0200 | [diff] [blame] | 60 | |
| 61 | // Equal to times nacked of the packet with the highet times nacked |
| 62 | // belonging to this frame. |
| 63 | int times_nacked_; |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 64 | }; |
| 65 | |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 66 | } // namespace webrtc |
| 67 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 68 | #endif // MODULES_VIDEO_CODING_FRAME_OBJECT_H_ |