| 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 |
| 11 | #ifndef API_VIDEO_ENCODED_FRAME_H_ |
| 12 | #define API_VIDEO_ENCODED_FRAME_H_ |
| 13 |
| 14 | #include <stddef.h> |
| 15 | #include <stdint.h> |
| 16 |
| 17 | #include "modules/video_coding/encoded_frame.h" |
| 18 |
| 19 | namespace webrtc { |
| 20 |
| 21 | // TODO(philipel): Remove webrtc::VCMEncodedFrame inheritance. |
| 22 | // TODO(philipel): Move transport specific info out of EncodedFrame. |
| 23 | // NOTE: This class is still under development and may change without notice. |
| 24 | class EncodedFrame : public webrtc::VCMEncodedFrame { |
| 25 | public: |
| 26 | static const uint8_t kMaxFrameReferences = 5; |
| 27 |
| 28 | EncodedFrame() = default; |
| 29 | EncodedFrame(const EncodedFrame&) = default; |
| 30 | virtual ~EncodedFrame() {} |
| 31 |
| 32 | // When this frame was received. |
| 33 | virtual int64_t ReceivedTime() const = 0; |
| 34 |
| 35 | // When this frame should be rendered. |
| 36 | virtual int64_t RenderTime() const = 0; |
| 37 |
| 38 | // This information is currently needed by the timing calculation class. |
| 39 | // TODO(philipel): Remove this function when a new timing class has |
| 40 | // been implemented. |
| 41 | virtual bool delayed_by_retransmission() const; |
| 42 |
| 43 | bool is_keyframe() const { return num_references == 0; } |
| 44 |
| 45 | void SetId(int64_t id) { id_ = id; } |
| 46 | int64_t Id() const { return id_; } |
| 47 |
| 48 | // TODO(philipel): Add simple modify/access functions to prevent adding too |
| 49 | // many `references`. |
| 50 | size_t num_references = 0; |
| 51 | int64_t references[kMaxFrameReferences]; |
| 52 | // Is this subframe the last one in the superframe (In RTP stream that would |
| 53 | // mean that the last packet has a marker bit set). |
| 54 | bool is_last_spatial_layer = true; |
| 55 |
| 56 | private: |
| 57 | // The ID of the frame is determined from RTP level information. The IDs are |
| 58 | // used to describe order and dependencies between frames. |
| 59 | int64_t id_ = -1; |
| 60 | }; |
| 61 |
| 62 | } // namespace webrtc |
| 63 |
| 64 | #endif // API_VIDEO_ENCODED_FRAME_H_ |
| 65 |