Revert "Partial frame capture API part 1"

This reverts commit 8a21e1c9c95c9b9b570c84bdfeda0315ede9dc29.

Reason for revert: breaks buildbots

Original change's description:
> Partial frame capture API part 1
> 
> Define new optional struct in VideoFrame to signal that the frame is a
> changed part of a whole picture and add a flag to signal that partial
> update may be issued by the VideoFrame source.
> 
> Also, fix too strict assumptions in FrameBuffers PasteFrom methods.
> Also, add ability to set a new buffer in video frame.
> 
> 
> Bug: webrtc:10152
> Change-Id: Ie0da418fd60bc7a34334329292e0b860ec388788
> Reviewed-on: https://webrtc-review.googlesource.com/c/120405
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26489}

TBR=ilnik@webrtc.org,nisse@webrtc.org,sprang@webrtc.org

Change-Id: Ibf61f28e529a444882962b984474d4849bb44e4b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10152
Reviewed-on: https://webrtc-review.googlesource.com/c/120760
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26490}
This commit is contained in:
Ilya Nikolaevskiy
2019-01-31 11:57:20 +00:00
committed by Commit Bot
parent 8a21e1c9c9
commit 8102a1a8ea
5 changed files with 22 additions and 92 deletions

View File

@ -25,14 +25,6 @@ namespace webrtc {
class RTC_EXPORT VideoFrame {
public:
// Describes a partial frame, which contains only a changed region compared
// to a previous frame. Shouldn't be set on the fully updated picture.
struct PartialFrameDescription {
// Coordinates of top-left corner of the changed region in the full picture.
int offset_x;
int offset_y;
};
// Preferred way of building VideoFrame objects.
class Builder {
public:
@ -50,10 +42,6 @@ class RTC_EXPORT VideoFrame {
Builder& set_color_space(const ColorSpace& color_space);
Builder& set_color_space(const ColorSpace* color_space);
Builder& set_id(uint16_t id);
Builder& set_partial_frame_description(
const absl::optional<PartialFrameDescription>& description);
Builder& set_cache_buffer_for_partial_updates(
bool cache_buffer_for_partial_updates);
private:
uint16_t id_ = 0;
@ -63,8 +51,6 @@ class RTC_EXPORT VideoFrame {
int64_t ntp_time_ms_ = 0;
VideoRotation rotation_ = kVideoRotation_0;
absl::optional<ColorSpace> color_space_;
absl::optional<PartialFrameDescription> partial_frame_description_;
bool cache_buffer_for_partial_updates_;
};
// To be deprecated. Migrate all use to Builder.
@ -148,31 +134,13 @@ class RTC_EXPORT VideoFrame {
color_space ? absl::make_optional(*color_space) : absl::nullopt;
}
const PartialFrameDescription* partial_frame_description() const {
return partial_frame_description_ ? &partial_frame_description_.value()
: nullptr;
}
void set_partial_frame_description(
const absl::optional<PartialFrameDescription>& description) {
partial_frame_description_ = description;
}
void set_cache_buffer_for_partial_updates(
bool cache_buffer_for_partial_updates) {
cache_buffer_for_partial_updates_ = cache_buffer_for_partial_updates;
}
bool cache_buffer_for_partial_updates() const {
return cache_buffer_for_partial_updates_;
}
// Get render time in milliseconds.
// TODO(nisse): Deprecated. Migrate all users to timestamp_us().
int64_t render_time_ms() const;
// Return the underlying buffer. This can only be a nullptr for a partial
// update VideoFrame with no changed pixels.
// Return the underlying buffer. Never nullptr for a properly
// initialized VideoFrame.
rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer() const;
void set_video_frame_buffer(rtc::scoped_refptr<VideoFrameBuffer> buffer);
// TODO(nisse): Deprecated.
// Return true if the frame is stored in a texture.
@ -181,16 +149,13 @@ class RTC_EXPORT VideoFrame {
}
private:
VideoFrame(
uint16_t id,
const rtc::scoped_refptr<VideoFrameBuffer>& buffer,
int64_t timestamp_us,
uint32_t timestamp_rtp,
int64_t ntp_time_ms,
VideoRotation rotation,
const absl::optional<ColorSpace>& color_space,
const absl::optional<PartialFrameDescription> partial_frame_description,
bool cache_buffer_for_partial_updates_);
VideoFrame(uint16_t id,
const rtc::scoped_refptr<VideoFrameBuffer>& buffer,
int64_t timestamp_us,
uint32_t timestamp_rtp,
int64_t ntp_time_ms,
VideoRotation rotation,
const absl::optional<ColorSpace>& color_space);
uint16_t id_;
// An opaque reference counted handle that stores the pixel data.
@ -200,9 +165,6 @@ class RTC_EXPORT VideoFrame {
int64_t timestamp_us_;
VideoRotation rotation_;
absl::optional<ColorSpace> color_space_;
absl::optional<PartialFrameDescription> partial_frame_description_;
// Should be set on all frames, if the source may produce partial updates.
bool cache_buffer_for_partial_updates_;
};
} // namespace webrtc