2016-04-01 02:01:54 -07:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef MODULES_VIDEO_CODING_FRAME_OBJECT_H_
|
|
|
|
|
#define MODULES_VIDEO_CODING_FRAME_OBJECT_H_
|
2016-04-01 02:01:54 -07:00
|
|
|
|
2018-06-18 10:48:16 +02:00
|
|
|
#include "absl/types/optional.h"
|
2018-02-21 14:30:34 +01:00
|
|
|
#include "api/video/encoded_frame.h"
|
2017-09-15 13:58:09 +02:00
|
|
|
#include "common_types.h" // NOLINT(build/include)
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/include/module_common_types.h"
|
2018-10-02 13:55:47 +02:00
|
|
|
#include "modules/rtp_rtcp/source/rtp_generic_frame_descriptor.h"
|
2016-04-01 02:01:54 -07:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
namespace video_coding {
|
|
|
|
|
|
|
|
|
|
class PacketBuffer;
|
|
|
|
|
|
2018-02-22 14:35:06 +01:00
|
|
|
class RtpFrameObject : public EncodedFrame {
|
2016-04-01 02:01:54 -07:00
|
|
|
public:
|
|
|
|
|
RtpFrameObject(PacketBuffer* packet_buffer,
|
2016-05-13 06:01:03 -07:00
|
|
|
uint16_t first_seq_num,
|
2016-05-24 10:20:47 +02:00
|
|
|
uint16_t last_seq_num,
|
|
|
|
|
size_t frame_size,
|
2016-07-11 08:46:29 -07:00
|
|
|
int times_nacked,
|
2018-12-07 16:26:56 +01:00
|
|
|
int64_t first_packet_received_time,
|
|
|
|
|
int64_t last_packet_received_time);
|
2016-04-20 10:26:34 +02:00
|
|
|
|
2018-11-30 16:18:26 -08:00
|
|
|
~RtpFrameObject() override;
|
2016-04-20 10:26:34 +02:00
|
|
|
uint16_t first_seq_num() const;
|
|
|
|
|
uint16_t last_seq_num() const;
|
2016-05-24 10:20:47 +02:00
|
|
|
int times_nacked() const;
|
2016-07-04 16:18:55 +02:00
|
|
|
enum FrameType frame_type() const;
|
2016-05-13 06:01:03 -07:00
|
|
|
VideoCodecType codec_type() const;
|
2016-07-11 08:46:29 -07:00
|
|
|
int64_t ReceivedTime() const override;
|
|
|
|
|
int64_t RenderTime() const override;
|
2018-11-28 16:31:29 +01:00
|
|
|
void SetSize(size_t size);
|
2017-01-25 08:56:23 -08:00
|
|
|
bool delayed_by_retransmission() const override;
|
2018-09-07 13:38:53 +02:00
|
|
|
absl::optional<RTPVideoHeader> GetRtpVideoHeader() const;
|
2018-10-02 13:55:47 +02:00
|
|
|
absl::optional<RtpGenericFrameDescriptor> GetGenericFrameDescriptor() const;
|
2018-09-11 16:50:49 -04:00
|
|
|
absl::optional<FrameMarking> GetFrameMarking() const;
|
2016-04-01 02:01:54 -07:00
|
|
|
|
|
|
|
|
private:
|
2018-10-02 17:01:45 +02:00
|
|
|
void AllocateBitstreamBuffer(size_t frame_size);
|
|
|
|
|
|
2016-08-11 15:09:26 +02:00
|
|
|
rtc::scoped_refptr<PacketBuffer> packet_buffer_;
|
2016-07-04 16:18:55 +02:00
|
|
|
enum FrameType frame_type_;
|
2016-05-13 06:01:03 -07:00
|
|
|
VideoCodecType codec_type_;
|
|
|
|
|
uint16_t first_seq_num_;
|
|
|
|
|
uint16_t last_seq_num_;
|
2018-12-07 16:26:56 +01:00
|
|
|
int64_t last_packet_received_time_;
|
2016-05-24 10:20:47 +02:00
|
|
|
|
|
|
|
|
// Equal to times nacked of the packet with the highet times nacked
|
|
|
|
|
// belonging to this frame.
|
|
|
|
|
int times_nacked_;
|
2016-04-01 02:01:54 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace video_coding
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // MODULES_VIDEO_CODING_FRAME_OBJECT_H_
|