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

@ -78,23 +78,6 @@ class FrameBuffer {
void UpdateRtt(int64_t rtt_ms);
private:
struct FrameKey {
FrameKey() : picture_id(-1), spatial_layer(0) {}
FrameKey(int64_t picture_id, uint8_t spatial_layer)
: picture_id(picture_id), spatial_layer(spatial_layer) {}
bool operator<(const FrameKey& rhs) const {
if (picture_id == rhs.picture_id)
return spatial_layer < rhs.spatial_layer;
return picture_id < rhs.picture_id;
}
bool operator<=(const FrameKey& rhs) const { return !(rhs < *this); }
int64_t picture_id;
uint8_t spatial_layer;
};
struct FrameInfo {
// The maximum number of frames that can depend on this frame.
static constexpr size_t kMaxNumDependentFrames = 8;
@ -103,7 +86,7 @@ class FrameBuffer {
// on this frame.
// TODO(philipel): Add simple modify/access functions to prevent adding too
// many |dependent_frames|.
FrameKey dependent_frames[kMaxNumDependentFrames];
VideoLayerFrameId dependent_frames[kMaxNumDependentFrames];
size_t num_dependent_frames = 0;
// A frame is continiuous if it has all its referenced/indirectly
@ -124,7 +107,7 @@ class FrameBuffer {
std::unique_ptr<EncodedFrame> frame;
};
using FrameMap = std::map<FrameKey, FrameInfo>;
using FrameMap = std::map<VideoLayerFrameId, FrameInfo>;
// Check that the references of |frame| are valid.
bool ValidReferences(const EncodedFrame& frame) const;