pkasting@chromium.org
2014-11-20 22:28:14 +00:00
parent edc6e57a92
commit 4591fbd09f
341 changed files with 2610 additions and 2613 deletions

View File

@ -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);
}
}
}