Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information. This CL was reviewed and approved in pieces in the following CLs: https://webrtc-codereview.appspot.com/24209004/ https://webrtc-codereview.appspot.com/24229004/ https://webrtc-codereview.appspot.com/24259004/ https://webrtc-codereview.appspot.com/25109004/ https://webrtc-codereview.appspot.com/26099004/ https://webrtc-codereview.appspot.com/27069004/ https://webrtc-codereview.appspot.com/27969004/ https://webrtc-codereview.appspot.com/27989004/ https://webrtc-codereview.appspot.com/29009004/ https://webrtc-codereview.appspot.com/30929004/ https://webrtc-codereview.appspot.com/30939004/ https://webrtc-codereview.appspot.com/31999004/ Committing as TBR to the original reviewers. BUG=chromium:81439 TEST=none TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom Review URL: https://webrtc-codereview.appspot.com/23129004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -10,6 +10,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "webrtc/base/format_macros.h"
|
||||
#include "webrtc/modules/media_file/source/media_file_impl.h"
|
||||
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/interface/file_wrapper.h"
|
||||
@ -109,25 +110,25 @@ int32_t MediaFileImpl::Process()
|
||||
|
||||
int32_t MediaFileImpl::PlayoutAVIVideoData(
|
||||
int8_t* buffer,
|
||||
uint32_t& dataLengthInBytes)
|
||||
size_t& dataLengthInBytes)
|
||||
{
|
||||
return PlayoutData( buffer, dataLengthInBytes, true);
|
||||
}
|
||||
|
||||
int32_t MediaFileImpl::PlayoutAudioData(int8_t* buffer,
|
||||
uint32_t& dataLengthInBytes)
|
||||
size_t& dataLengthInBytes)
|
||||
{
|
||||
return PlayoutData( buffer, dataLengthInBytes, false);
|
||||
}
|
||||
|
||||
int32_t MediaFileImpl::PlayoutData(int8_t* buffer, uint32_t& dataLengthInBytes,
|
||||
int32_t MediaFileImpl::PlayoutData(int8_t* buffer, size_t& dataLengthInBytes,
|
||||
bool video)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceStream, kTraceFile, _id,
|
||||
"MediaFileImpl::PlayoutData(buffer= 0x%x, bufLen= %ld)",
|
||||
"MediaFileImpl::PlayoutData(buffer= 0x%x, bufLen= %" PRIuS ")",
|
||||
buffer, dataLengthInBytes);
|
||||
|
||||
const uint32_t bufferLengthInBytes = dataLengthInBytes;
|
||||
const size_t bufferLengthInBytes = dataLengthInBytes;
|
||||
dataLengthInBytes = 0;
|
||||
|
||||
if(buffer == NULL || bufferLengthInBytes == 0)
|
||||
@ -185,7 +186,7 @@ int32_t MediaFileImpl::PlayoutData(int8_t* buffer, uint32_t& dataLengthInBytes,
|
||||
bufferLengthInBytes);
|
||||
if(bytesRead > 0)
|
||||
{
|
||||
dataLengthInBytes = bytesRead;
|
||||
dataLengthInBytes = static_cast<size_t>(bytesRead);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
@ -216,7 +217,7 @@ int32_t MediaFileImpl::PlayoutData(int8_t* buffer, uint32_t& dataLengthInBytes,
|
||||
|
||||
if( bytesRead > 0)
|
||||
{
|
||||
dataLengthInBytes =(uint32_t) bytesRead;
|
||||
dataLengthInBytes = static_cast<size_t>(bytesRead);
|
||||
}
|
||||
}
|
||||
HandlePlayCallbacks(bytesRead);
|
||||
@ -266,16 +267,16 @@ void MediaFileImpl::HandlePlayCallbacks(int32_t bytesRead)
|
||||
int32_t MediaFileImpl::PlayoutStereoData(
|
||||
int8_t* bufferLeft,
|
||||
int8_t* bufferRight,
|
||||
uint32_t& dataLengthInBytes)
|
||||
size_t& dataLengthInBytes)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceStream, kTraceFile, _id,
|
||||
"MediaFileImpl::PlayoutStereoData(Left = 0x%x, Right = 0x%x,\
|
||||
Len= %ld)",
|
||||
"MediaFileImpl::PlayoutStereoData(Left = 0x%x, Right = 0x%x,"
|
||||
" Len= %" PRIuS ")",
|
||||
bufferLeft,
|
||||
bufferRight,
|
||||
dataLengthInBytes);
|
||||
|
||||
const uint32_t bufferLengthInBytes = dataLengthInBytes;
|
||||
const size_t bufferLengthInBytes = dataLengthInBytes;
|
||||
dataLengthInBytes = 0;
|
||||
|
||||
if(bufferLeft == NULL || bufferRight == NULL || bufferLengthInBytes == 0)
|
||||
@ -328,7 +329,7 @@ int32_t MediaFileImpl::PlayoutStereoData(
|
||||
|
||||
if(bytesRead > 0)
|
||||
{
|
||||
dataLengthInBytes = bytesRead;
|
||||
dataLengthInBytes = static_cast<size_t>(bytesRead);
|
||||
|
||||
// Check if it's time for PlayNotification(..).
|
||||
_playoutPositionMs = _ptrFileUtilityObj->PlayoutPositionMs();
|
||||
@ -690,25 +691,25 @@ bool MediaFileImpl::IsPlaying()
|
||||
|
||||
int32_t MediaFileImpl::IncomingAudioData(
|
||||
const int8_t* buffer,
|
||||
const uint32_t bufferLengthInBytes)
|
||||
const size_t bufferLengthInBytes)
|
||||
{
|
||||
return IncomingAudioVideoData( buffer, bufferLengthInBytes, false);
|
||||
}
|
||||
|
||||
int32_t MediaFileImpl::IncomingAVIVideoData(
|
||||
const int8_t* buffer,
|
||||
const uint32_t bufferLengthInBytes)
|
||||
const size_t bufferLengthInBytes)
|
||||
{
|
||||
return IncomingAudioVideoData( buffer, bufferLengthInBytes, true);
|
||||
}
|
||||
|
||||
int32_t MediaFileImpl::IncomingAudioVideoData(
|
||||
const int8_t* buffer,
|
||||
const uint32_t bufferLengthInBytes,
|
||||
const size_t bufferLengthInBytes,
|
||||
const bool video)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceStream, kTraceFile, _id,
|
||||
"MediaFile::IncomingData(buffer= 0x%x, bufLen= %hd",
|
||||
"MediaFile::IncomingData(buffer= 0x%x, bufLen= %" PRIuS,
|
||||
buffer, bufferLengthInBytes);
|
||||
|
||||
if(buffer == NULL || bufferLengthInBytes == 0)
|
||||
@ -803,7 +804,7 @@ int32_t MediaFileImpl::IncomingAudioVideoData(
|
||||
{
|
||||
if(_ptrOutStream->Write(buffer, bufferLengthInBytes))
|
||||
{
|
||||
bytesWritten = bufferLengthInBytes;
|
||||
bytesWritten = static_cast<int32_t>(bufferLengthInBytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user