Merge "Fix cert-dcl16-c clang-tidy warnings in libmediaplayer2." am: b13d332cf6 am: 981c2e3268

am: e6c208f5c4

Change-Id: Ib0b63974f20965a59c771343eaf1f647c5cb17ec
gugelfrei
Chih-hung Hsieh 6 years ago committed by android-build-merger
commit cf80f34cc5

@ -273,10 +273,10 @@ void NuPlayer2::HTTPLiveSource2::pollForRawData(
if (fetchType == LiveSession::STREAMTYPE_SUBTITLES) {
notify->post();
msg->post(delayUs > 0ll ? delayUs : 0ll);
msg->post(delayUs > 0LL ? delayUs : 0LL);
return;
} else if (fetchType == LiveSession::STREAMTYPE_METADATA) {
if (delayUs < -1000000ll) { // 1 second
if (delayUs < -1000000LL) { // 1 second
continue;
}
notify->post();
@ -288,7 +288,7 @@ void NuPlayer2::HTTPLiveSource2::pollForRawData(
}
// try again in 1 second
msg->post(1000000ll);
msg->post(1000000LL);
}
void NuPlayer2::HTTPLiveSource2::onMessageReceived(const sp<AMessage> &msg) {

@ -926,7 +926,7 @@ void NuPlayer2::onMessageReceived(const sp<AMessage> &msg) {
}
}
msg->post(1000000ll); // poll again in a second.
msg->post(1000000LL); // poll again in a second.
break;
}
@ -1194,7 +1194,7 @@ void NuPlayer2::onMessageReceived(const sp<AMessage> &msg) {
}
if (rescan) {
msg->post(100000ll);
msg->post(100000LL);
mScanSourcesPending = true;
}
break;
@ -2870,7 +2870,7 @@ void NuPlayer2::onSourceNotify(const sp<AMessage> &msg) {
int64_t posMs;
int64_t timeUs, posUs;
driver->getCurrentPosition(&posMs);
posUs = posMs * 1000ll;
posUs = posMs * 1000LL;
CHECK(buffer->meta()->findInt64("timeUs", &timeUs));
if (posUs < timeUs) {

@ -567,7 +567,7 @@ void NuPlayer2::CCDecoder::display(int64_t timeUs) {
ccBuf->meta()->setInt32(AMEDIAFORMAT_KEY_TRACK_INDEX, mSelectedTrack);
ccBuf->meta()->setInt64("timeUs", timeUs);
ccBuf->meta()->setInt64("durationUs", 0ll);
ccBuf->meta()->setInt64("durationUs", 0LL);
sp<AMessage> msg = mNotify->dup();
msg->setInt32("what", kWhatClosedCaptionData);

@ -71,10 +71,10 @@ NuPlayer2::Decoder::Decoder(
mCCDecoder(ccDecoder),
mPid(pid),
mUid(uid),
mSkipRenderingUntilMediaTimeUs(-1ll),
mNumFramesTotal(0ll),
mNumInputFramesDropped(0ll),
mNumOutputFramesDropped(0ll),
mSkipRenderingUntilMediaTimeUs(-1LL),
mNumFramesTotal(0LL),
mNumInputFramesDropped(0LL),
mNumOutputFramesDropped(0LL),
mVideoWidth(0),
mVideoHeight(0),
mIsAudio(true),
@ -428,10 +428,10 @@ void NuPlayer2::Decoder::onSetParameters(const sp<AMessage> &params) {
// TODO: For now, layer fps is calculated for some specific architectures.
// But it really should be extracted from the stream.
mVideoTemporalLayerAggregateFps[0] =
mFrameRateTotal / (float)(1ll << (mNumVideoTemporalLayerTotal - 1));
mFrameRateTotal / (float)(1LL << (mNumVideoTemporalLayerTotal - 1));
for (int32_t i = 1; i < mNumVideoTemporalLayerTotal; ++i) {
mVideoTemporalLayerAggregateFps[i] =
mFrameRateTotal / (float)(1ll << (mNumVideoTemporalLayerTotal - i))
mFrameRateTotal / (float)(1LL << (mNumVideoTemporalLayerTotal - i))
+ mVideoTemporalLayerAggregateFps[i - 1];
}
}
@ -952,7 +952,7 @@ status_t NuPlayer2::Decoder::fetchInputData(sp<AMessage> &reply) {
int32_t layerId = 0;
bool haveLayerId = accessUnit->meta()->findInt32("temporal-layer-id", &layerId);
if (mRenderer->getVideoLateByUs() > 100000ll
if (mRenderer->getVideoLateByUs() > 100000LL
&& mIsVideoAVC
&& !IsAVCReferenceFrame(accessUnit)) {
dropAccessUnit = true;

@ -122,7 +122,7 @@ void NuPlayer2::DecoderBase::onRequestInputBuffers() {
mRequestInputBuffersPending = true;
sp<AMessage> msg = new AMessage(kWhatRequestInputBuffers, this);
msg->post(10 * 1000ll);
msg->post(10 * 1000LL);
}
}

@ -46,7 +46,7 @@ NuPlayer2::DecoderPassThrough::DecoderPassThrough(
: DecoderBase(notify),
mSource(source),
mRenderer(renderer),
mSkipRenderingUntilMediaTimeUs(-1ll),
mSkipRenderingUntilMediaTimeUs(-1LL),
mReachedEOS(true),
mPendingAudioErr(OK),
mPendingBuffersToDrain(0),

@ -372,7 +372,7 @@ status_t NuPlayer2Driver::seekTo(int64_t msec, MediaPlayer2SeekMode mode) {
ALOGD("seekTo(%p) (%lld ms, %d) at state %d", this, (long long)msec, mode, mState);
Mutex::Autolock autoLock(mLock);
int64_t seekTimeUs = msec * 1000ll;
int64_t seekTimeUs = msec * 1000LL;
switch (mState) {
case STATE_PREPARED:
@ -426,7 +426,7 @@ status_t NuPlayer2Driver::getDuration(int64_t *msec) {
return UNKNOWN_ERROR;
}
*msec = (mDurationUs + 500ll) / 1000;
*msec = (mDurationUs + 500LL) / 1000;
return OK;
}
@ -612,7 +612,7 @@ status_t NuPlayer2Driver::invoke(const PlayerMessage &request, PlayerMessage *re
int64_t msec = 0;
// getCurrentPosition should always return OK
getCurrentPosition(&msec);
return mPlayer->selectTrack(trackIndex, true /* select */, msec * 1000ll);
return mPlayer->selectTrack(trackIndex, true /* select */, msec * 1000LL);
}
case MEDIA_PLAYER2_INVOKE_ID_UNSELECT_TRACK:

@ -67,10 +67,10 @@ static inline int32_t getAudioSinkPcmMsSetting() {
// Maximum time in paused state when offloading audio decompression. When elapsed, the AudioSink
// is closed to allow the audio DSP to power down.
static const int64_t kOffloadPauseMaxUs = 10000000ll;
static const int64_t kOffloadPauseMaxUs = 10000000LL;
// Maximum allowed delay from AudioSink, 1.5 seconds.
static const int64_t kMaxAllowedAudioSinkDelayUs = 1500000ll;
static const int64_t kMaxAllowedAudioSinkDelayUs = 1500000LL;
static const int64_t kMinimumAudioClockUpdatePeriodUs = 20 /* msec */ * 1000;
@ -84,7 +84,7 @@ const NuPlayer2::Renderer::PcmInfo NuPlayer2::Renderer::AUDIO_PCMINFO_INITIALIZE
};
// static
const int64_t NuPlayer2::Renderer::kMinPositionUpdateDelayUs = 100000ll;
const int64_t NuPlayer2::Renderer::kMinPositionUpdateDelayUs = 100000LL;
NuPlayer2::Renderer::Renderer(
const sp<MediaPlayer2Interface::AudioSink> &sink,
@ -108,7 +108,7 @@ NuPlayer2::Renderer::Renderer(
mAudioFirstAnchorTimeMediaUs(-1),
mAnchorTimeMediaUs(-1),
mAnchorNumFramesWritten(-1),
mVideoLateByUs(0ll),
mVideoLateByUs(0LL),
mNextVideoTimeMediaUs(-1),
mHasAudio(false),
mHasVideo(false),
@ -1142,7 +1142,7 @@ int64_t NuPlayer2::Renderer::getPendingAudioPlayoutDurationUs(int64_t nowUs) {
int64_t nowUs = ALooper::GetNowUs();
int64_t mediaUs;
if (mMediaClock->getMediaTime(nowUs, &mediaUs) != OK) {
return 0ll;
return 0LL;
} else {
return writtenAudioDurationUs - (mediaUs - mAudioFirstAnchorTimeMediaUs);
}
@ -1357,7 +1357,7 @@ void NuPlayer2::Renderer::onDrainVideoQueue() {
tooLate = false;
}
entry->mNotifyConsumed->setInt64("timestampNs", realTimeUs * 1000ll);
entry->mNotifyConsumed->setInt64("timestampNs", realTimeUs * 1000LL);
entry->mNotifyConsumed->setInt32("render", !tooLate);
entry->mNotifyConsumed->post();
mVideoQueue.erase(mVideoQueue.begin());
@ -1489,7 +1489,7 @@ void NuPlayer2::Renderer::onQueueBuffer(const sp<AMessage> &msg) {
ALOGV("queueDiff = %.2f secs", diff / 1E6);
if (diff > 100000ll) {
if (diff > 100000LL) {
// Audio data starts More than 0.1 secs before video.
// Drop some audio.

@ -30,7 +30,7 @@
namespace android {
const int64_t kNearEOSTimeoutUs = 2000000ll; // 2 secs
const int64_t kNearEOSTimeoutUs = 2000000LL; // 2 secs
// Default Buffer Underflow/Prepare/StartServer/Overflow Marks
static const int kUnderflowMarkMs = 1000; // 1 second
@ -168,7 +168,7 @@ bool NuPlayer2::RTSPSource2::haveSufficientDataOnAllTracks() {
// We're going to buffer at least 2 secs worth data on all tracks before
// starting playback (both at startup and after a seek).
static const int64_t kMinDurationUs = 2000000ll;
static const int64_t kMinDurationUs = 2000000LL;
int64_t mediaDurationUs = 0;
getDuration(&mediaDurationUs);
@ -272,7 +272,7 @@ void NuPlayer2::RTSPSource2::setEOSTimeout(bool audio, int64_t timeout) {
}
status_t NuPlayer2::RTSPSource2::getDuration(int64_t *durationUs) {
*durationUs = -1ll;
*durationUs = -1LL;
int64_t audioDurationUs;
if (mAudioTrack != NULL
@ -321,7 +321,7 @@ void NuPlayer2::RTSPSource2::performSeek(int64_t seekTimeUs) {
void NuPlayer2::RTSPSource2::schedulePollBuffering() {
sp<AMessage> msg = new AMessage(kWhatPollBuffering, this);
msg->post(1000000ll); // 1 second intervals
msg->post(1000000LL); // 1 second intervals
}
void NuPlayer2::RTSPSource2::checkBuffering(
@ -345,10 +345,10 @@ void NuPlayer2::RTSPSource2::checkBuffering(
int64_t maxRebufferingMarkUs;
{
Mutex::Autolock _l(mBufferingSettingsLock);
initialMarkUs = mBufferingSettings.mInitialMarkMs * 1000ll;
initialMarkUs = mBufferingSettings.mInitialMarkMs * 1000LL;
// TODO: maxRebufferingMarkUs could be larger than
// mBufferingSettings.mResumePlaybackMarkMs * 1000ll.
maxRebufferingMarkUs = mBufferingSettings.mResumePlaybackMarkMs * 1000ll;
maxRebufferingMarkUs = mBufferingSettings.mResumePlaybackMarkMs * 1000LL;
}
// isFinished when duration is 0 checks for EOS result only
if (bufferedDurationUs > initialMarkUs
@ -368,7 +368,7 @@ void NuPlayer2::RTSPSource2::checkBuffering(
++overflowCount;
}
int64_t startServerMarkUs =
(kUnderflowMarkMs * 1000ll + maxRebufferingMarkUs) / 2;
(kUnderflowMarkMs * 1000LL + maxRebufferingMarkUs) / 2;
if (bufferedDurationUs < startServerMarkUs) {
++startCount;
}
@ -639,7 +639,7 @@ void NuPlayer2::RTSPSource2::onMessageReceived(const sp<AMessage> &msg) {
int64_t nptUs =
((double)rtpTime - (double)info->mRTPTime)
/ info->mTimeScale
* 1000000ll
* 1000000LL
+ info->mNormalPlaytimeUs;
accessUnit->meta()->setInt64("timeUs", nptUs);
@ -747,7 +747,7 @@ void NuPlayer2::RTSPSource2::onConnected() {
TrackInfo info;
info.mTimeScale = timeScale;
info.mRTPTime = 0;
info.mNormalPlaytimeUs = 0ll;
info.mNormalPlaytimeUs = 0LL;
info.mNPTMappingValid = false;
if ((isAudio && mAudioTrack == NULL)

Loading…
Cancel
Save