Moved FrameKey to api/video/encoded_frame.h and renamed it to VideoLayerFrameId.
Since we want the VideoStreamDecoder to callback with the last continuous frame we need to move the FrameKey into the public API. Bug: webrtc:8909 Change-Id: I39634145d848b8163778e31a1e0d04d91f9bbeb8 Reviewed-on: https://webrtc-review.googlesource.com/60864 Commit-Queue: Philip Eliasson <philipel@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Reviewed-by: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22495}
This commit is contained in:
@ -16,7 +16,39 @@
|
||||
namespace webrtc {
|
||||
namespace video_coding {
|
||||
|
||||
// NOTE: This class is still under development and may change without notice.
|
||||
struct VideoLayerFrameId {
|
||||
// TODO(philipel): The default ctor is currently used internaly, but have a
|
||||
// look if we can remove it.
|
||||
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;
|
||||
};
|
||||
|
||||
// TODO(philipel): Remove webrtc::VCMEncodedFrame inheritance.
|
||||
// TODO(philipel): Move transport specific info out of EncodedFrame.
|
||||
// NOTE: This class is still under development and may change without notice.
|
||||
class EncodedFrame : public webrtc::VCMEncodedFrame {
|
||||
public:
|
||||
static const uint8_t kMaxFrameReferences = 5;
|
||||
@ -44,11 +76,11 @@ class EncodedFrame : public webrtc::VCMEncodedFrame {
|
||||
|
||||
bool is_keyframe() const { return num_references == 0; }
|
||||
|
||||
// The tuple (|picture_id|, |spatial_layer|) uniquely identifies a frame
|
||||
// object. For codec types that don't necessarily have picture ids they
|
||||
// have to be constructed from the header data relevant to that codec.
|
||||
int64_t picture_id = 0;
|
||||
uint8_t spatial_layer = 0;
|
||||
VideoLayerFrameId id;
|
||||
// TODO(philipel): Remove the two references below when downstream projects
|
||||
// have been updated.
|
||||
int64_t& picture_id = id.picture_id;
|
||||
uint8_t& spatial_layer = id.spatial_layer;
|
||||
uint32_t timestamp = 0;
|
||||
|
||||
// TODO(philipel): Add simple modify/access functions to prevent adding too
|
||||
|
||||
Reference in New Issue
Block a user