Revert "VideoFrameBuffer: Remove deprecated functions"

This reverts commit 428c9e218538278e6b0db42d1b734431bb432e1a.

Reason for revert: Breaks Chromium WebRTC FYI on Mac Builder. http://build.chromium.org/p/chromium.webrtc.fyi/builders/Mac%20Builder/builds/25788

Original change's description:
> VideoFrameBuffer: Remove deprecated functions
> 
> Bug: webrtc:7632
> Change-Id: I06f97bacd51f94d1f90b5286cc39e06a1697bb9b
> Reviewed-on: https://chromium-review.googlesource.com/535479
> Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#18832}

TBR=magjed@webrtc.org,nisse@webrtc.org

Change-Id: I2e6617420746bba3e4637019d3bce03be12a4643
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:7632
Reviewed-on: https://chromium-review.googlesource.com/555550
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18834}
This commit is contained in:
Magnus Jedvert
2017-06-29 13:39:20 +00:00
committed by Commit Bot
parent bc8feda1db
commit f1e34832b8
4 changed files with 186 additions and 10 deletions

View File

@ -48,7 +48,7 @@ class VideoFrameBuffer : public rtc::RefCountInterface {
};
// This function specifies in what pixel format the data is stored in.
virtual Type type() const = 0;
virtual Type type() const;
// The resolution of the frame in pixels. For formats where some planes are
// subsampled, this is the highest-resolution plane.
@ -59,7 +59,7 @@ class VideoFrameBuffer : public rtc::RefCountInterface {
// in another format, a conversion will take place. All implementations must
// provide a fallback to I420 for compatibility with e.g. the internal WebRTC
// software encoders.
virtual rtc::scoped_refptr<I420BufferInterface> ToI420() = 0;
virtual rtc::scoped_refptr<I420BufferInterface> ToI420();
// These functions should only be called if type() is of the correct type.
// Calling with a different type will result in a crash.
@ -70,6 +70,26 @@ class VideoFrameBuffer : public rtc::RefCountInterface {
I444BufferInterface* GetI444();
const I444BufferInterface* GetI444() const;
// Deprecated - use ToI420() first instead.
// Returns pointer to the pixel data for a given plane. The memory is owned by
// the VideoFrameBuffer object and must not be freed by the caller.
virtual const uint8_t* DataY() const;
virtual const uint8_t* DataU() const;
virtual const uint8_t* DataV() const;
// Returns the number of bytes between successive rows for a given plane.
virtual int StrideY() const;
virtual int StrideU() const;
virtual int StrideV() const;
// Deprecated - use type() to determine if the stored data is kNative, and
// then cast into the appropriate type.
// Return the handle of the underlying video frame. This is used when the
// frame is backed by a texture.
virtual void* native_handle() const;
// Deprecated - use ToI420() instead.
virtual rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer();
protected:
~VideoFrameBuffer() override {}
};
@ -82,14 +102,14 @@ class PlanarYuvBuffer : public VideoFrameBuffer {
// Returns pointer to the pixel data for a given plane. The memory is owned by
// the VideoFrameBuffer object and must not be freed by the caller.
virtual const uint8_t* DataY() const = 0;
virtual const uint8_t* DataU() const = 0;
virtual const uint8_t* DataV() const = 0;
const uint8_t* DataY() const override = 0;
const uint8_t* DataU() const override = 0;
const uint8_t* DataV() const override = 0;
// Returns the number of bytes between successive rows for a given plane.
virtual int StrideY() const = 0;
virtual int StrideU() const = 0;
virtual int StrideV() const = 0;
int StrideY() const override = 0;
int StrideU() const override = 0;
int StrideV() const override = 0;
protected:
~PlanarYuvBuffer() override {}