• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ LDEBUG函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LDEBUG函数的典型用法代码示例。如果您正苦于以下问题:C++ LDEBUG函数的具体用法?C++ LDEBUG怎么用?C++ LDEBUG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LDEBUG函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: JEVOIS_TRACE

// ##############################################################################################################
void jevois::Gadget::streamOff()
{
  JEVOIS_TRACE(2);
  
  // Note: we allow for several streamOff() without complaining, this happens, e.g., when destroying a Gadget that is
  // not currently streaming.

  LDEBUG("Turning off gadget stream");

  // Abort stream in case it was not already done, which will introduce some sleeping in our run() thread, thereby
  // helping us acquire our needed double lock:
  abortStream();

  JEVOIS_TIMED_LOCK(itsMtx);

  // Stop streaming over the USB link:
  int type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
  try { XIOCTL_QUIET(itsFd, VIDIOC_STREAMOFF, &type); } catch (...) { }
  
  // Nuke all our buffers:
  if (itsBuffers) { delete itsBuffers; itsBuffers = nullptr; }
  itsImageQueue.clear();
  itsDoneImgs.clear();

  LDEBUG("Gadget stream is off");
}
开发者ID:Dennis-Wijngaarden,项目名称:jevois,代码行数:27,代码来源:Gadget.C


示例2: w_check_rtcp_ipport

int w_check_rtcp_ipport(msg_t *msg)
{

	int i = 0;
	miprtcp_t *mp = NULL;
	char ipptmp[256];
	char callid[256];


	snprintf(callid, sizeof(callid), "%.*s", msg->sip.callId.len, msg->sip.callId.s);

	for (i = 0; i < msg->sip.mrp_size; i++) {
		mp = &msg->sip.mrp[i];

		if (mp->rtcp_ip.len > 0 && mp->rtcp_ip.s) {
			snprintf(ipptmp, sizeof(ipptmp), "%.*s:%d", mp->rtcp_ip.len, mp->rtcp_ip.s, mp->rtcp_port);			
			LDEBUG("RTCP CALLID: %.*s", msg->sip.callId.len, msg->sip.callId.s);
			LDEBUG("RTCP IP PORT: %s", ipptmp);

			/* one pair = one timer */
			if(!find_and_update(ipptmp, callid))			
			{
			       add_timer(ipptmp);			
                               add_ipport(ipptmp, callid);
                        }
		}
	}

	return 1;
}
开发者ID:aphistic,项目名称:captagent,代码行数:30,代码来源:database_hash.c


示例3: reader

void VolumeSeriesSource::openSeries() {
    if(volumeHandle_)
        delete volumeHandle_;
    volumeHandle_ = 0;

    try {
        TextFileReader reader(filename_.get());
        if (!reader)
            throw tgt::FileNotFoundException("Reading sdat file failed", filename_.get());

        std::string type;
        std::istringstream args;
        std::string format, model;
        tgt::ivec3 resolution(0);
        tgt::vec3 sliceThickness(1.f);
        spreadMin_ = 0.f;
        spreadMax_ = 0.f;

        files_.clear();
        std::string blockfile;

        while (reader.getNextLine(type, args, false)) {
            if (type == "ObjectFileName:") {
                std::string s;
                args >> s;
                LDEBUG(type << " " << s);
                files_.push_back(tgt::FileSystem::dirName(filename_.get()) + "/" + s);
            } else if (type == "Resolution:") {
                args >> resolution[0];
                args >> resolution[1];
                args >> resolution[2];
                LDEBUG(type << " " << resolution[0] << " x " <<
                       resolution[1] << " x " << resolution[2]);
            } else if (type == "SliceThickness:") {
开发者ID:bsmr-opengl,项目名称:voreen,代码行数:34,代码来源:volumeseriessource.cpp


示例4: LERR

static uint8_t *extract_from_m2pa(msg_t *msg, size_t *len)
{
	uint8_t *data;
	uint32_t data_len;

	if (msg->len < 8) {
		LERR("M2PA hdr too short %u", msg->len);
		return NULL;
	}
	data = msg->data;

	/* check the header */
	if (data[0] != 0x01) {
		LERR("M2PA unknown version number %d", data[0]);
		return NULL;
	}
	if (data[1] != 0x00) {
		LERR("M2PA unknown reserved fields %d", data[1]);
		return NULL;
	}
	if (data[2] != M2PA_CLASS) {
		LDEBUG("M2PA unhandled message class %d", data[2]);
		return NULL;
	}
	if (data[3] != M2PA_DATA) {
		LDEBUG("M2PA not data msg but %d", data[3]);
		return NULL;
	}

	/* check the length */
	memcpy(&data_len, &data[4], sizeof(data_len));
	data_len = ntohl(data_len);
	if (msg->len < data_len) {
		LERR("M2PA data can't fit %u vs. %u", msg->len, data_len);
		return NULL;
	}

	/* skip the header */
	data += 8;
	data_len -= 8;

	/* BSN, FSN and then priority */
	if (data_len < 8) {
		LERR("M2PA no space for BSN/FSN %u\n", data_len);
		return NULL;
	}
	data += 8;
	data_len -= 8;
	if (data_len == 0)
		return NULL;
	else if (data_len < 1) {
		LERR("M2PA no space for prio %u\n", data_len);
		return NULL;
	}
	data += 1;
	data_len -= 1;

	*len = data_len;
	return data;
}
开发者ID:SipSeb,项目名称:captagent,代码行数:60,代码来源:protocol_ss7.c


示例5: instantiatePatternsHash

 void instantiatePatternsHash ( Data& d ) {
   d.hpinstances.clear();
   LINFO ( "maxspan_=" << maxspan_ << ",gapmaxspan=" << gapmaxspan_ );
   std::vector<std::string> ss;
   boost::algorithm::split ( ss, d.sentence, boost::algorithm::is_any_of ( " " ) );
   const std::unordered_set<std::string>& patterns = d.grammar->patterns;
   for ( std::unordered_set<std::string>::const_iterator itx = patterns.begin();
         itx != patterns.end(); ++itx ) { /// for each grammar-specific pattern.
     LDEBUG ( "pattern:" << *itx );
     std::vector<std::string> spattern;
     boost::algorithm::split ( spattern, *itx, boost::algorithm::is_any_of ( "_" ) );
     for ( unsigned j = 0; j < ss.size(); ++j ) { // for each word in the sentence
       std::vector< std::vector<std::string> > pinstances;
       LDEBUG ( "starting word:" << ss[j] );
       //Map each pattern into words.
       //If there are gaps, then expand them from 1 to given threshold gapmaxspan
       if ( spattern.size() <= maxspan_ && j + spattern.size() - 1 < ss.size() ) {
         std::vector<std::string> empty;
         pinstances.push_back ( empty ); //add empty one.
         //Create all instances that apply to this particular pattern.
         buildNextElementFromPattern ( spattern, ss, pinstances, j, 0 );
       }
       for ( unsigned k = 0; k < pinstances.size(); ++k )  {
         LDEBUG ( "pattern:" << *itx << ":" << "Inserting in " <<
                  boost::algorithm::join ( pinstances[k],
                                           "_" ) << "values=(" << j << "," << spattern.size() - 1 );
         d.hpinstances[boost::algorithm::join ( pinstances[k],
                                                "_" )].push_back ( std::pair<unsigned, unsigned> ( j, spattern.size() - 1 ) );
       }
     }
   }
 }
开发者ID:ucam-smt,项目名称:ucam-smt,代码行数:32,代码来源:task.patternstoinstances.hpp


示例6: run

  /**
   * \brief Method inherited from ucam::util::TaskInterface. Loads the language model and stores in lm data structure.
   * \param &d: data structure in which the null filter is to be stored.
   * \returns false (does not break the chain of tasks)
   */
  bool run ( Data& d ) {
    mylmfst_.DeleteStates();
    if ( !USER_CHECK ( d.klm.size() ,
                       "No language models available" ) ) return true;
    if ( !USER_CHECK ( d.klm.find ( lmkey_ ) != d.klm.end() ,
                       "No language models available (key not initialized) " ) ) return true;
    if ( !USER_CHECK ( d.fsts.find ( latticeloadkey_ ) != d.fsts.end() ,
                       " Input fst not available!" ) ) return true;
    mylmfst_ = * (static_cast<fst::VectorFst<Arc> * > ( d.fsts[latticeloadkey_] ) );
    if (deletelmscores_) {
      LINFO ( "Delete old LM scores first" );
      //Deletes LM scores if using lexstdarc. Note -- will copy through on stdarc!
      fst::MakeWeight2<Arc> mwcopy;
      fst::Map<Arc> ( &mylmfst_,
                      fst::GenericWeightAutoMapper<Arc, fst::MakeWeight2<Arc> > ( mwcopy ) );
    }
    LINFO ( "Input lattice loaded with key=" << latticeloadkey_ << ", NS=" <<
            mylmfst_.NumStates() );
    fst::MakeWeight<Arc> mw;
    for ( uint k = 0; k < d.klm[lmkey_].size(); ++k ) {
      if ( !USER_CHECK ( d.klm[lmkey_][k]->model != NULL,
                         "Language model " << k << " not available!" ) ) return true;
      KenLMModelT& model = *d.klm[lmkey_][k]->model;
#ifndef USE_GOOGLE_SPARSE_HASH
      unordered_set<Label> epsilons;
#else
      google::dense_hash_set<Label> epsilons;
      epsilons.set_empty_key ( numeric_limits<Label>::max() );
#endif
      ///We want the language model to ignore these guys:
      epsilons.insert ( DR );
      epsilons.insert ( OOV );
      epsilons.insert ( EPSILON );
      epsilons.insert ( SEP );
      LINFO ( "Applying language model " << k
              << " with lmkey=" << lmkey_
              << ", using lmscale=" << d.klm[lmkey_][k]->lmscale );
      LDEBUG ( "lattice NS=" << mylmfst_.NumStates() );
      fst::ApplyLanguageModelOnTheFly<Arc, fst::MakeWeight<Arc>, KenLMModelT> *f
        = new fst::ApplyLanguageModelOnTheFly<Arc, fst::MakeWeight<Arc>, KenLMModelT >
      ( mylmfst_
        , model
        , epsilons
        , natlog_
        , d.klm[lmkey_][k]->lmscale
        , d.klm[lmkey_][k]->lmwp
        , d.klm[lmkey_][k]->idb);
      f->setMakeWeight ( mw );
      d.stats->setTimeStart ( "on-the-fly-composition " +  ucam::util::toString (
                                k ) );
      mylmfst_ = * ( ( *f ) () );
      delete f;
      d.stats->setTimeEnd ( "on-the-fly-composition " + ucam::util::toString ( k ) );
      LDEBUG ( mylmfst_.NumStates() );
      mw.update();
    }
    d.fsts[latticestorekey_] = &mylmfst_;
    LINFO ( "Done!" );
    return false;
  };
开发者ID:Libardo1,项目名称:ucam-smt,代码行数:65,代码来源:task.applylm.hpp


示例7: w_parse_rtcp_to_json

int w_parse_rtcp_to_json(msg_t *_m)
{
	  int json_len;
	  char *json_rtcp_buffer;

	  _m->mfree = 0;
	  json_rtcp_buffer = malloc(JSON_BUFFER_LEN);	  
	  json_rtcp_buffer[0] = '\0';
	  
	  if((json_len = capt_parse_rtcp((char *)_m->data, _m->len, json_rtcp_buffer, JSON_BUFFER_LEN)) > 0) {
	      _m->rcinfo.proto_type = rtcp_proto_type;
	      _m->data = json_rtcp_buffer;
	      _m->len = json_len;
	      _m->mfree = 1;
	  }
	  else {
	    	LDEBUG("GOODBYE or APP MESSAGE. Ignore!\n");
	    	if(json_rtcp_buffer) free(json_rtcp_buffer);
	    	if(_m->corrdata) 
	    	{
	    	      free(_m->corrdata);
	    	      _m->corrdata = NULL;
                }
	      	return -1;
	  }

	  LDEBUG("JSON RTCP %s\n", json_rtcp_buffer);

	  return 1;
}
开发者ID:mslehto,项目名称:captagent,代码行数:30,代码来源:protocol_rtcp.c


示例8: main

int main(int argc, char **argv)
{
	int maxsock,sockfd,sock_auth;
	unsigned int myport,listnum;
	fd_set fdsr;
	struct timeval tv;
	char *url = "OK OK";
	int ret;
	
	myport = DEF_LISTEN_PORT;
	// listnum = 10;
	listnum = SOMAXCONN;
	if(argc > 1)
	{
		myport = atoi(argv[1]);
	}
	
	if(myport <= 0 )
	{
		printf("%s invalid paramters!\n",argv[0]);
		return 0;
	}
	
	sockfd = create_server_socket(myport,listnum);
	if(sockfd == -1)
	{
		return 0;
	}
	maxsock = sockfd;

	LDEBUG("%s start to listen\n",argv[0]);

	while(1)
	{
		//init file desc set
		FD_ZERO(&fdsr);
		FD_SET(sockfd, &fdsr);
		// timeout setting
		tv.tv_sec = 30;
		tv.tv_usec = 0;
		
		ret = select(maxsock + 1, &fdsr, NULL, NULL, &tv);
		if(ret < 0)
		{
			printf("select error");
			break;
		}
		else if(ret == 0) 
		{
			LDEBUG("timeout\n");
			continue;
		}

 		if(FD_ISSET(sockfd, &fdsr))
 		{
 			handleRequest(sockfd,url);
 		}
	}
	return 0;
}
开发者ID:finove,项目名称:testCode,代码行数:60,代码来源:tcpd.c


示例9: LDEBUG

	Json::Value DotNetClient::sendRequest(std::string url) {

		//TODO remove log lines
		LDEBUG("Camera") << "sendRequest: " << url << LE;

		std::string sendUrl = params.query + url;

		LDEBUG("Camera") << "sendRequest full: " << sendUrl << LE;

		std::cout << "query " << sendUrl << std::endl;

		Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, sendUrl);
		request.setContentType("application/json");
		request.set("charsets:", "utf-8");
		request.setContentLength(0); //(int) message.length()
		client->sendRequest(request);
		Poco::Net::HTTPResponse response;
		std::istream& rs = client->receiveResponse(response);
		std::stringstream outstr;
		Poco::StreamCopier::copyStream(rs, outstr);
		std::string rawOutput = outstr.str();
		std::cout << "response " << rawOutput << std::endl;
		LDEBUG("Camera") << "resposne raw: " << rawOutput << LE;
		Json::Value ov;
		Json::Reader r;
		r.parse(rawOutput, ov);

		//LDEBUG("Camera") << "parsed: " << ov << LE;

		return ov;
	}
开发者ID:hadzim,项目名称:bb,代码行数:31,代码来源:DotNetClient.cpp


示例10: LDEBUG

void CacheManager::cleanDirectory(const Directory& dir) const {
    LDEBUG("Cleaning directory '" << dir << "'");
    // First search for all subdirectories and call this function recursively on them
	std::vector<std::string> contents = dir.readDirectories();
	for (const auto& content : contents) {
        if (FileSys.directoryExists(content)) {
			cleanDirectory(content);
        }
	}
    // We get to this point in the recursion if either all subdirectories have been
    // deleted or there exists a file somewhere in the directory tree

	contents = dir.read();
    bool isEmpty = contents.empty();
#ifdef __APPLE__
    // Apple stores the .DS_Store directory in the directory which can be removed
    std::string dsStore = FileSys.pathByAppendingComponent(dir, ".DS_Store");
    isEmpty |= ((contents.size() == 1) && contents[0] == dsStore);
#endif
    // If this directory is empty, we can delete it
    if (isEmpty) {
        LDEBUG("Deleting directory '" << dir << "'");
		FileSys.deleteDirectory(dir);
    }
}
开发者ID:forsythrosin,项目名称:Ghoul,代码行数:25,代码来源:cachemanager.cpp


示例11: getVideoFileInfoFromFilename

VideoFileInfo getVideoFileInfoFromFilename(const std::string& fname)
{
    VideoFileInfo result;

    std::string base;
    std::string ext = nodotExtension(fname, &base);

    LDEBUG("ext is %s", ext.c_str());

    if (ext.compare("gz") == 0)
    {
        ext = nodotExtension(base, &base);
        LDEBUG("new ext is %s", ext.c_str());
        result.ctype = COMP_GZIP;
    }
    else if (ext.compare("bz2") == 0)
    {
        ext = nodotExtension(base, &base);
        LDEBUG("new ext is %s", ext.c_str());
        result.ctype = COMP_BZIP2;
    }
    else
    {
        result.ctype = COMP_NONE;
    }

    const std::string dimsstr = nodotExtension(base);

    LDEBUG("dimsstr is '%s'", dimsstr.c_str());

    if (dimsstr.size() == 0)
    {
        LERROR("no <width>x<height> specification found in '%s'; "
               "assuming default dims of %dx%d instead",
               fname.c_str(), defaultDims.w(), defaultDims.h());
        result.dims = defaultDims;

        // we didn't get explicit dims, so let's be picky about the
        // file size matching the defaultDims (--yuv-dims), unless the
        // user also requests loose matching (--yuv-dims-loose)
        result.beStrict = strictLength;
    }
    else
    {
        result.dims = fromStr<Dims>(dimsstr);
        LDEBUG("parsed dims as %dx%d",
               result.dims.w(), result.dims.h());

        // OK, the user gave us some explicit dims, so let's not be
        // picky about whether the file size matches the
        // dims+pixformat
        result.beStrict = false;
    }

    result.format = fromStr<VideoFormat>(ext);

    return result;
}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:58,代码来源:YuvParser.C


示例12: LDEBUG

	void BioRadar::GoRelBase(const double & speed) {
		if (speed == 0) {
			LDEBUG("HAL")<< "BioRadar antena stop" << LE;
				baseExecution.addTask(baseMotorModule.taskStop());
			} else {
				LDEBUG("HAL")<< "BioRadar antena goRel: " << speed << " by " << maxRelDurationTimeInMs << LE;
				baseExecution.addTask(baseMotorModule.taskGoRel(speed, maxRelDurationTimeInMs));
			}
		}
开发者ID:hadzim,项目名称:fit-mbot,代码行数:9,代码来源:BioRadar.cpp


示例13: internalGoRel

static void internalGoRel(TBS::Task::OneActiveTaskExectution & execution,
		MBot::CameraMotorModule & module, double speed, int maxDuration) {
	if (speed == 0) {
		LDEBUG("HAL")<< "Camera motor stop" << LE;
			execution.addTask(module.taskStop());
		} else {
			LDEBUG("HAL")<< "Camera motor goRel: " << speed << " by " << maxDuration << LE;
			execution.addTask(module.taskGoRel(speed, maxDuration));
		}
	}
开发者ID:hadzim,项目名称:fit-mbot,代码行数:10,代码来源:Camera.cpp


示例14: findPrimaryDevicesKey

DWORD GpuCapabilitiesWindows::readVRAMSizeFromReg() {
    DWORD memSize = 0;
    char* devicesKey = findPrimaryDevicesKey();
    if ( devicesKey == 0 ) {
        LERROR("Failed to determine primary graphics adapter by calling findPrimaryDevicesKey()!");
        return 0;
    }

    for ( size_t i = 0; i < strlen(devicesKey); i++ )
        devicesKey[i] = tolower(devicesKey[i]);

    char* substr = strstr(devicesKey, "\\registry\\machine\\");
    if ( substr != 0 )
        substr += strlen("\\registry\\machine\\");
    else
        substr = devicesKey;
    LDEBUG("registry key: " << substr);

    HKEY hKey = NULL;
    LONG stat = RegOpenKeyEx(HKEY_LOCAL_MACHINE, substr, 0, KEY_READ, &hKey);
    if ( stat == ERROR_SUCCESS ) {
        DWORD type = 0;
        DWORD bufferSize = 4;
        char* data = new char[bufferSize + 1];
        memset(data, 0, bufferSize + 1);
        stat = RegQueryValueEx(hKey, "HardwareInformation.MemorySize",
            NULL, &type, (BYTE*) data, &bufferSize);
        if ((stat == ERROR_SUCCESS) && ((type == REG_BINARY) ||
            (getOSVersion() == GpuCapabilities::OS_WIN_VISTA && type == REG_DWORD)))
        {
            LDEBUG("read " << bufferSize << " BYTES from key 'HardwareInformation.MemorySize'...");
            for ( DWORD i = (bufferSize - 1); ; i-- ) {
                LDEBUG("data[" << i << "]: " << static_cast<DWORD>(data[i]));
                memSize |= (data[i] << (i * 8));

                // As DWORD is unsigned, the loop would never exit if
                // it would not be broken...
                //
                if ( i == 0 )
                    break;
             }
             LDEBUG("data converted to " << memSize << " (means " << (memSize / (1024 * 1024)) << " MByte)\n");
        }
        RegCloseKey(hKey);
        hKey = NULL;
        delete [] data;
        data = 0;
    }
    else
        LERROR("Error opening key " << substr << ". Reason: " << stat);

    delete [] devicesKey;
    devicesKey = 0;
    return memSize;
}
开发者ID:tusharuiit,项目名称:2014-2015_HiwiMedicalXTTVisualization,代码行数:55,代码来源:gpucapabilitieswindows.cpp


示例15: LDEBUG

	void Parameters::resetParameters(const int argc, char * argv[])
	{
		std::vector<std::string> m_temp;
		LDEBUG("Parsing parameters...");
		LDEBUG("Number of parameters: "<<argc);
		for (int i(0); i < argc; ++i) {
			m_temp.emplace_back(argv[i]);
			LDEBUG("Parameter: " << argv[i]);
		}
		_resetParameters(std::move(m_temp));
	}
开发者ID:LeDYoM,项目名称:sgh,代码行数:11,代码来源:parameters.cpp


示例16: loadDictionaryFromString

bool loadDictionaryFromString(
    const std::string& script,
    ghoul::Dictionary& dictionary,
    lua_State* state
    )
{
    const static std::string _loggerCat = "lua_loadDictionaryFromString";

    if (state == nullptr) {
        if (_state == nullptr) {
            LDEBUG("Creating Lua state");
            _state = luaL_newstate();
            if (_state == nullptr) {
                LFATAL("Error creating new Lua state: Memory allocation error");
                return false;
            }
            LDEBUG("Open libraries");
            luaL_openlibs(_state);
        }
        state = _state;
    }

    LDEBUG("Loading dictionary script '" << script.substr(0, 12) << "[...]'");
    int status = luaL_loadstring(state, script.c_str());
    if (status != LUA_OK) {
        LERROR("Error loading script: '" << lua_tostring(state, -1) << "'");
        return false;
    }

    LDEBUG("Executing script");
    if (lua_pcall(state, 0, LUA_MULTRET, 0)) {
        LERROR("Error executing script: " << lua_tostring(state, -1));
        return false;
    }

    if (lua_isnil(state, -1)) {
        LERROR("Error in script: '" << script.substr(0, 12)
                                    << "[...]'. Script did not return anything.");
        return false;
    }

    if (!lua_istable(state, -1)) {
        LERROR("Error in script: '" << script.substr(0, 12)
                                    << "[...]'. Script did not return a table.");
        return false;
    }

    luaDictionaryFromState(state, dictionary);

    // Clean up after ourselves by cleaning the stack
    lua_settop(state, 0);

    return true;
}
开发者ID:forsythrosin,项目名称:Ghoul,代码行数:54,代码来源:lua_helper.cpp


示例17: itsFd

// ##############################################################################################################
jevois::Camera::Camera(std::string const & devname, unsigned int const nbufs) :
    jevois::VideoInput(devname, nbufs), itsFd(-1), itsBuffers(nullptr), itsFormat(), itsStreaming(false), itsFps(0.0F)
{
  JEVOIS_TRACE(1);

  JEVOIS_TIMED_LOCK(itsMtx);
  
  // Get our run() thread going and wait until it is cranking, it will flip itsRunning to true as it starts:
  itsRunFuture = std::async(std::launch::async, &jevois::Camera::run, this);
  while (itsRunning.load() == false) std::this_thread::sleep_for(std::chrono::milliseconds(5));

  // Open the device:
  itsFd = open(devname.c_str(), O_RDWR | O_NONBLOCK, 0);
  if (itsFd == -1) PLFATAL("Camera device open failed on " << devname);

  // See what kinds of inputs we have and select the first one that is a camera:
  int camidx = -1;
  struct v4l2_input inp = { };
  while (true)
  {
    try { XIOCTL_QUIET(itsFd, VIDIOC_ENUMINPUT, &inp); } catch (...) { break; }
    if (inp.type == V4L2_INPUT_TYPE_CAMERA)
    {
      if (camidx == -1) camidx = inp.index;
      LDEBUG("Input " << inp.index << " [" << inp.name << "] is a camera sensor");
    } else LDEBUG("Input " << inp.index << " [" << inp.name << "] is a NOT camera sensor");
    ++inp.index;
  }

  if (camidx == -1) LFATAL("No valid camera input found on device " << devname);
  
  // Select the camera input, this seems to be required by VFE for the camera to power on:
  XIOCTL(itsFd, VIDIOC_S_INPUT, &camidx);

  // Find out what camera can do:
  struct v4l2_capability cap = { };
  XIOCTL(itsFd, VIDIOC_QUERYCAP, &cap);
  
  LINFO('[' << itsFd << "] V4L2 camera " << devname << " card " << cap.card << " bus " << cap.bus_info);
  if ((cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) == 0) LFATAL(devname << " is not a video capture device");
  if ((cap.capabilities & V4L2_CAP_STREAMING) == 0) LFATAL(devname << " does not support streaming");
  
  // List the supported formats:
  struct v4l2_fmtdesc fmtdesc = { };
  fmtdesc.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
  while (true)
  {
    try { XIOCTL_QUIET(itsFd, VIDIOC_ENUM_FMT, &fmtdesc); } catch (...) { break; }
    LDEBUG("Format " << fmtdesc.index << " is [" << fmtdesc.description << "] fcc " << std::showbase <<
           std::hex << fmtdesc.pixelformat << " [" << jevois::fccstr(fmtdesc.pixelformat) << ']');
    ++fmtdesc.index;
  }
}
开发者ID:Dennis-Wijngaarden,项目名称:jevois,代码行数:54,代码来源:Camera.C


示例18: set_new_offset

void set_new_offset(unsigned long long size)
{
    unsigned long long offset = 0;

    FUNC;
    LDEBUG("oldoffset is %llu : add size %llu", nextoffset, size);
    offset = round_512(size);
    nextoffset = nextoffset + offset;
    LDEBUG("nextoffset is now %llu", nextoffset);
    EFUNC;
    return;
}
开发者ID:chineseneo,项目名称:lessfs,代码行数:12,代码来源:file_io.c


示例19: LDEBUG

std::future<DownloadManager::MemoryFile> ScreenSpaceImage::downloadImageToMemory(
    std::string url)
{
    return std::move(OsEng.downloadManager().fetchFile(
        url,
        [url](const DownloadManager::MemoryFile& file) {
            LDEBUG("Download to memory finished for screen space image");
        },
        [url](const std::string& err) {
            LDEBUG("Download to memory failer for screen space image: " +err);
        }
    ));
}
开发者ID:OpenSpace,项目名称:OpenSpace,代码行数:13,代码来源:screenspaceimage.cpp


示例20: LDEBUG

void ModelManager::registerReader(ModelReader* mr) {
    readerSet_.insert(mr);
    LDEBUG("ModuleManager: Registering reader: " << mr->getName());

    std::string formats = "";
    std::vector<std::string> knownEndings = mr->getEndings();
    std::vector<std::string>::iterator i;
    for ( i = knownEndings.begin(); i != knownEndings.end(); ++i ) {
        readers_[*i] = mr;
        formats += *i + " ";
    }
    LDEBUG("Known formats: " << formats);
}
开发者ID:alvatar,项目名称:smartmatter,代码行数:13,代码来源:modelmanager.cpp



注:本文中的LDEBUG函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LDK函数代码示例发布时间:2022-05-30
下一篇:
C++ LDAP_STRDUP函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap