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:
philipel
2018-03-19 15:34:53 +01:00
committed by Commit Bot
parent 9c1ee368e0
commit 0fa82a60e9
9 changed files with 121 additions and 104 deletions

View File

@ -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