MCPcopy Create free account
hub / github.com/TASEmulators/fceux / aviRecordAddFrame

Function aviRecordAddFrame

src/drivers/Qt/AviRecord.cpp:2344–2393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2342}
2343//**************************************************************************************
2344int aviRecordAddFrame( void )
2345{
2346 if ( !recordEnable )
2347 {
2348 return -1;
2349 }
2350
2351 //if ( gwavi == NULL )
2352 //{
2353 // return -1;
2354 //}
2355 if ( FCEUI_EmulationPaused() )
2356 {
2357 return 0;
2358 }
2359
2360 int i, head, numPixels, availSize;
2361
2362 numPixels = nes_shm->video.ncol * nes_shm->video.nrow;
2363
2364 availSize = (vbufTail - vbufHead);
2365 if ( availSize <= 0 )
2366 {
2367 availSize += vbufSize;
2368 }
2369
2370 while ( numPixels > availSize )
2371 {
2372 //printf("Video Unavail %i \n", availSize );
2373 msleep(1);
2374
2375 availSize = (vbufTail - vbufHead);
2376 if ( availSize <= 0 )
2377 {
2378 availSize += vbufSize;
2379 }
2380 }
2381
2382 i = 0; head = vbufHead;
2383
2384 while ( i < numPixels )
2385 {
2386 rawVideoBuf[ head ] = nes_shm->avibuf[i]; i++;
2387
2388 head = (head + 1) % vbufSize;
2389 }
2390 vbufHead = head;
2391
2392 return 0;
2393}
2394//**************************************************************************************
2395int aviRecordAddAudioFrame( int32_t *buf, int numSamples )
2396{

Callers 1

FCEUI_AviVideoUpdateFunction · 0.85

Calls 2

FCEUI_EmulationPausedFunction · 0.85
msleepFunction · 0.85

Tested by

no test coverage detected