Cleanup: unify rotation to be enum based instead of int for degree.
Split from https://webrtc-codereview.appspot.com/37029004/ BUG=4145 R=pthatcher@webrtc.org, stefan@webrtc.org Review URL: https://webrtc-codereview.appspot.com/37129004 Cr-Commit-Position: refs/heads/master@{#8257} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8257 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
33
webrtc/common_video/rotation.h
Normal file
33
webrtc/common_video/rotation.h
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_COMMON_VIDEO_ROTATION_H_
|
||||
#define WEBRTC_COMMON_VIDEO_ROTATION_H_
|
||||
|
||||
#include "webrtc/base/common.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// enum for clockwise rotation.
|
||||
enum VideoFrameRotation {
|
||||
VideoFrameRotation_0 = 0,
|
||||
VideoFrameRotation_90 = 90,
|
||||
VideoFrameRotation_180 = 180,
|
||||
VideoFrameRotation_270 = 270
|
||||
};
|
||||
|
||||
inline VideoFrameRotation ClockwiseRotationFromDegree(int rotation) {
|
||||
ASSERT(rotation == 0 || rotation == 90 || rotation == 180 || rotation == 270);
|
||||
return static_cast<webrtc::VideoFrameRotation>(rotation);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_COMMON_VIDEO_ROTATION_H_
|
||||
Reference in New Issue
Block a user