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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 14 | #include "api/optional.h" |
philipel | d5a272f | 2018-02-21 14:30:34 +0100 | [diff] [blame] | 15 | #include "api/video/encoded_frame.h" |
Mirko Bonadei | 7120742 | 2017-09-15 13:58:09 +0200 | [diff] [blame] | 16 | #include "common_types.h" // NOLINT(build/include) |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 17 | #include "modules/include/module_common_types.h" |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 18 | |
| 19 | namespace webrtc { |
| 20 | namespace video_coding { |
| 21 | |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 22 | class PacketBuffer; |
| 23 | |
philipel | e7c891f | 2018-02-22 14:35:06 +0100 | [diff] [blame^] | 24 | class RtpFrameObject : public EncodedFrame { |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 25 | public: |
| 26 | RtpFrameObject(PacketBuffer* packet_buffer, |
philipel | 02447bc | 2016-05-13 06:01:03 -0700 | [diff] [blame] | 27 | uint16_t first_seq_num, |
philipel | 5ceaaae | 2016-05-24 10:20:47 +0200 | [diff] [blame] | 28 | uint16_t last_seq_num, |
| 29 | size_t frame_size, |
philipel | b4d3108 | 2016-07-11 08:46:29 -0700 | [diff] [blame] | 30 | int times_nacked, |
| 31 | int64_t received_time); |
philipel | f413933 | 2016-04-20 10:26:34 +0200 | [diff] [blame] | 32 | |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 33 | ~RtpFrameObject(); |
philipel | f413933 | 2016-04-20 10:26:34 +0200 | [diff] [blame] | 34 | uint16_t first_seq_num() const; |
| 35 | uint16_t last_seq_num() const; |
philipel | 5ceaaae | 2016-05-24 10:20:47 +0200 | [diff] [blame] | 36 | int times_nacked() const; |
philipel | 552866c | 2016-07-04 16:18:55 +0200 | [diff] [blame] | 37 | enum FrameType frame_type() const; |
philipel | 02447bc | 2016-05-13 06:01:03 -0700 | [diff] [blame] | 38 | VideoCodecType codec_type() const; |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 39 | bool GetBitstream(uint8_t* destination) const override; |
philipel | b4d3108 | 2016-07-11 08:46:29 -0700 | [diff] [blame] | 40 | uint32_t Timestamp() const override; |
| 41 | int64_t ReceivedTime() const override; |
| 42 | int64_t RenderTime() const override; |
philipel | e075430 | 2017-01-25 08:56:23 -0800 | [diff] [blame] | 43 | bool delayed_by_retransmission() const override; |
philipel | 8848828 | 2016-11-03 08:56:54 -0700 | [diff] [blame] | 44 | rtc::Optional<RTPVideoTypeHeader> GetCodecHeader() const; |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 45 | |
| 46 | private: |
philipel | 17deeb4 | 2016-08-11 15:09:26 +0200 | [diff] [blame] | 47 | rtc::scoped_refptr<PacketBuffer> packet_buffer_; |
philipel | 552866c | 2016-07-04 16:18:55 +0200 | [diff] [blame] | 48 | enum FrameType frame_type_; |
philipel | 02447bc | 2016-05-13 06:01:03 -0700 | [diff] [blame] | 49 | VideoCodecType codec_type_; |
| 50 | uint16_t first_seq_num_; |
| 51 | uint16_t last_seq_num_; |
philipel | b4d3108 | 2016-07-11 08:46:29 -0700 | [diff] [blame] | 52 | uint32_t timestamp_; |
| 53 | int64_t received_time_; |
philipel | 5ceaaae | 2016-05-24 10:20:47 +0200 | [diff] [blame] | 54 | |
| 55 | // Equal to times nacked of the packet with the highet times nacked |
| 56 | // belonging to this frame. |
| 57 | int times_nacked_; |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 58 | }; |
| 59 | |
| 60 | } // namespace video_coding |
| 61 | } // namespace webrtc |
| 62 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 63 | #endif // MODULES_VIDEO_CODING_FRAME_OBJECT_H_ |