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

Unified Diff: talk/media/devices/filevideocapturer.cc

Issue 1362503003: Use suffixed {uint,int}{8,16,32,64}_t types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: google::int32 Created 5 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
Index: talk/media/devices/filevideocapturer.cc
diff --git a/talk/media/devices/filevideocapturer.cc b/talk/media/devices/filevideocapturer.cc
index 6025d6dd40cf5327b3aeb6242a1ada7e2dd6f8e8..15c48fc66d43b5b2761e41092f1770c199cc31fc 100644
--- a/talk/media/devices/filevideocapturer.cc
+++ b/talk/media/devices/filevideocapturer.cc
@@ -60,7 +60,7 @@ bool VideoRecorder::RecordFrame(const CapturedFrame& frame) {
return false;
}
- uint32 size = 0;
+ uint32_t size = 0;
if (!frame.GetDataSize(&size)) {
LOG(LS_ERROR) << "Unable to calculate the data size of the frame";
return false;
@@ -156,7 +156,7 @@ class FileVideoCapturer::FileReadThread
/////////////////////////////////////////////////////////////////////
// Implementation of class FileVideoCapturer
/////////////////////////////////////////////////////////////////////
-static const int64 kNumNanoSecsPerMilliSec = 1000000;
+static const int64_t kNumNanoSecsPerMilliSec = 1000000;
const char* FileVideoCapturer::kVideoFileDevicePrefix = "video-file:";
FileVideoCapturer::FileVideoCapturer()
@@ -243,8 +243,7 @@ CaptureState FileVideoCapturer::Start(const VideoFormat& capture_format) {
SetCaptureFormat(&capture_format);
// Create a thread to read the file.
file_read_thread_ = new FileReadThread(this);
- start_time_ns_ = kNumNanoSecsPerMilliSec *
- static_cast<int64>(rtc::Time());
+ start_time_ns_ = kNumNanoSecsPerMilliSec * static_cast<int64_t>(rtc::Time());
bool ret = file_read_thread_->Start();
if (ret) {
LOG(LS_INFO) << "File video capturer '" << GetId() << "' started";
@@ -268,7 +267,7 @@ void FileVideoCapturer::Stop() {
SetCaptureFormat(NULL);
}
-bool FileVideoCapturer::GetPreferredFourccs(std::vector<uint32>* fourccs) {
+bool FileVideoCapturer::GetPreferredFourccs(std::vector<uint32_t>* fourccs) {
if (!fourccs) {
return false;
}
@@ -297,13 +296,13 @@ rtc::StreamResult FileVideoCapturer::ReadFrameHeader(
return rtc::SR_EOS;
}
rtc::ByteBuffer buffer(header, CapturedFrame::kFrameHeaderSize);
- buffer.ReadUInt32(reinterpret_cast<uint32*>(&frame->width));
- buffer.ReadUInt32(reinterpret_cast<uint32*>(&frame->height));
+ buffer.ReadUInt32(reinterpret_cast<uint32_t*>(&frame->width));
+ buffer.ReadUInt32(reinterpret_cast<uint32_t*>(&frame->height));
buffer.ReadUInt32(&frame->fourcc);
buffer.ReadUInt32(&frame->pixel_width);
buffer.ReadUInt32(&frame->pixel_height);
- buffer.ReadUInt64(reinterpret_cast<uint64*>(&frame->elapsed_time));
- buffer.ReadUInt64(reinterpret_cast<uint64*>(&frame->time_stamp));
+ buffer.ReadUInt64(reinterpret_cast<uint64_t*>(&frame->elapsed_time));
+ buffer.ReadUInt64(reinterpret_cast<uint64_t*>(&frame->time_stamp));
buffer.ReadUInt32(&frame->data_size);
}
@@ -312,12 +311,12 @@ rtc::StreamResult FileVideoCapturer::ReadFrameHeader(
// Executed in the context of FileReadThread.
bool FileVideoCapturer::ReadFrame(bool first_frame, int* wait_time_ms) {
- uint32 start_read_time_ms = rtc::Time();
+ uint32_t start_read_time_ms = rtc::Time();
// 1. Signal the previously read frame to downstream.
if (!first_frame) {
- captured_frame_.time_stamp = kNumNanoSecsPerMilliSec *
- static_cast<int64>(start_read_time_ms);
+ captured_frame_.time_stamp =
+ kNumNanoSecsPerMilliSec * static_cast<int64_t>(start_read_time_ms);
captured_frame_.elapsed_time = captured_frame_.time_stamp - start_time_ns_;
SignalFrameCaptured(this, &captured_frame_);
}
@@ -367,10 +366,10 @@ bool FileVideoCapturer::ReadFrame(bool first_frame, int* wait_time_ms) {
// control the rate; otherwise, we use the timestamp in the file to control
// the rate.
if (!first_frame && !ignore_framerate_) {
- int64 interval_ns =
- GetCaptureFormat()->interval > VideoFormat::kMinimumInterval ?
- GetCaptureFormat()->interval :
- captured_frame_.time_stamp - last_frame_timestamp_ns_;
+ int64_t interval_ns =
+ GetCaptureFormat()->interval > VideoFormat::kMinimumInterval
+ ? GetCaptureFormat()->interval
+ : captured_frame_.time_stamp - last_frame_timestamp_ns_;
int interval_ms = static_cast<int>(interval_ns / kNumNanoSecsPerMilliSec);
interval_ms -= rtc::Time() - start_read_time_ms;
if (interval_ms > 0) {

Powered by Google App Engine
This is Rietveld 408576698