本文整理汇总了C++中RLOG函数的典型用法代码示例。如果您正苦于以下问题:C++ RLOG函数的具体用法?C++ RLOG怎么用?C++ RLOG使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RLOG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ffmpeg_hls_setopt
static int ffmpeg_hls_setopt(URLContext *h, int cmd,int flag,unsigned long info){
if(h == NULL||h->priv_data == NULL){
RLOG("Failed call :%s\n",__FUNCTION__);
return -1;
}
FFMPEG_HLS_CONTEXT* ctx = (FFMPEG_HLS_CONTEXT*)h->priv_data;
int ret=-1;
if(AVCMD_SET_CODEC_BUFFER_INFO==cmd){
if(flag ==0){
ctx->codec_buf_level=info;
}else if(flag ==1){
ctx->codec_vbuf_size = info;
}else if(flag ==2){
ctx->codec_abuf_size = info;
}else if(flag ==3){
ctx->codec_vdat_size = info;
}else if(flag ==4){
ctx->codec_adat_size = info;
}
if(ctx->bandwidth_num>0){
int bw = 0;
m3u_session_get_cur_bandwidth(ctx->hls_ctx,&bw);
int sec = _hls_estimate_buffer_time(ctx,bw);
m3u_session_set_codec_data(ctx->hls_ctx,sec);
}
if(ctx->debug_level>3){
RLOG("set codec buffer,type = %d,info=%d\n",flag,(int)info);
}
ret=0;
}
return ret;
}
示例2: CheckValueMap
void CheckValueMap()
{
RLOG("------------------------------");
RLOG("CheckValueMap");
Value x = 123;
Value y = x;
ValueMap h;
h.Add("0", 123);
RDUMP(h["0"]);
h.Add("1", Date(2001, 12, 1));
h.Add("2", "test");
Value v = h;
ASSERT(v.GetCount() == 3);
RDUMP(v["0"]);
ASSERT(v["0"] == 123);
ASSERT(v["1"] == Date(2001, 12, 1));
ASSERT(v["2"] == "test");
ASSERT(IsValueMap(v));
ASSERT(IsValueArray(v));
ValueMap hh = v;
ASSERT(hh == h);
hh.Add(123, "foo");
ASSERT(hh.GetCount() == 4);
ASSERT(v.GetCount() == 3);
ASSERT(hh[123] == "foo");
ValueArray va = v;
ASSERT(va.GetCount() == 3);
ASSERT(va[0] == 123);
ASSERT(va[1] == Date(2001, 12, 1));
ASSERT(va[2] == "test");
}
示例3: LOGINVOKE
HRESULT OcxObject::RawInvoke(IRef<ITypeInfo>& typeinfo, IDispatch *dispatch, DISPID dispid, word flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excep, unsigned *arg_err)
{
LOGINVOKE("IDispatch::Invoke");
if(dispid == 0) { // convert object to dispatch value
if(!result) return E_INVALIDARG;
result->vt = VT_DISPATCH;
result->pdispVal = dispatch;
if(dispatch) dispatch->AddRef();
return S_OK;
}
if(!typeinfo) {
LOG("dispid = " << FormatIntHex(dispid) << ": typeinfo = NULL");
return E_FAIL;
}
#if LOG_INVOKES >= 1
BSTR names[1] = { NULL };
unsigned count = 0;
typeinfo->GetNames(dispid, names, 1, &count);
String name;
if(names[0])
name = BSTRToString(names[0]);
else
name = FormatIntHex(dispid);
switch(flags) {
case DISPATCH_METHOD: name << " - method"; break;
case DISPATCH_PROPERTYGET: name << " - propget"; break;
case DISPATCH_PROPERTYPUT: name << " - propput"; break;
case DISPATCH_PROPERTYPUTREF: name << " - propputref"; break;
}
LOG("Member name: " << name);
#endif
if(!typeinfo)
return E_FAIL;
TYPEATTR *attr;
typeinfo->GetTypeAttr(&attr);
LOGINVOKE("GetTypeInfo: typekind = " << (int)attr->typekind);
// HRESULT res = typeinfo->Invoke(dispatch, dispid, flags, params, result, excep, arg_err);
HRESULT res = DispInvoke(dispatch, ~typeinfo, dispid, flags, params, result, excep, arg_err);
if(FAILED(res)) {
RLOG("failure: dispid = " << (int)dispid << ", #args = " << (int)params->cArgs
<< ", #named args = " << (int)params->cNamedArgs << ", return " << FormatIntHex(result));
for(int i = 0; i < (int)params->cArgs; i++) {
RLOG("arg[" << i << "] (vt = " << (int)params->rgvarg[i].vt << "): " << StdFormat(AsValue(params->rgvarg[i])));
}
RLOG("#funcs = " << attr->cFuncs);
for(int i = 0; i < attr->cFuncs; i++) {
FUNCDESC *func;
typeinfo->GetFuncDesc(i, &func);
RLOG("memid = " << func->memid << ", cParams " << func->cParams
<< ", cParamsOpt = " << func->cParamsOpt << ", cScodes " << func->cScodes
<< ", funckind = " << (int)func->funckind << ", invkind " << (int)func->invkind
<< ", flags = " << FormatIntHex(func->wFuncFlags));
typeinfo->ReleaseFuncDesc(func);
}
}
typeinfo->ReleaseTypeAttr(attr);
LOGINVOKE("//IDispatch::Invoke");
return LOGRESULT(res);
}
示例4: warning
PropertyTest::PropertyTest()
//initializer space for constant Properties or Accessors
#pragma warning(push)
#pragma warning(disable:4355)
: vp( THISBACK(SetD), THISBACK(GetD) )
, va( THISBACK(SetDa), THISBACK(GetDa) )
#pragma warning(pop)
{
CtrlLayout(*this, "Window title");
//setting, will call SetD
vp = 123;
//getting, will call GetD
Value v = vp;
RLOG(v);
///
bool b;
b = va.Set(456); //will call SetDa
v = Value();
b = va.Get(v); //will call GetDa
if(b) RLOG(v);
}
示例5: ffmpeg_hls_read
static int ffmpeg_hls_read(URLContext *h, unsigned char *buf, int size){
if(h == NULL||h->priv_data == NULL||size<=0){
RLOG("failed to read data\n");
return -1;
}
FFMPEG_HLS_CONTEXT* ctx = (FFMPEG_HLS_CONTEXT*)h->priv_data;
void * hSession = ctx->hls_ctx;
int len = AVERROR(EIO);
int counts = 10;
do {
if (url_interrupt_cb()>0) {
RLOG("url_interrupt_cb\n");
len = 0;
break;
}
len = m3u_session_read_data(hSession, buf,size);
if (len <0) {
if(len == AVERROR(EAGAIN)){
usleep(1000*100);
}else{
break;
}
}
if (len >= 0) {
break;
}
} while (counts-- > 0);
if(ctx->debug_level>5){
RLOG("%s,want:%d,got:%d\n",__FUNCTION__,size,len);
}
return len;
}
示例6: VLOG
void RenameOp::undo() {
VLOG(1) << "in undoRename";
if (last == renameList->begin()) {
VLOG(1) << "nothing to undo";
return; // nothing to undo
}
// list has to be processed backwards, otherwise we may rename
// directories and directory contents in the wrong order!
int undoCount = 0;
list<RenameEl>::const_iterator it = last;
while (it != renameList->begin()) {
--it;
VLOG(1) << "undo: renaming " << it->newCName << " -> " << it->oldCName;
unix::rename(it->newCName.c_str(), it->oldCName.c_str());
try {
dn->renameNode(it->newPName.c_str(), it->oldPName.c_str(), false);
} catch (encfs::Error &err) {
RLOG(WARNING) << err.what();
// continue on anyway...
}
++undoCount;
};
RLOG(WARNING) << "Undo rename count: " << undoCount;
}
示例7: sizeof
void ObjectFile::Dump() const
{
int sym_size = (ref_sections.GetCount() + ref_externals.GetCount()) * sizeof(int);
int sec_size = sections.GetCount() * sizeof(Section);
int mapped_size = sizeof(ObjectFile) + sym_size + sec_size;
RLOG("ObjectFile(" << library_file << ":" << object_file << "), mapped size = " << mapped_size
<< " (" << sym_size << " in symbols, " << sec_size << " in sections)");
// RLOG("Linker directives: " << directives);
RLOG("#sections = " << sections.GetCount());
/*
for(int i = 0; i < sections.GetCount(); i++)
{
const Section& sec = sections[i];
RLOG(NFormat("[%d]: %s", i, linkjob[sec.name_atom]));
int end_ext = (i + 1 < sections.GetCount() ? sections[i + 1].ref_ext_index : ref_externals.GetCount());
int end_sec = (i + 1 < sections.GetCount() ? sections[i + 1].ref_sec_index : ref_sections.GetCount());
RLOG("#external references = " << (end_ext - sec.ref_ext_index));
int r;
for(r = sec.ref_ext_index; r < end_ext; r++)
RLOG(linkjob[linkjob.globals.GetKey(ref_externals[r])]);
RLOG("#section references = " << (end_sec - sec.ref_sec_index));
for(r = sec.ref_sec_index; r < end_sec; r++)
RLOG(NFormat("%04x", ref_sections[r]));
}
*/
}
示例8: ServiceSignal
static void WINAPI ServiceSignal(DWORD OpCode)
{
switch(OpCode) {
case SERVICE_CONTROL_PAUSE: {
RLOG(ThreadId() << "service pause");
ServiceStatus.dwControlsAccepted = 0;
ServiceStatus.dwCheckPoint = 1;
ServiceStatus.dwCurrentState = SERVICE_PAUSE_PENDING;
if(!SetServiceStatus(ServiceStatusHandle, &ServiceStatus))
break;
PauseService();
ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_PAUSE_CONTINUE
| SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_STOP;;
ServiceStatus.dwCheckPoint = 0;
ServiceStatus.dwCurrentState = SERVICE_PAUSED;
SetServiceStatus(ServiceStatusHandle, &ServiceStatus);
break;
}
case SERVICE_CONTROL_CONTINUE: {
RLOG(ThreadId() << "service continue");
ServiceStatus.dwControlsAccepted = 0;
ServiceStatus.dwCheckPoint = 1;
ServiceStatus.dwCurrentState = SERVICE_CONTINUE_PENDING;
if(!SetServiceStatus(ServiceStatusHandle, &ServiceStatus))
break;
ContinueService();
ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_PAUSE_CONTINUE
| SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_STOP;
ServiceStatus.dwCheckPoint = 0;
ServiceStatus.dwCurrentState = SERVICE_RUNNING;
SetServiceStatus(ServiceStatusHandle, &ServiceStatus);
break;
}
case SERVICE_CONTROL_SHUTDOWN:
case SERVICE_CONTROL_STOP: {
RLOG(ThreadId() << "service stop / shutdown");
ServiceStatus.dwControlsAccepted = 0;
ServiceStatus.dwCheckPoint = 1;
ServiceStatus.dwCurrentState = SERVICE_STOP_PENDING;
ServiceStatus.dwWaitHint = 5000;
if(!SetServiceStatus(ServiceStatusHandle, &ServiceStatus))
break;
StopService();
ServiceStatus.dwCheckPoint = 0;
ServiceStatus.dwCurrentState = SERVICE_STOPPED;
SetServiceStatus(ServiceStatusHandle, &ServiceStatus);
break;
}
default: {
break;
}
}
}
示例9: EventHandler
static BOOL WINAPI EventHandler(DWORD CtrlType)
{
RLOG("EventHandler (CtrlType = " << (int)CtrlType << ")");
if(CtrlType == CTRL_LOGOFF_EVENT)
RLOG("LOGOFF_EVENT (ignored)");
else {
RLOG("exiting");
service_stopped = true;
}
return true;
}
示例10: RLOG
bool ElfRelocations::ResolveSymbol(ELF::Word rel_type,
ELF::Word rel_symbol,
const ElfSymbols* symbols,
SymbolResolver* resolver,
ELF::Addr reloc,
ELF::Addr* sym_addr,
Error* error) {
const char* sym_name = symbols->LookupNameById(rel_symbol);
RLOG(" symbol name='%s'\n", sym_name);
void* address = resolver->Lookup(sym_name);
if (address) {
// The symbol was found, so compute its address.
RLOG("%s: symbol %s resolved to %p\n", __FUNCTION__, sym_name, address);
*sym_addr = reinterpret_cast<ELF::Addr>(address);
return true;
}
// The symbol was not found. Normally this is an error except
// if this is a weak reference.
if (!symbols->IsWeakById(rel_symbol)) {
error->Format("Could not find symbol '%s'", sym_name);
return false;
}
RLOG("%s: weak reference to unresolved symbol %s\n", __FUNCTION__, sym_name);
// IHI0044C AAELF 4.5.1.1:
// Libraries are not searched to resolve weak references.
// It is not an error for a weak reference to remain
// unsatisfied.
//
// During linking, the value of an undefined weak reference is:
// - Zero if the relocation type is absolute
// - The address of the place if the relocation is pc-relative
// - The address of nominal base address if the relocation
// type is base-relative.
RelocationType r = GetRelocationType(rel_type);
if (r == RELOCATION_TYPE_ABSOLUTE || r == RELOCATION_TYPE_RELATIVE) {
*sym_addr = 0;
return true;
}
if (r == RELOCATION_TYPE_PC_RELATIVE) {
*sym_addr = reloc;
return true;
}
error->Format(
"Invalid weak relocation type (%d) for unknown symbol '%s'",
r,
sym_name);
return false;
}
示例11: RLOG
int dbDatabase::PutRecord(const String &tbname, int recno, dbRecord& Record, bool f) {
int h;
#ifdef _WITH_DEBUG
RLOG("Put record: " + FormatInt(recno));
RLOG("Table: " + tbname);
#endif
if((h = GetTableHandle(tbname)) == MTDB_TB_NOT_FOUND)
return MTDB_TB_NOT_FOUND;
return PutRecord(h, recno, Record, f);
}
示例12: RunServiceDispatcher
void RunServiceDispatcher(String service_name_)
{
ASSERT(service_name_.GetLength() < __countof(service_name));
strcpy(service_name, service_name);
static SERVICE_TABLE_ENTRY servicetable[] = {
{ service_name, &ServiceInit },
{ NULL, NULL }
};
RLOG(ThreadId() << "starting service control dispatcher");
StartServiceCtrlDispatcher(servicetable);
RLOG(ThreadId() << "exiting main thread");
return;
}
示例13: recovery_usb
/* main menu activity */
void recovery_usb(int parent_id,LIBAROMA_RECTP rect){
USBMENU var={0};
/* init window */
LIBAROMA_WINDOWP win = libaroma_ctl_fragment_new_window(
recovery()->fragment, ID_USB_FRAGMENT
);
if (win){
if (recovery_usb_init(win,&var)){
libaroma_ctl_fragment_set_active_window(
recovery()->fragment, ID_USB_FRAGMENT,
1, 300, 0,
recovery_usb_transition_cb, rect, NULL
);
libaroma_ctl_bar_set_color(
recovery()->appbar,
RGB(555555),
RGB(ffffff),
0
);
recovery_usb_reset_appbar(win,&var);
recovery_statusbar_setcolor(RGB(555555));
recovery_usb_pool(win,&var);
/* restore parent and delete usb fragment */
libaroma_ctl_fragment_set_active_window(
recovery()->fragment, parent_id,
1, 300, 1,
recovery_usb_transition_cb, NULL, rect
);
libaroma_ctl_bar_set_color(
recovery()->appbar,
libaroma_colorget(NULL,recovery()->win)->primary,
libaroma_colorget(NULL,recovery()->win)->primary_text,
0
);
recovery_statusbar_setcolor(libaroma_colorget(NULL,win)->primary);
}
else{
RLOG("recovery_usb: init window control failed");
libaroma_ctl_fragment_del_window(recovery()->fragment,ID_USB_FRAGMENT);
}
}
else{
RLOG("recovery_usb: create main window failed");
}
}
示例14: VLOG
/*
We shouldn't have to support all possible open flags, so untaint the flags
argument by only taking ones we understand and accept.
- Since the kernel has already done permission tests before calling us, we
shouldn't have to worry about access control.
- Basically we just need to distinguish between read and write flags
- Also keep the O_LARGEFILE flag, in case the underlying filesystem needs
it..
*/
int RawFileIO::open(int flags) {
bool requestWrite = ((flags & O_RDWR) || (flags & O_WRONLY));
VLOG(1) << "open call, requestWrite = " << requestWrite;
int result = 0;
// if we have a descriptor and it is writable, or we don't need writable..
if ((fd >= 0) && (canWrite || !requestWrite)) {
VLOG(1) << "using existing file descriptor";
result = fd; // success
} else {
int finalFlags = requestWrite ? O_RDWR : O_RDONLY;
#if defined(O_LARGEFILE)
if (flags & O_LARGEFILE) finalFlags |= O_LARGEFILE;
#else
#ifndef _WIN32
#warning O_LARGEFILE not supported
#endif
#endif
int newFd = ::my_open(name.c_str(), finalFlags);
VLOG(1) << "open file with flags " << finalFlags << ", result = " << newFd;
if ((newFd == -1) && (errno == EACCES)) {
VLOG(1) << "using readonly workaround for open";
newFd = open_readonly_workaround(name.c_str(), finalFlags);
}
if (newFd >= 0) {
if (oldfd >= 0) {
RLOG(ERROR) << "leaking FD?: oldfd = " << oldfd << ", fd = " << fd
<< ", newfd = " << newFd;
}
// the old fd might still be in use, so just keep it around for
// now.
canWrite = requestWrite;
oldfd = fd;
result = fd = newFd;
} else {
result = -errno;
RLOG(DEBUG) << "::open error: " << strerror(errno);
}
}
return result;
}
示例15: ffmpeg_hls_exseek
static int64_t ffmpeg_hls_exseek(URLContext *h, int64_t pos, int whence){
if(h == NULL||h->priv_data == NULL){
RLOG("Failed call :%s\n",__FUNCTION__);
return -1;
}
FFMPEG_HLS_CONTEXT* ctx = (FFMPEG_HLS_CONTEXT*)h->priv_data;
void * hSession = ctx->hls_ctx;
int ret;
if(whence == AVSEEK_FULLTIME){
if(ctx->durationUs>0){
return (int64_t)(ctx->durationUs/1000000);
}else{
return -1;
}
}else if(whence == AVSEEK_BUFFERED_TIME){
if(ctx->durationUs>0){
int sec;
m3u_session_get_cached_data_time(hSession,&sec);
if(ctx->debug_level>3){
RLOG("Got buffered time:%d\n",sec);
}
return sec;
}else{
return -1;
}
}else if(whence == AVSEEK_TO_TIME){
if(ctx->durationUs>0&&pos>=0&&(pos*1000000)<ctx->durationUs){
int64_t seekToUs = m3u_session_seekUs(hSession,pos*1000000,interrupt_call_cb);
RLOG("Seek to time:%lld\n",seekToUs);
return (seekToUs/1000000);
}
}else if(whence == AVSEEK_ITEM_TIME){//just for get will-download item time,for xiaomi,by zc
if(ctx->durationUs>0){
int64_t item_st = m3u_session_get_next_segment_st(hSession);
if(ctx->debug_level>3){
RLOG("Got next item start time:%lld us\n",item_st);
}
return item_st/1000000;
}
}else if(_get_system_prop(PROP_CMF_SUPPORT)>0&&ctx->durationUs>0){//only vod
return _ffmpeg_cmf_exseek(h,pos,whence);
}
RLOG("Never support this case,pos:%lld,whence:%d\n",(long long)pos,whence);
return -1;
}