12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #ifndef API_VIDEO_ENCODED_FRAME_H_
- #define API_VIDEO_ENCODED_FRAME_H_
- #include <stddef.h>
- #include <stdint.h>
- #include "modules/video_coding/encoded_frame.h"
- namespace webrtc {
- namespace video_coding {
- struct VideoLayerFrameId {
-
-
- VideoLayerFrameId() : picture_id(-1), spatial_layer(0) {}
- VideoLayerFrameId(int64_t picture_id, uint8_t spatial_layer)
- : picture_id(picture_id), spatial_layer(spatial_layer) {}
- bool operator==(const VideoLayerFrameId& rhs) const {
- return picture_id == rhs.picture_id && spatial_layer == rhs.spatial_layer;
- }
- bool operator!=(const VideoLayerFrameId& rhs) const {
- return !(*this == rhs);
- }
- bool operator<(const VideoLayerFrameId& rhs) const {
- if (picture_id == rhs.picture_id)
- return spatial_layer < rhs.spatial_layer;
- return picture_id < rhs.picture_id;
- }
- bool operator<=(const VideoLayerFrameId& rhs) const { return !(rhs < *this); }
- bool operator>(const VideoLayerFrameId& rhs) const { return rhs < *this; }
- bool operator>=(const VideoLayerFrameId& rhs) const { return rhs <= *this; }
- int64_t picture_id;
- uint8_t spatial_layer;
- };
- class EncodedFrame : public webrtc::VCMEncodedFrame {
- public:
- static const uint8_t kMaxFrameReferences = 5;
- EncodedFrame() = default;
- EncodedFrame(const EncodedFrame&) = default;
- virtual ~EncodedFrame() {}
-
- virtual int64_t ReceivedTime() const = 0;
-
- virtual int64_t RenderTime() const = 0;
-
-
-
- virtual bool delayed_by_retransmission() const;
- bool is_keyframe() const { return num_references == 0; }
- VideoLayerFrameId id;
-
-
- size_t num_references = 0;
- int64_t references[kMaxFrameReferences];
- bool inter_layer_predicted = false;
-
-
- bool is_last_spatial_layer = true;
- };
- }
- }
- #endif
|