Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(622)

Unified Diff: webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCEncodedImage.mm

Issue 3009293002: ObjC EncodedImage: Use fixed width integer types (Closed)
Patch Set: Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCEncodedImage.mm
diff --git a/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCEncodedImage.mm b/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCEncodedImage.mm
index 3c39acb38effadb8800c43071859ff6cae8c5250..1c8a27bf43ed5b28485245a0b11dfe75ef01527a 100644
--- a/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCEncodedImage.mm
+++ b/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCEncodedImage.mm
@@ -12,6 +12,8 @@
#import "RTCVideoCodec+Private.h"
+#include "webrtc/rtc_base/safe_conversions.h"
+
@implementation RTCEncodedImage
@synthesize buffer = _buffer;
@@ -35,16 +37,16 @@
_buffer = [NSData dataWithBytesNoCopy:encodedImage._buffer
length:encodedImage._length
freeWhenDone:NO];
- _encodedWidth = encodedImage._encodedWidth;
- _encodedHeight = encodedImage._encodedHeight;
+ _encodedWidth = rtc::dchecked_cast<int32_t>(encodedImage._encodedWidth);
+ _encodedHeight = rtc::dchecked_cast<int32_t>(encodedImage._encodedHeight);
_timeStamp = encodedImage._timeStamp;
_captureTimeMs = encodedImage.capture_time_ms_;
_ntpTimeMs = encodedImage.ntp_time_ms_;
_flags = encodedImage.timing_.flags;
_encodeStartMs = encodedImage.timing_.encode_start_ms;
_encodeFinishMs = encodedImage.timing_.encode_finish_ms;
- _frameType = (RTCFrameType)encodedImage._frameType;
- _rotation = encodedImage.rotation_;
+ _frameType = static_cast<RTCFrameType>(encodedImage._frameType);
+ _rotation = static_cast<RTCVideoRotation>(encodedImage.rotation_);
_completeFrame = encodedImage._completeFrame;
_qp = encodedImage.qp_ == -1 ? nil : @(encodedImage.qp_);
_contentType = (encodedImage.content_type_ == webrtc::VideoContentType::SCREENSHARE) ?
@@ -59,8 +61,8 @@
// Return the pointer without copying.
webrtc::EncodedImage encodedImage(
(uint8_t *)_buffer.bytes, (size_t)_buffer.length, (size_t)_buffer.length);
- encodedImage._encodedWidth = _encodedWidth;
- encodedImage._encodedHeight = _encodedHeight;
+ encodedImage._encodedWidth = rtc::dchecked_cast<uint32_t>(_encodedWidth);
+ encodedImage._encodedHeight = rtc::dchecked_cast<uint32_t>(_encodedHeight);
encodedImage._timeStamp = _timeStamp;
encodedImage.capture_time_ms_ = _captureTimeMs;
encodedImage.ntp_time_ms_ = _ntpTimeMs;
« no previous file with comments | « no previous file | webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698