| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 #ifndef WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_CVO_H_ | 10 #ifndef WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_CVO_H_ |
| 11 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_CVO_H_ | 11 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_CVO_H_ |
| 12 | 12 |
| 13 #include "webrtc/base/checks.h" |
| 13 #include "webrtc/common_video/rotation.h" | 14 #include "webrtc/common_video/rotation.h" |
| 14 | 15 |
| 15 namespace webrtc { | 16 namespace webrtc { |
| 16 | 17 |
| 17 // Please refer to http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/ | 18 // Please refer to http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/ |
| 18 // 12.07.00_60/ts_126114v120700p.pdf Section 7.4.5. The rotation of a frame is | 19 // 12.07.00_60/ts_126114v120700p.pdf Section 7.4.5. The rotation of a frame is |
| 19 // the clockwise angle the frames must be rotated in order to display the frames | 20 // the clockwise angle the frames must be rotated in order to display the frames |
| 20 // correctly if the display is rotated in its natural orientation. | 21 // correctly if the display is rotated in its natural orientation. |
| 21 inline uint8_t ConvertVideoRotationToCVOByte(VideoRotation rotation) { | 22 inline uint8_t ConvertVideoRotationToCVOByte(VideoRotation rotation) { |
| 22 switch (rotation) { | 23 switch (rotation) { |
| 23 case kVideoRotation_0: | 24 case kVideoRotation_0: |
| 24 return 0; | 25 return 0; |
| 25 case kVideoRotation_90: | 26 case kVideoRotation_90: |
| 26 return 1; | 27 return 1; |
| 27 case kVideoRotation_180: | 28 case kVideoRotation_180: |
| 28 return 2; | 29 return 2; |
| 29 case kVideoRotation_270: | 30 case kVideoRotation_270: |
| 30 return 3; | 31 return 3; |
| 31 } | 32 } |
| 32 assert(false); | 33 RTC_NOTREACHED(); |
| 33 return 0; | 34 return 0; |
| 34 } | 35 } |
| 35 | 36 |
| 36 inline VideoRotation ConvertCVOByteToVideoRotation(uint8_t rotation) { | 37 inline VideoRotation ConvertCVOByteToVideoRotation(uint8_t rotation) { |
| 37 switch (rotation) { | 38 switch (rotation) { |
| 38 case 0: | 39 case 0: |
| 39 return kVideoRotation_0; | 40 return kVideoRotation_0; |
| 40 case 1: | 41 case 1: |
| 41 return kVideoRotation_90; | 42 return kVideoRotation_90; |
| 42 case 2: | 43 case 2: |
| 43 return kVideoRotation_180; | 44 return kVideoRotation_180; |
| 44 break; | |
| 45 case 3: | 45 case 3: |
| 46 return kVideoRotation_270; | 46 return kVideoRotation_270; |
| 47 default: | 47 default: |
| 48 assert(false); | 48 RTC_NOTREACHED(); |
| 49 return kVideoRotation_0; | 49 return kVideoRotation_0; |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 | 52 |
| 53 } // namespace webrtc | 53 } // namespace webrtc |
| 54 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_CVO_H_ | 54 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_CVO_H_ |
| OLD | NEW |