Chrome has now been updated.
CapturedFrame Removed deprecated elapsed_time. Changed rotation to be webrtc::VideoRotation. WebRTCVideoFrame Removed deprecated InitToBlack Removed deprecated constructors. Review URL: https://codereview.webrtc.org/1461053002 Cr-Commit-Position: refs/heads/master@{#10718}
This commit is contained in:
@ -57,11 +57,13 @@ class AndroidVideoCapturer::FrameFactory : public cricket::VideoFrameFactory {
|
|||||||
const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer,
|
const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer,
|
||||||
int rotation,
|
int rotation,
|
||||||
int64_t time_stamp_in_ns) {
|
int64_t time_stamp_in_ns) {
|
||||||
|
RTC_DCHECK(rotation == 0 || rotation == 90 || rotation == 180 ||
|
||||||
|
rotation == 270);
|
||||||
buffer_ = buffer;
|
buffer_ = buffer;
|
||||||
captured_frame_.width = buffer->width();
|
captured_frame_.width = buffer->width();
|
||||||
captured_frame_.height = buffer->height();
|
captured_frame_.height = buffer->height();
|
||||||
captured_frame_.time_stamp = time_stamp_in_ns;
|
captured_frame_.time_stamp = time_stamp_in_ns;
|
||||||
captured_frame_.rotation = rotation;
|
captured_frame_.rotation = static_cast<webrtc::VideoRotation>(rotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClearCapturedFrame() {
|
void ClearCapturedFrame() {
|
||||||
@ -85,7 +87,7 @@ class AndroidVideoCapturer::FrameFactory : public cricket::VideoFrameFactory {
|
|||||||
|
|
||||||
rtc::scoped_ptr<cricket::VideoFrame> frame(new cricket::WebRtcVideoFrame(
|
rtc::scoped_ptr<cricket::VideoFrame> frame(new cricket::WebRtcVideoFrame(
|
||||||
ShallowCenterCrop(buffer_, dst_width, dst_height),
|
ShallowCenterCrop(buffer_, dst_width, dst_height),
|
||||||
captured_frame->time_stamp, captured_frame->GetRotation()));
|
captured_frame->time_stamp, captured_frame->rotation));
|
||||||
// Caller takes ownership.
|
// Caller takes ownership.
|
||||||
// TODO(magjed): Change CreateAliasedFrame() to return a rtc::scoped_ptr.
|
// TODO(magjed): Change CreateAliasedFrame() to return a rtc::scoped_ptr.
|
||||||
return apply_rotation_ ? frame->GetCopyWithRotationApplied()->Copy()
|
return apply_rotation_ ? frame->GetCopyWithRotationApplied()->Copy()
|
||||||
@ -101,7 +103,7 @@ class AndroidVideoCapturer::FrameFactory : public cricket::VideoFrameFactory {
|
|||||||
if (buffer_->native_handle() != nullptr) {
|
if (buffer_->native_handle() != nullptr) {
|
||||||
// TODO(perkj): Implement CreateAliasedFrame properly for textures.
|
// TODO(perkj): Implement CreateAliasedFrame properly for textures.
|
||||||
rtc::scoped_ptr<cricket::VideoFrame> frame(new cricket::WebRtcVideoFrame(
|
rtc::scoped_ptr<cricket::VideoFrame> frame(new cricket::WebRtcVideoFrame(
|
||||||
buffer_, input_frame->time_stamp, input_frame->GetRotation()));
|
buffer_, input_frame->time_stamp, input_frame->rotation));
|
||||||
return frame.release();
|
return frame.release();
|
||||||
}
|
}
|
||||||
return VideoFrameFactory::CreateAliasedFrame(input_frame,
|
return VideoFrameFactory::CreateAliasedFrame(input_frame,
|
||||||
|
@ -82,7 +82,7 @@ CapturedFrame::CapturedFrame()
|
|||||||
pixel_height(0),
|
pixel_height(0),
|
||||||
time_stamp(0),
|
time_stamp(0),
|
||||||
data_size(0),
|
data_size(0),
|
||||||
rotation(0),
|
rotation(webrtc::kVideoRotation_0),
|
||||||
data(NULL) {}
|
data(NULL) {}
|
||||||
|
|
||||||
// TODO(fbarchard): Remove this function once lmimediaengine stops using it.
|
// TODO(fbarchard): Remove this function once lmimediaengine stops using it.
|
||||||
@ -94,11 +94,6 @@ bool CapturedFrame::GetDataSize(uint32_t* size) const {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
webrtc::VideoRotation CapturedFrame::GetRotation() const {
|
|
||||||
ASSERT(rotation == 0 || rotation == 90 || rotation == 180 || rotation == 270);
|
|
||||||
return static_cast<webrtc::VideoRotation>(rotation);
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
// Implementation of class VideoCapturer
|
// Implementation of class VideoCapturer
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
|
@ -78,10 +78,6 @@ struct CapturedFrame {
|
|||||||
// fourcc. Return true if succeeded.
|
// fourcc. Return true if succeeded.
|
||||||
bool GetDataSize(uint32_t* size) const;
|
bool GetDataSize(uint32_t* size) const;
|
||||||
|
|
||||||
// TODO(guoweis): Change the type of |rotation| from int to
|
|
||||||
// webrtc::VideoRotation once chromium gets the code.
|
|
||||||
webrtc::VideoRotation GetRotation() const;
|
|
||||||
|
|
||||||
// The width and height of the captured frame could be different from those
|
// The width and height of the captured frame could be different from those
|
||||||
// of VideoFormat. Once the first frame is captured, the width, height,
|
// of VideoFormat. Once the first frame is captured, the width, height,
|
||||||
// fourcc, pixel_width, and pixel_height should keep the same over frames.
|
// fourcc, pixel_width, and pixel_height should keep the same over frames.
|
||||||
@ -90,15 +86,11 @@ struct CapturedFrame {
|
|||||||
uint32_t fourcc; // compression
|
uint32_t fourcc; // compression
|
||||||
uint32_t pixel_width; // width of a pixel, default is 1
|
uint32_t pixel_width; // width of a pixel, default is 1
|
||||||
uint32_t pixel_height; // height of a pixel, default is 1
|
uint32_t pixel_height; // height of a pixel, default is 1
|
||||||
// TODO(magjed): |elapsed_time| is deprecated - remove once not used anymore.
|
|
||||||
int64_t elapsed_time;
|
|
||||||
int64_t time_stamp; // timestamp of when the frame was captured, in unix
|
int64_t time_stamp; // timestamp of when the frame was captured, in unix
|
||||||
// time with nanosecond units.
|
// time with nanosecond units.
|
||||||
uint32_t data_size; // number of bytes of the frame data
|
uint32_t data_size; // number of bytes of the frame data
|
||||||
|
|
||||||
// TODO(guoweis): This can't be converted to VideoRotation yet as it's
|
webrtc::VideoRotation rotation; // rotation in degrees of the frame.
|
||||||
// used by chrome now.
|
|
||||||
int rotation; // rotation in degrees of the frame (0, 90, 180, 270)
|
|
||||||
|
|
||||||
void* data; // pointer to the frame data. This object allocates the
|
void* data; // pointer to the frame data. This object allocates the
|
||||||
// memory or points to an existing memory.
|
// memory or points to an existing memory.
|
||||||
|
@ -51,8 +51,8 @@ VideoFrame* VideoFrameFactory::CreateAliasedFrame(
|
|||||||
|
|
||||||
// If the frame is rotated, we need to switch the width and height.
|
// If the frame is rotated, we need to switch the width and height.
|
||||||
if (apply_rotation_ &&
|
if (apply_rotation_ &&
|
||||||
(input_frame->GetRotation() == webrtc::kVideoRotation_90 ||
|
(input_frame->rotation == webrtc::kVideoRotation_90 ||
|
||||||
input_frame->GetRotation() == webrtc::kVideoRotation_270)) {
|
input_frame->rotation == webrtc::kVideoRotation_270)) {
|
||||||
std::swap(output_width, output_height);
|
std::swap(output_width, output_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,17 +56,6 @@ WebRtcVideoFrame::WebRtcVideoFrame(
|
|||||||
rotation_(rotation) {
|
rotation_(rotation) {
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtcVideoFrame::WebRtcVideoFrame(
|
|
||||||
const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer,
|
|
||||||
int64_t elapsed_time_ns,
|
|
||||||
int64_t time_stamp_ns)
|
|
||||||
: video_frame_buffer_(buffer),
|
|
||||||
pixel_width_(1),
|
|
||||||
pixel_height_(1),
|
|
||||||
time_stamp_ns_(time_stamp_ns),
|
|
||||||
rotation_(webrtc::kVideoRotation_0) {
|
|
||||||
}
|
|
||||||
|
|
||||||
WebRtcVideoFrame::~WebRtcVideoFrame() {}
|
WebRtcVideoFrame::~WebRtcVideoFrame() {}
|
||||||
|
|
||||||
bool WebRtcVideoFrame::Init(uint32_t format,
|
bool WebRtcVideoFrame::Init(uint32_t format,
|
||||||
@ -90,13 +79,7 @@ bool WebRtcVideoFrame::Init(const CapturedFrame* frame, int dw, int dh,
|
|||||||
return Reset(frame->fourcc, frame->width, frame->height, dw, dh,
|
return Reset(frame->fourcc, frame->width, frame->height, dw, dh,
|
||||||
static_cast<uint8_t*>(frame->data), frame->data_size,
|
static_cast<uint8_t*>(frame->data), frame->data_size,
|
||||||
frame->pixel_width, frame->pixel_height, frame->time_stamp,
|
frame->pixel_width, frame->pixel_height, frame->time_stamp,
|
||||||
frame->GetRotation(), apply_rotation);
|
frame->rotation, apply_rotation);
|
||||||
}
|
|
||||||
|
|
||||||
bool WebRtcVideoFrame::InitToBlack(int w, int h, size_t pixel_width,
|
|
||||||
size_t pixel_height, int64_t,
|
|
||||||
int64_t time_stamp_ns) {
|
|
||||||
return InitToBlack(w, h, pixel_width, pixel_height, time_stamp_ns);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebRtcVideoFrame::InitToBlack(int w, int h, size_t pixel_width,
|
bool WebRtcVideoFrame::InitToBlack(int w, int h, size_t pixel_width,
|
||||||
|
@ -46,11 +46,6 @@ class WebRtcVideoFrame : public VideoFrame {
|
|||||||
int64_t time_stamp_ns,
|
int64_t time_stamp_ns,
|
||||||
webrtc::VideoRotation rotation);
|
webrtc::VideoRotation rotation);
|
||||||
|
|
||||||
// TODO(guoweis): Remove this when chrome code base is updated.
|
|
||||||
WebRtcVideoFrame(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer,
|
|
||||||
int64_t elapsed_time_ns,
|
|
||||||
int64_t time_stamp_ns);
|
|
||||||
|
|
||||||
~WebRtcVideoFrame();
|
~WebRtcVideoFrame();
|
||||||
|
|
||||||
// Creates a frame from a raw sample with FourCC "format" and size "w" x "h".
|
// Creates a frame from a raw sample with FourCC "format" and size "w" x "h".
|
||||||
@ -74,10 +69,6 @@ class WebRtcVideoFrame : public VideoFrame {
|
|||||||
void InitToEmptyBuffer(int w, int h, size_t pixel_width, size_t pixel_height,
|
void InitToEmptyBuffer(int w, int h, size_t pixel_width, size_t pixel_height,
|
||||||
int64_t time_stamp_ns);
|
int64_t time_stamp_ns);
|
||||||
|
|
||||||
// TODO(magjed): Remove once Chromium is updated.
|
|
||||||
bool InitToBlack(int w, int h, size_t pixel_width, size_t pixel_height,
|
|
||||||
int64_t elapsed_time_ns, int64_t time_stamp_ns);
|
|
||||||
|
|
||||||
bool InitToBlack(int w, int h, size_t pixel_width, size_t pixel_height,
|
bool InitToBlack(int w, int h, size_t pixel_width, size_t pixel_height,
|
||||||
int64_t time_stamp_ns) override;
|
int64_t time_stamp_ns) override;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user