Add GetMetadata() to TransformableVideoFrameInterface API.
Define VideoHeaderMetadata, containing a subset of the metadata in RTP
video header, and expose it the TransformableVideoFrameInterface, to
enable web application to compute additional data according to their own
logic, and eventually remove GetAdditionalData() from the interface.
Bug: chromium:1069295
Change-Id: Id85b494a72cfd8bdd4c0614844b9f0ffae98c956
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174822
Commit-Queue: Marina Ciocea <marinaciocea@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31265}
diff --git a/api/frame_transformer_interface.h b/api/frame_transformer_interface.h
index e712b3c..753c7f4 100644
--- a/api/frame_transformer_interface.h
+++ b/api/frame_transformer_interface.h
@@ -16,6 +16,7 @@
#include "api/scoped_refptr.h"
#include "api/video/encoded_frame.h"
+#include "api/video/video_frame_metadata.h"
#include "rtc_base/ref_count.h"
namespace webrtc {
@@ -48,6 +49,15 @@
// TODO(bugs.webrtc.org/11380) remove from interface once
// webrtc::RtpDescriptorAuthentication is exposed in api/.
virtual std::vector<uint8_t> GetAdditionalData() const = 0;
+
+ // TODO(bugs.webrtc.org/11380) make pure virtual after implementating it
+ // downstream.
+ virtual const VideoFrameMetadata& GetMetadata() const { return metadata_; }
+
+ private:
+ // TODO(bugs.webrtc.org/11380) remove from interface once GetRtpVideoHeader is
+ // pure virtual.
+ VideoFrameMetadata metadata_;
};
// Extends the TransformableFrameInterface to expose audio-specific information.