Revert of Delete deprecated and transitional stuff related to video frame refactoring. (patchset #1 id:1 of https://codereview.webrtc.org/2852303002/ )
Reason for revert: Unfortunately, more downstream updates needed. Original issue's description: > Reland of Delete deprecated and transitional stuff related to video frame refactoring. (patchset #1 id:1 of https://codereview.webrtc.org/2845333002/ ) > > Reason for revert: > Downstream projects being updated. > > For Chrome, relanding depends on cl > https://codereview.chromium.org/2855783003/ > > Original issue's description: > > Revert of Delete deprecated and transitional stuff related to video frame refactoring. (patchset #17 id:320001 of https://codereview.webrtc.org/2622263002/ ) > > > > Reason for revert: > > Broke Chrome build, see, e.g., > > http://build.chromium.org/p/chromium.webrtc.fyi/builders/Linux%20Builder/builds/16237 > > > > Original issue's description: > > > Delete deprecated and transitional stuff related to video frame refactoring. > > > > > > BUG=webrtc:5880 > > > > > > Review-Url: https://codereview.webrtc.org/2622263002 > > > Cr-Commit-Position: refs/heads/master@{#17928} > > > Committed:713a3bbcc7> > > > TBR=mflodman@webrtc.org,perkj@webrtc.org > > # Skipping CQ checks because original CL landed less than 1 days ago. > > NOPRESUBMIT=true > > NOTREECHECKS=true > > NOTRY=true > > BUG=webrtc:5880 > > > > Review-Url: https://codereview.webrtc.org/2845333002 > > Cr-Commit-Position: refs/heads/master@{#17929} > > Committed:aec49d2b49> > TBR=mflodman@webrtc.org,perkj@webrtc.org > # Not skipping CQ checks because original CL landed more than 1 days ago. > BUG=webrtc:5880 > > Review-Url: https://codereview.webrtc.org/2852303002 > Cr-Commit-Position: refs/heads/master@{#17974} > Committed:d71ebd70f6TBR=mflodman@webrtc.org,perkj@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:5880 Review-Url: https://codereview.webrtc.org/2854883002 Cr-Commit-Position: refs/heads/master@{#17978}
This commit is contained in:
@ -23,6 +23,10 @@
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/api/video/video_frame.h"
|
||||
// TODO(nisse): Transition hack, Chrome expects that including this
|
||||
// file declares I420Buffer. Delete after users of I420Buffer are
|
||||
// fixed to include the new header.
|
||||
#include "webrtc/api/video/i420_buffer.h"
|
||||
#include "webrtc/base/refcount.h"
|
||||
#include "webrtc/base/scoped_ref_ptr.h"
|
||||
#include "webrtc/base/optional.h"
|
||||
|
||||
@ -131,6 +131,17 @@ rtc::scoped_refptr<I420Buffer> I420Buffer::Rotate(
|
||||
return buffer;
|
||||
}
|
||||
|
||||
// static
|
||||
rtc::scoped_refptr<VideoFrameBuffer> I420Buffer::Rotate(
|
||||
rtc::scoped_refptr<VideoFrameBuffer> src,
|
||||
VideoRotation rotation) {
|
||||
if (rotation == webrtc::kVideoRotation_0) {
|
||||
return src;
|
||||
} else {
|
||||
return Rotate(*src, rotation);
|
||||
}
|
||||
}
|
||||
|
||||
void I420Buffer::InitializeData() {
|
||||
memset(data_.get(), 0,
|
||||
I420DataSize(height_, stride_y_, stride_u_, stride_v_));
|
||||
|
||||
@ -53,6 +53,9 @@ class I420Buffer : public VideoFrameBuffer {
|
||||
// are resolved in a better way. Or in the mean time, use SetBlack.
|
||||
void InitializeData();
|
||||
|
||||
// TODO(nisse): Deprecated, use static method instead.
|
||||
void SetToBlack() { SetBlack(this); }
|
||||
|
||||
int width() const override;
|
||||
int height() const override;
|
||||
const uint8_t* DataY() const override;
|
||||
@ -85,6 +88,14 @@ class I420Buffer : public VideoFrameBuffer {
|
||||
// Scale all of |src| to the size of |this| buffer, with no cropping.
|
||||
void ScaleFrom(const VideoFrameBuffer& src);
|
||||
|
||||
// TODO(nisse): Deprecated, delete once downstream applications are updated.
|
||||
// Returns a rotated versions of |src|. Native buffers are not
|
||||
// supported. The reason this function doesn't return an I420Buffer,
|
||||
// is that it returns |src| unchanged in case |rotation| is zero.
|
||||
static rtc::scoped_refptr<VideoFrameBuffer> Rotate(
|
||||
rtc::scoped_refptr<VideoFrameBuffer> src,
|
||||
VideoRotation rotation);
|
||||
|
||||
protected:
|
||||
I420Buffer(int width, int height);
|
||||
I420Buffer(int width, int height, int stride_y, int stride_u, int stride_v);
|
||||
|
||||
@ -16,6 +16,11 @@
|
||||
#include "webrtc/api/video/video_rotation.h"
|
||||
#include "webrtc/api/video/video_frame_buffer.h"
|
||||
|
||||
// TODO(nisse): Transition hack, some downstream applications expect
|
||||
// that including this file also defines base/timeutils.h constants.
|
||||
// Delete after applications are fixed to include the right headers.
|
||||
#include "webrtc/base/timeutils.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class VideoFrame {
|
||||
|
||||
@ -22,7 +22,6 @@ rtc_source_set("video_codecs_api") {
|
||||
# TODO(ilnik): Add dependency on webrtc/video_frame.h when it will have it's
|
||||
# own build target.
|
||||
|
||||
"..:video_frame_api",
|
||||
"../..:webrtc_common",
|
||||
"../../base:rtc_base_approved",
|
||||
]
|
||||
|
||||
@ -15,7 +15,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/api/video/video_frame.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
#include "webrtc/video_frame.h"
|
||||
|
||||
@ -15,7 +15,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/api/video/video_frame.h"
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
Reference in New Issue
Block a user