git-svn-id: http://webrtc.googlecode.com/svn/trunk@2916 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -16,7 +16,6 @@
|
|||||||
#define WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_SCALER_H_
|
#define WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_SCALER_H_
|
||||||
|
|
||||||
#include "common_video/libyuv/include/webrtc_libyuv.h"
|
#include "common_video/libyuv/include/webrtc_libyuv.h"
|
||||||
#include "common_video/interface/i420_video_frame.h"
|
|
||||||
#include "typedefs.h"
|
#include "typedefs.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
@@ -48,13 +47,9 @@ class Scaler {
|
|||||||
// Return value: 0 - OK,
|
// Return value: 0 - OK,
|
||||||
// -1 - parameter error
|
// -1 - parameter error
|
||||||
// -2 - scaler not set
|
// -2 - scaler not set
|
||||||
// TODO(mikhal): Remove legacy implementation of old VideoFrame.
|
|
||||||
int Scale(const VideoFrame& src_frame,
|
int Scale(const VideoFrame& src_frame,
|
||||||
VideoFrame* dst_frame);
|
VideoFrame* dst_frame);
|
||||||
|
|
||||||
int Scale(const I420VideoFrame& src_frame,
|
|
||||||
I420VideoFrame* dst_frame);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Determine if the VideoTypes are currently supported.
|
// Determine if the VideoTypes are currently supported.
|
||||||
bool SupportedVideoType(VideoType src_video_type,
|
bool SupportedVideoType(VideoType src_video_type,
|
||||||
|
@@ -84,35 +84,6 @@ int Scaler::Scale(const VideoFrame& src_frame,
|
|||||||
libyuv::FilterMode(method_));
|
libyuv::FilterMode(method_));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO(mikhal): Add test to new function. Currently not used.
|
|
||||||
int Scaler::Scale(const I420VideoFrame& src_frame,
|
|
||||||
I420VideoFrame* dst_frame) {
|
|
||||||
assert(dst_frame);
|
|
||||||
// TODO(mikhal): Add isEmpty
|
|
||||||
// if (src_frame.Buffer() == NULL || src_frame.Length() == 0)
|
|
||||||
// return -1;
|
|
||||||
if (!set_)
|
|
||||||
return -2;
|
|
||||||
|
|
||||||
// TODO(mikhal): Setting stride equal to width - should align.
|
|
||||||
dst_frame->CreateEmptyFrame(dst_width_, dst_height_, dst_width_ ,
|
|
||||||
(dst_width_ + 1) / 2, (dst_width_ + 1) / 2);
|
|
||||||
|
|
||||||
return libyuv::I420Scale(src_frame.buffer(kYPlane), src_frame.stride(kYPlane),
|
|
||||||
src_frame.buffer(kUPlane), src_frame.stride(kYPlane),
|
|
||||||
src_frame.buffer(kVPlane), src_frame.stride(kYPlane),
|
|
||||||
src_width_, src_height_,
|
|
||||||
dst_frame->buffer(kYPlane),
|
|
||||||
dst_frame->stride(kYPlane),
|
|
||||||
dst_frame->buffer(kYPlane),
|
|
||||||
dst_frame->stride(kYPlane),
|
|
||||||
dst_frame->buffer(kYPlane),
|
|
||||||
dst_frame->stride(kYPlane),
|
|
||||||
dst_width_, dst_height_,
|
|
||||||
libyuv::FilterMode(method_));
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(mikhal): Add support for more types.
|
// TODO(mikhal): Add support for more types.
|
||||||
bool Scaler::SupportedVideoType(VideoType src_video_type,
|
bool Scaler::SupportedVideoType(VideoType src_video_type,
|
||||||
VideoType dst_video_type) {
|
VideoType dst_video_type) {
|
||||||
|
Reference in New Issue
Block a user