MCPcopy Create free account
hub / github.com/alibaba/CicadaPlayer / ProcessVideoLoop

Method ProcessVideoLoop

mediaPlayer/SuperMediaPlayer.cpp:1204–1292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1202}
1203
1204void SuperMediaPlayer::ProcessVideoLoop()
1205{
1206 int64_t curTime = af_gettime_relative() / 1000;
1207 {
1208#ifndef NDEBUG
1209 int streamIds[] = {mCurrentVideoIndex, mCurrentAudioIndex, mCurrentSubtitleIndex,
1210 mWillChangedVideoStreamIndex, mWillChangedAudioStreamIndex, mWillChangedSubtitleStreamIndex};
1211 int size = sizeof(streamIds) / sizeof(streamIds[0]);
1212
1213 for (int i = 0; i < size; ++i) {
1214 for (int j = 0; j < size; ++j) {
1215 if (i != j && streamIds[i] >= 0) {
1216 assert(streamIds[i] != streamIds[j]);
1217 }
1218 }
1219 }
1220
1221#endif
1222 }
1223
1224 if (mSubPlayer) {
1225 mSubPlayer->onNoop();
1226 }
1227
1228 if ((PLAYER_COMPLETION != mPlayStatus && (mPlayStatus < PLAYER_PREPARING || mPlayStatus > PLAYER_PAUSED)) ||
1229 nullptr == mDemuxerService) {// not working
1230 if (curTime - mTimerLatestTime > mTimerInterval) {
1231 OnTimer(curTime);
1232 mTimerLatestTime = curTime;
1233 }
1234
1235 return;
1236 }
1237 doReadPacket();
1238 doDeCode();
1239
1240 // audio render will create after get a frame from decoder
1241
1242 if (mCanceled) {
1243 return;
1244 }
1245 setUpAVPath();
1246
1247 if (!DoCheckBufferPass()) {
1248 return;
1249 }
1250
1251 if (!mBRendingStart && mPlayStatus == PLAYER_PLAYING && !mBufferingFlag) {
1252 if ((mEof && (!HAVE_AUDIO || mAVDeviceManager->isAudioRenderValid()) && (!HAVE_VIDEO || mAVDeviceManager->isVideoRenderValid())) ||
1253 // render out the cache frame in renders
1254 ((!HAVE_VIDEO || !mVideoFrameQue.empty() || (APP_BACKGROUND == mAppStatus)) && (!HAVE_AUDIO || !mAudioFrameQue.empty()))) {
1255 startRendering(true);
1256 }
1257 }
1258
1259 doRender();
1260 if (mUtcTimer) {
1261 if (mFirstRendered) {

Callers

nothing calls this directly

Calls 9

af_gettime_relativeFunction · 0.85
assertClass · 0.85
af_getsteady_msFunction · 0.85
onNoopMethod · 0.80
isAudioRenderValidMethod · 0.80
isVideoRenderValidMethod · 0.80
GetPacketLastPTSMethod · 0.80
emptyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected