本文整理匯總了C++中ADM_info函數的典型用法代碼示例。如果您正苦於以下問題:C++ ADM_info函數的具體用法?C++ ADM_info怎麽用?C++ ADM_info使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ADM_info函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: ADM_warning
/**
\fn switchToSegment
\brief Switch to the segment given as argument
*/
bool ADM_Composer::switchToSegment(uint32_t s,bool dontdecode)
{
if(s+1>_segments.getNbSegments())
{
ADM_warning("Cannot switch to segment:%"PRIu32"\n",s);
return false;
}
_SEGMENT *seg=_segments.getSegment(s);
ADM_assert(seg);
ADM_info("Trying to switch to seg %"PRIu32" with startTime in reference pic= %"PRIu32" ms\n",s,seg->_refStartTimeUs/1000);
// If the refStartTime is 0, it is the first image
// But the fist image might not be = 0
_VIDEOS *vid=_segments.getRefVideo(seg->_reference);
vidHeader *demuxer=vid->_aviheader;
ADM_assert(vid);
uint64_t from=seg->_refStartTimeUs;
uint64_t pts,dts;
if(!from) from=vid->firstFramePts;
if(false==seektoTime(seg->_reference,from,dontdecode))
{
ADM_warning("Cannot seek to beginning of segment %"PRIu32" at %"PRIu64" ms\n",s,from/1000);
return false;
}
_currentSegment=s;
ADM_info("Switched ok to segment %"PRIu32" (dontdecode=%d)\n",s,dontdecode);
return true;
}
示例2: ADM_info
bool ADM_Composer::addToUndoQueue(void)
{
// truncate the dead branch first if we add a new element to the undo queue after _cnt-1 undo steps
if(_cnt>1 && undoQueue.size()>1)
{
for(uint32_t i=0;i<_cnt;i++)
{
undoQueue.pop_back();
}
ADM_info("Deleted last %d elements from the undo queue\n",_cnt);
}
// now populate the new element...
undoQueueElem rec;
uint64_t a=getMarkerAPts();
uint64_t b=getMarkerBPts();
rec.segm=_segments.getSegments();
rec.markerA=a;
rec.markerB=b;
// ...do some housekeeping...
uint32_t m=maxUndoSteps;
if(m<10) m=10; // less than 10 undo steps is a bad idea, ignore the limit then
uint32_t nb=undoQueue.size();
if(nb>m)
{
// erase the oldest records if the limit is exceeded and create space for a new one
undoQueue.erase(undoQueue.begin(),undoQueue.begin()+nb-m+1);
}
// ...and store the new element in the queue
undoQueue.push_back(rec);
ADM_info("The undo queue has now %d element(s)\n",undoQueue.size());
_cnt=0; // redo should not be available after a new undo-able action has been performed
return true;
}
示例3: use
/**
\fn setupAudio
\brief create the audio streams we will use (copy/process)
*/
bool admSaver::setupAudio()
{
bool r=true;
ADM_info("Setting up %d audio track(s)\n",nbAudioTracks);
for(int i=0;i<nbAudioTracks;i++)
{
EditableAudioTrack *ed=video_body->getEditableAudioTrackAt(i);
ADM_audioStream *access=NULL;
if(ed->encoderIndex) // encode
{
// Access..
ADM_info("[audioTrack %d] Creating audio encoding stream, starttime %s(encoding with encoder=%d)\n",i,ADM_us2plain(startAudioTime),ed->encoderIndex);
access=audioCreateEncodingStream(ed,muxer->useGlobalHeader(),startAudioTime); // FIXME LEAK FIXME
}else // copy mode...
{
ADM_info("[audioTrack %d] Creating audio encoding stream, starttime %s(copy)\n",i,ADM_us2plain(startAudioTime));
int32_t shift=0;
if(ed->audioEncodingConfig.shiftEnabled)
{
shift=ed->audioEncodingConfig.shiftInMs;
ADM_info("Using shift of %d ms\n",(int)shift);
}
access=audioCreateCopyStream(startAudioTime,shift,ed->edTrack,!muxer->canDealWithTimeStamps());
}
if(!access)
{
GUI_Error_HIG("Audio","Cannot setup audio encoder, make sure your stream is compatible with audio encoder (number of channels, bitrate, format)");
return false;
}
audioAccess[i]=access;
}
return r;
}
示例4: time
/**
\fn GoToIntraTime
\brief Go to an intra at time time (exact)
\return true on success, false on error
*/
bool ADM_Composer::goToIntraTimeVideo(uint64_t time)
{
uint32_t frame;
if(false==GoToIntraTime_noDecoding(time,&frame))
{
ADM_warning("Seek failed.\n");
return false;
}
_SEGMENT *seg=_segments.getSegment(_currentSegment);
// Ok, we have switched to a new segment
// Flush the cache
_VIDEOS *vid= _segments.getRefVideo(seg->_reference);
if(false== DecodePictureUpToIntra(seg->_reference,frame))
{
return false;
}
// Get the last decoded PTS and it is our current PTS
uint64_t newPts=vid->lastDecodedPts+seg->_startTimeUs;
newPts-=seg->_refStartTimeUs;
SET_CURRENT_PTS(newPts);
#if 0
ADM_info("decodec DTS=%"PRIu64" ms\n",vid->lastDecodedPts/1000);
ADM_info("startTime DTS=%"PRIu64" ms\n",seg->_startTimeUs/1000);
ADM_info("refstart DTS=%"PRIu64" ms\n",seg->_refStartTimeUs/1000);
ADM_info("Current DTS=%"PRIu64" ms\n",_currentPts/1000);
#endif
return true;
}
示例5: ADM_info
/**
\fn stopThread
*/
bool ADM_threadQueue::stopThread(void)
{
ADM_info("Destroying threadQueue\n");
mutex->lock();
if(threadState==RunStateRunning)
{
threadState=RunStateStopOrder;
if(cond->iswaiting())
{
cond->wakeup();
}
mutex->unlock();
int clockDown=10;
while(threadState!=RunStateStopped && clockDown)
{
ADM_usleep(50*1000);
clockDown--;
};
ADM_info("Thread stopped, continuing dtor\n");
}else
{
mutex->unlock();
}
return true;
}
示例6: ADM_info
/**
\fn startNewRiffIfNeeded
*/
bool aviIndexOdml::startNewRiffIfNeeded(int trackNo,int len)
{
bool breakNeeded=false;
// Case 1: we exceed riff boundary (4 GB)
uint64_t currentPosition=LMovie->Tell();
uint64_t start=_masterList->TellBegin();
uint64_t riffSize=currentPosition-start;
uint64_t limit=((1LL<<31)-10*(1LL<<20)); // 2GB per riff chunk
riffSize+=len;
if(!riffCount) // take into account legacy index
{
for(int i=0;i<1+nbAudioTrack;i++)
limit-=4*4*indexes[i].listOfChunks.size();
}
if(riffSize> limit)
{
ADM_info("Riff is now %" PRIu64" bytes, break needed\n",riffSize);
breakNeeded=true;
}
// Case 2 : the current index is full
int available=(AVI_REGULAR_INDEX_CHUNK_SIZE-64)/8; // nb index entry
if(indexes[trackNo].listOfChunks.size()>=available)
{
ADM_info("Index for track %d is full\n",trackNo);
breakNeeded=true;
}
if(breakNeeded)
startNewRiff();
return true;
}
示例7: qtRegisterDialog
void qtRegisterDialog(QWidget *dialog)
{
if (widgetStack.count())
{
Qt::WindowFlags flags = dialog->windowFlags();
bool reparent = false;
bool isDialog = false;
if (dialog->parentWidget() != widgetStack.top())
reparent = true;
if (flags & Qt::Dialog)
isDialog = true;
#if defined(__APPLE__) && QT_VERSION == QT_VERSION_CHECK(5,10,1)
if (reparent || isDialog)
{
ADM_info("Working around Qt bug introduced in 5.10.1 resulting in non-resizable dialogs with Cocoa\n");
dialog->setWindowFlag(Qt::Dialog, false);
dialog->setParent(widgetStack.top(), Qt::Window);
dialog->setWindowModality(Qt::ApplicationModal);
dialog->show();
}
#else
if (reparent || !isDialog)
{
ADM_info("reparenting widget %s\n",dialog->objectName().toUtf8().constData());
dialog->setParent(widgetStack.top(), Qt::Dialog);
dialog->show(); // reparenting makes the widget invisible
}
#endif
}
widgetStack.push(dialog);
}
示例8: detectTs
/**
\fn detectTs
\brief returns true if the file seems to be mpeg PS
*/
bool detectTs(const char *file)
{
uint8_t buffer[PROBE_SIZE];
uint32_t bufferSize;
uint32_t nbPacket,nbMatch=0;
FILE *f=ADM_fopen(file,"rb");
if(!f) return false;
bufferSize=fread(buffer,1,PROBE_SIZE,f);
fclose(f);
// Do a simple check by checking we have 0x47....0x47 several time in a raw
if(true==checkMarker(buffer,bufferSize,TS_PACKET_LEN))
{
ADM_info("[TS Demuxer] 188 bytes packet detected\n");
return true;
}
// Do a simple check by checking we have 0x47....0x47 several time in a raw
if(true==checkMarker(buffer,bufferSize,TS_PACKET_LEN+4))
{
ADM_info("[TS Demuxer] 192 bytes packet detected\n");
return true;
}
ADM_info("[TS Demuxer] Not a TS file\n");
return false;
}
示例9: GUI_Error_HIG
uint8_t asfHeader::open(const char *name)
{
_fd=ADM_fopen(name,"rb");
if(!_fd)
{
GUI_Error_HIG("File Error.","Cannot open file\n");
return 0;
}
myName=ADM_strdup(name);
if(!getHeaders())
{
return 0;
}
ADM_info("Stream Video: index=%d, sid=%d\n",(int)_videoIndex,(int)_videoStreamId);
for(int i=0;i<_nbAudioTrack;i++)
ADM_info("Stream Audio: index=%d, sid=%d\n",
(int)_allAudioTracks[i].streamIndex,(int)_allAudioTracks[i].streamIndex);
buildIndex();
fseeko(_fd,_dataStartOffset,SEEK_SET);
_packet=new asfPacket(_fd,_nbPackets,_packetSize,&readQueue,&storageQueue,_dataStartOffset);
curSeq=1;
for(int i=0;i<_nbAudioTrack;i++)
{
_audioAccess[i]=new asfAudioAccess(this,i);
_audioStreams[i]=ADM_audioCreateStream(&(_allAudioTracks[i].wavHeader), _audioAccess[i]);
}
if(!nbImage)
{
ADM_error("No image found \n");
return 0;
}
return 1;
}
示例10: ADM_info
/**
* \fn compute the minimum us delta = maximum fps
* \brief average fps is not good enough, it might be too high
* @return
*/
bool MP4Header::refineFps(void)
{
int n=VDEO.nbIndex;
uint64_t minDelta=60*1000*1000;
for(int i=0;i<n-1;i++)
{
MP4Index *dex=&(_tracks[0].index[i]);
MP4Index *next=&(_tracks[0].index[i+1]);
if(dex->dts==ADM_NO_PTS) continue;
if(next->dts==ADM_NO_PTS) continue;
uint64_t delta=next->dts-dex->dts;
if(delta<minDelta) minDelta=delta;
}
if(minDelta>1000)
{
double f=1000000./(double)minDelta;
f*=1000.;
ADM_info("MinDelta=%d us\n",(int)minDelta);
ADM_info("Computed fps1000=%d\n",(int)f);
uint32_t fps1000=floor(f+0.49);
if(fps1000> _videostream.dwRate)
{
ADM_info("Adjusting fps, the computed is higher than average, dropped frames ?\n");
_videostream.dwRate=fps1000;
_mainaviheader.dwMicroSecPerFrame=ADM_UsecFromFps1000(_videostream.dwRate);
}
}
}
示例11: switch
bool AUDMEncoder_DcaEnc::initialize (void)
{
int chan_config=0;
switch(wavheader.channels)
{
case 1: chan_config=DCAENC_CHANNELS_MONO;break;
case 2: chan_config=DCAENC_CHANNELS_STEREO;break;
case 6: chan_config=DCAENC_CHANNELS_3FRONT_2REAR_1OV;break;
case 5: chan_config=DCAENC_CHANNELS_3FRONT_2REAR;break;
default:
ADM_warning("Unsupported channel configuration \n");
break;
}
wavheader.byterate=(config.bitrate*1000)>>3;
ADM_info("Starting dcaenc with channels=%d, bitrate=%d\n",wavheader.channels,config.bitrate);
context=dcaenc_create(wavheader.frequency,chan_config,config.bitrate*1000,DCAENC_FLAG_BIGENDIAN );
if(!context)
{
ADM_warning("Cannot create dcaenc context \n");
return false;
}
inputSize=dcaenc_input_size(context);
outputSize=dcaenc_output_size(context);
ADM_info("Converting %d samples to %d bytes\n",inputSize,outputSize);
return true;
}
示例12: ADM_info
/**
\fn convertLinearTimeToSeg
\brief convert linear time to a segment+ offset in the segment
*/
bool ADM_EditorSegment::convertLinearTimeToSeg( uint64_t frameTime, uint32_t *seg, uint64_t *segTime)
{
if(!frameTime && segments.size()) // pick the first one
{
ADM_info("Frame time=0, taking first segment \n");
*seg=0;
*segTime=0; // ??
return true;
}
for(int i=0;i<segments.size();i++)
{
if(segments[i]._startTimeUs<=frameTime && segments[i]._startTimeUs+segments[i]._durationUs>frameTime)
{
*seg=i;
*segTime=frameTime-segments[i]._startTimeUs;
return true;
}
}
int max=segments.size();
if(max)
{
_SEGMENT *last=&(segments[max-1]);
if(frameTime==last->_startTimeUs+last->_durationUs)
{
ADM_info("End of last segment\n");
*seg=max-1;
*segTime=frameTime-last->_startTimeUs;
return true;
}
}
ADM_warning("Cannot find segment matching time %"PRIu64"ms \n",frameTime/1000);
dump();
return false;
}
示例13: ADM_warning
/**
\fn resetVdpau
*/
bool vdpauVideoFilterDeint::setupVdpau(void)
{
scaler=NULL;
secondField=false;
nextFrame=0;
if(!admVdpau::isOperationnal())
{
ADM_warning("Vdpau not operationnal\n");
return false;
}
if(VDP_STATUS_OK!=admVdpau::outputSurfaceCreate(VDP_RGBA_FORMAT_B8G8R8A8,
info.width,info.height,&outputSurface))
{
ADM_error("Cannot create outputSurface0\n");
return false;
}
for(int i=0;i<ADM_NB_SURFACES;i++) surfacePool[i]=VDP_INVALID_HANDLE;
for(int i=0;i<ADM_NB_SURFACES;i++)
{
if(VDP_STATUS_OK!=admVdpau::surfaceCreate( previousFilter->getInfo()->width,
previousFilter->getInfo()->height,
&(surfacePool[i])))
{
ADM_error("Cannot create input Surface %d\n",i);
goto badInit;
}
aprintf("Created surface %d\n",(int)surfacePool[i]);
}
// allocate our (dummy) images
for(int i=0;i<3;i++)
xslots[i].image=new ADMImageDefault( previousFilter->getInfo()->width,
previousFilter->getInfo()->height);
if(VDP_STATUS_OK!=admVdpau::mixerCreate(previousFilter->getInfo()->width,
previousFilter->getInfo()->height,&mixer,true))
{
ADM_error("Cannot create mixer\n");
goto badInit;
}
tempBuffer=new uint8_t[info.width*info.height*4];
scaler=new ADMColorScalerSimple( info.width,info.height, ADM_COLOR_BGR32A,ADM_COLOR_YV12);
freeSurface.clear();
for(int i=0;i<ADM_NB_SURFACES;i++)
freeSurface.push_back(surfacePool[i]);
ADM_info("VDPAU setup ok\n");
if(initGl()==false)
{
ADM_error("Cannot setup openGL\n");
goto badInit;
}
ADM_info("VDPAU setup ok\n");
return true;
badInit:
cleanupVdpau();
passThrough=true;
return false;
}
示例14: loadTranslator
void loadTranslator(void)
{
char *lang=NULL;
bool autoSelect=true;
if(prefs->get(DEFAULT_LANGUAGE,&lang))
{
if(lang && strlen(lang)>0 && strcmp(lang,"auto"))
autoSelect=false;
}
if(autoSelect)
{
ADM_info("Using system language\n");
lang=ADM_strdup(QLocale::system().name().toUtf8().constData());
}else
{
ADM_info("Language forced \n");
}
ADM_info("Initializing language %s\n",lang);
#ifdef __APPLE__
QString appdir = QCoreApplication::applicationDirPath() + "/../share/avidemux6/i18n/";
#elif defined(_WIN32)
QString appdir = QCoreApplication::applicationDirPath() + "/i18n/";
#else
QString appdir = ADM_getInstallRelativePath("share","avidemux6","i18n");
#endif
QString languageFile=QString(lang);
int nbLoaded=0;
nbLoaded+=loadTranslation(&qtTranslator, appdir + "qt_" + languageFile);
nbLoaded+=loadTranslation(&avidemuxTranslator, appdir + "avidemux_" + languageFile);
translatorLoaded = true;
if(!nbLoaded) // Nothing to translate..
return;
ADM_info("Updating translations...\n");
// Re-translate existing map (to take care of global strings already allocated)
if(!map)
map = new QMap<QString, char*>;
QMapIterator<QString, char*> mapIterator(*map);
while (mapIterator.hasNext())
{
mapIterator.next();
QByteArray translatedMessage = QApplication::translate("", mapIterator.key().toAscii().constData()).toUtf8();
char *buffer = mapIterator.value();
int copyLength = translatedMessage.length() + 1;
if (copyLength > MAX_UNLOADED_MSG_LENGTH + 1)
{
copyLength = MAX_UNLOADED_MSG_LENGTH;
buffer[MAX_UNLOADED_MSG_LENGTH] = '\0';
}
memcpy(buffer, translatedMessage.constData(), copyLength);
}
ADM_info("[Locale] Test: &Edit -> %s\n\n", HIDE_STRING_FROM_QT("MainWindow", "&Edit").toUtf8().data());
}
示例15: prepareLegacyIndex
bool aviIndexOdml::writeIndex()
{
if(!riffCount)
prepareLegacyIndex();
// super index needed ?
ADM_info("Writting openDml chunk\n");
writeOdmlChunk();
ADM_info("Writting type 2 Avi index\n");
for(int i=0;i<1+nbAudioTrack;i++)
writeRegularIndex(i);
ADM_info("Writting type 2 Avi SuperIndex\n");
writeSuperIndex();
LMovie->End();
if(!riffCount)
{
ADM_info("Writting legacy index\n");
writeLegacyIndex();
}
delete LMovie;
LMovie=NULL;
_masterList->End();
delete _masterList;
_masterList=NULL;
return true;
}