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

C++ readFrame函数代码示例

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

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



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

示例1: runningLock

	void
	V4LFrameSource::run() {
		RecursiveMutexLock runningLock(m_runningMutex);
		
		int64_t frameTS = -1;
		int64_t lastFrameTS = -1;
		
		while (m_isRunning) {
			runningLock.unlock();

			try {
				FramePtr frame(new Frame());

				readFrame(frame.get());
				
				frameTS = frame->getTimestamp();

				{
					RecursiveMutexLock framePtrLock(m_framePtrMutex);
					m_lastFrame = frame;
				}

				emitFrame(frame);

				lastFrameTS = frameTS;
			} catch (EOFException e) {
				break;
			} catch (IOException e) {
				std::cout << "ERROR: " << e.what() << std::endl;
			}

			runningLock.lock();
		}
	}
开发者ID:pfrommerd,项目名称:vlab,代码行数:34,代码来源:V4LFrameSource.cpp


示例2: IdleCallback

void IdleCallback()
{
	XnStatus nRetVal = XN_STATUS_OK;
	if (g_bPause != TRUE)
	{
		// read a frame
		readFrame();
        
		// capture if needed
		nRetVal = captureFrame();
		if (nRetVal != XN_STATUS_OK)
		{
			displayMessage("Error capturing frame: '%s'", xnGetStatusString(nRetVal));
		}
        
		// add to statistics
		//statisticsAddFrame();
	}
    
	if (g_bStep == TRUE)
	{
		g_bStep = FALSE;
		g_bPause = TRUE;
	}
    
	glutPostRedisplay();
}
开发者ID:mpweinge,项目名称:KinectHandTracker,代码行数:27,代码来源:main.cpp


示例3: assert

uint32_t TFramedTransport::readSlow(uint8_t* buf, uint32_t len) {
  uint32_t want = len;
  uint32_t have = rBound_ - rBase_;

  // We should only take the slow path if we can't satisfy the read
  // with the data already in the buffer.
  assert(have < want);

  // If we have some data in the buffer, copy it out and return it.
  // We have to return it without attempting to read more, since we aren't
  // guaranteed that the underlying transport actually has more data, so
  // attempting to read from it could block.
  if (have > 0) {
    memcpy(buf, rBase_, have);
    setReadBuffer(rBuf_.get(), 0);
    return have;
  }

  // Read another frame.
  if (!readFrame()) {
    // EOF.  No frame available.
    return 0;
  }

  // TODO(dreiss): Should we warn when reads cross frames?

  // Hand over whatever we have.
  uint32_t give = std::min(want, static_cast<uint32_t>(rBound_ - rBase_));
  memcpy(buf, rBase_, give);
  rBase_ += give;
  want -= give;

  return (len - want);
}
开发者ID:alkeshpatel11,项目名称:libthrift,代码行数:34,代码来源:TBufferTransports.cpp


示例4: openCommon

int openCommon(openni::Device& device, DeviceConfig config)
{
    g_pPlaybackControl = g_device.getPlaybackControl();

    int ret;

    ret = openStream(device, "depth", openni::SENSOR_DEPTH, config.openDepth, g_depthStream, &g_depthSensorInfo, &g_bIsDepthOn);
    if (ret != 0)
    {
        return ret;
    }

    ret = openStream(device, "color", openni::SENSOR_COLOR, config.openColor, g_colorStream, &g_colorSensorInfo, &g_bIsColorOn);
    if (ret != 0)
    {
        return ret;
    }

    ret = openStream(device, "IR", openni::SENSOR_IR, config.openIR, g_irStream, &g_irSensorInfo, &g_bIsIROn);
    if (ret != 0)
    {
        return ret;
    }

    initConstants();

    readFrame();

    return 0;
}
开发者ID:higuchi-yuuki,项目名称:OpenNI2,代码行数:30,代码来源:Device.cpp


示例5: recvframe

void AdminConnection::processLogin(){
  InputFrame::Ptr recvframe( new InputFrame(version, paddingfilter) );
  if (readFrame(recvframe)) {
    try {
      if(recvframe->getType() == ft02_Login){
        std::string username, password;

        if ( getAuth( recvframe, username, password ) ) {

          bool authenticated = false;
          try{
            if(username == Settings::getSettings()->get("admin_user") && password == Settings::getSettings()->get("admin_pass"))
              authenticated = true;
          }catch(std::exception e){
          }
          if(authenticated){
            sendOK( recvframe, "Welcome" );
            INFO("Admin login ok by %s", username.c_str());
            logextid = Logger::getLogger()->addLog( LogSink::Ptr( new AdminLogger( boost::dynamic_pointer_cast<AdminConnection>(shared_from_this()) ) ) );
            status = READY;
          } else {
            throw FrameException( fec_FrameError, "Admin Login Error - bad username or password"); // TODO - should be a const or enum, Login error
          }
        }

      }else{
        throw FrameException( fec_FrameError, "Wrong type of frame in this state, wanted login");
      }
    } catch ( FrameException& exception ) {
      // This might be overkill later, but now let's log it
      DEBUG( "AdminConnection caught FrameException : %s", exception.what() );
      sendFail( recvframe, exception.getErrorCode(), exception.getErrorMessage() );
    }
  }
}
开发者ID:glew,项目名称:tpserver-cpp,代码行数:35,代码来源:adminconnection.cpp


示例6: frame

void AdminConnection::processNormalFrame()
{
  InputFrame::Ptr frame( new InputFrame(version,paddingfilter) );
  if (readFrame(frame)) {
    try {
      switch (frame->getType()) {
        case ftad_CommandDesc_Get:
          processDescribeCommand(frame);
          break;
        case ftad_CommandTypes_Get:
          processGetCommandTypes(frame);
          break;
        case ftad_Command:
          processCommand(frame);
          break;
        default:
          WARNING("AdminConnection: Discarded frame, not processed, was type %d", frame->getType());
          throw FrameException( fec_ProtocolError, "Did not understand that frame type.");
          break;
      }
    } catch ( FrameException& exception ) {
      // This might be overkill later, but now let's log it
      DEBUG( "AdminConnection caught FrameException : %s", exception.what() );
      sendFail( frame, exception.getErrorCode(), exception.getErrorMessage() );
    }
  } else {
    DEBUG("noFrame :(");
    // client closed
  }
}
开发者ID:glew,项目名称:tpserver-cpp,代码行数:30,代码来源:adminconnection.cpp


示例7: ASSERT

StackVisitor::StackVisitor(CallFrame* startFrame, VM* vm)
{
    m_frame.m_index = 0;
    m_frame.m_isWasmFrame = false;
    CallFrame* topFrame;
    if (startFrame) {
        ASSERT(vm);
        ASSERT(!vm->topCallFrame || reinterpret_cast<void*>(vm->topCallFrame) != vm->topEntryFrame);

        m_frame.m_entryFrame = vm->topEntryFrame;
        topFrame = vm->topCallFrame;

        if (topFrame && topFrame->isStackOverflowFrame()) {
            topFrame = topFrame->callerFrame(m_frame.m_entryFrame);
            m_topEntryFrameIsEmpty = (m_frame.m_entryFrame != vm->topEntryFrame);
            if (startFrame == vm->topCallFrame)
                startFrame = topFrame;
        }

    } else {
        m_frame.m_entryFrame = 0;
        topFrame = 0;
    }
    m_frame.m_callerIsEntryFrame = false;
    readFrame(topFrame);

    // Find the frame the caller wants to start unwinding from.
    while (m_frame.callFrame() && m_frame.callFrame() != startFrame)
        gotoNextFrame();
}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:30,代码来源:StackVisitor.cpp


示例8: llclose_transmitter

int llclose_transmitter(int fd) {
    info->tentativas = tentativas;

    while(info->tentativas > 0) {
        buildFrame(info->flag, "disc");
        transmitirFrame(info->frameSend, info->frameSendLength);
        start_alarm();

        info->frameTempLength = readFrame(info->frameTemp);
        char * type = malloc(5);
        type = verifyFrameType(info->frameTemp);
        if (verifyFrame(info->frameTemp, info->frameTempLength, "disc")) {
            buildFrame(info->flag, "ua");
            if(transmitirFrame(info->frameSend, info->frameSendLength))
                break;
        }
    }

    if (info->tentativas == 0) {
        printf("Número de tentativas chegou ao fim. \n");
        exit(-1);
    }

    sleep(1);
    if ( tcsetattr(info->fd,TCSANOW,&info->oldtio) == -1) {
        perror("tcsetattr");
        return -1;
    }
    close(fd);
    printf("fechou transmissor\n");
    return 1;
}
开发者ID:joaoDavidGB,项目名称:RCOM,代码行数:32,代码来源:link_layer.c


示例9: while

void ofxColorStream ::threadedFunction()
{
	while (isThreadRunning())
	{
		readFrame();
	}
}
开发者ID:eranws,项目名称:ofxOpenNi2,代码行数:7,代码来源:ofxColorStream.cpp


示例10: AVG_ASSERT

FrameAvailableCode SyncVideoDecoder::getRenderedBmps(vector<BitmapPtr>& pBmps, 
        float timeWanted)
{
    AVG_ASSERT(getState() == DECODING);
    ScopeTimer timer(RenderToBmpProfilingZone);
    FrameAvailableCode frameAvailable;
    if (timeWanted == -1) {
        readFrame(m_pFrame);
        frameAvailable = FA_NEW_FRAME;
    } else {
        frameAvailable = readFrameForTime(m_pFrame, timeWanted);
    }
    if (frameAvailable == FA_USE_LAST_FRAME || isEOF()) {
        return FA_USE_LAST_FRAME;
    } else {
        allocFrameBmps(pBmps);
        if (pixelFormatIsPlanar(getPixelFormat())) {
            ScopeTimer timer(CopyImageProfilingZone);
            for (unsigned i = 0; i < pBmps.size(); ++i) {
                m_pFrameDecoder->copyPlaneToBmp(pBmps[i], m_pFrame->data[i],
                        m_pFrame->linesize[i]);
            }
        } else {
            m_pFrameDecoder->convertFrameToBmp(m_pFrame, pBmps[0]);
        }
        return FA_NEW_FRAME;
    }
}
开发者ID:hoodie,项目名称:libavg,代码行数:28,代码来源:SyncVideoDecoder.cpp


示例11: assert

uint32_t TFramedTransport::readSlow(uint8_t* buf, uint32_t len) {
  uint32_t want = len;
  uint32_t have = rBound_ - rBase_;

  // We should only take the slow path if we can't satisfy the read
  // with the data already in the buffer.
  assert(have < want);

  // Copy out whatever we have.
  if (have > 0) {
    memcpy(buf, rBase_, have);
    want -= have;
    buf += have;
  }

  // Read another frame.
  if (!readFrame()) {
    // EOF.  No frame available.
    return 0;
  }

  // TODO(dreiss): Should we warn when reads cross frames?

  // Hand over whatever we have.
  uint32_t give = std::min(want, static_cast<uint32_t>(rBound_ - rBase_));
  memcpy(buf, rBase_, give);
  rBase_ += give;
  want -= give;

  return (len - want);
}
开发者ID:longcongduoi,项目名称:Thrift_ASIO,代码行数:31,代码来源:TBufferTransports.cpp


示例12: readFrame

int KitSocket::read(char *data, int len)
{
	sflap_frame frame;
	int i = readFrame(frame);
	if(i != -1) memcpy( (void *)data, (void *)frame.data, len );
	return i;
}
开发者ID:icefox,项目名称:kinkatta,代码行数:7,代码来源:kitsocket.cpp


示例13: printf

// ######################################################################
void SerialPort::connect() {
  // Check to see if we have a hardcoded device name. If so, then let's just
  // go ahead and enable that port. If
  printf("INFO: Looking Device Name [%s]\n", itsDevName.c_str());
  if (itsDevName != "") {
    printf("INFO: Opening %s\n", itsDevName.c_str());
    enablePort(itsDevName);
  } else if (itsDevName == "search") {
    printf("INFO: Searching for devices\n");
    itsCmdDevName = "";

    DIR *directory_p;
    struct dirent *entry_p;

    // Open the device directory to search for devices whose names match the
    // search prefix
    directory_p = ::opendir("/dev");
    if (directory_p == NULL)
      printf("FATAL ERROR: Could Not Open /dev Directory!\n");

    // Iterate through the directory entries
    while ((entry_p = ::readdir(directory_p))) {
      std::string entryName(entry_p->d_name);
      if (entryName.find(itsSearchPrefix.c_str()) !=
          std::string::npos) {  // If the directory entry name matches our
                                // search prefix, then let's try configuring a
                                // serial
        // port on that device, sending it an identity request command (0x00),
        // and comparing the result
        // with our required device description

        enablePort("/dev/" + entryName);
        unsigned char cmd[1] = {0};

        write(cmd, 1);
        std::vector<unsigned char> deviceStringVec = readFrame(cmd[0], 255);

        std::string deviceString(deviceStringVec.begin(),
                                 deviceStringVec.end());
        printf("INFO: %s : %s", entryName.c_str(), deviceString.c_str());

        if (deviceString == itsDeviceDescription) {
          itsCmdDevName = "/dev/" + entryName;
          break;
        }
      }
    }
    (void)::closedir(directory_p);
    if (itsCmdDevName == "") {
      printf(
          "FATAL ERROR: Could Not Find Serial Device Matching Descriptor "
          "(%s)\n",
          itsDeviceDescription.c_str());
    }
  } else {
    printf("INFO: Opening from cmd line %s\n", itsCmdDevName.c_str());
    enablePort(itsCmdDevName);
  }
}
开发者ID:sonia-auv,项目名称:provider_sonar,代码行数:60,代码来源:Serial.cpp


示例14: openCamera

void FFmpegVideo::init(const QString &dev)
{
    openCamera(dev);

    connect(m_timer, SIGNAL(timeout()), this, SLOT(readFrame()));
    m_timer->start(100);

}
开发者ID:thewon86,项目名称:ffmpeg_camera,代码行数:8,代码来源:ffmpegvideo.cpp


示例15: pcd

clams::Cloud::Ptr clams::StreamSequenceBase::getCloud(size_t idx) const
{
  Cloud::Ptr pcd(new Cloud);
  Frame frame;
  readFrame(idx, &frame);
  proj_.frameToCloud(frame, pcd.get());
  return pcd;
}
开发者ID:dcanelhas,项目名称:clams,代码行数:8,代码来源:stream_sequence_base.cpp


示例16: readFrame

void Editor::resetBuffer()
{
	m_headFrame = 0;
	m_frameIdx = 0;
	m_fullBuffer = false;
	
	readFrame(true);
	m_headFrame++;
}
开发者ID:kostyll,项目名称:justcutit,代码行数:9,代码来源:editor.cpp


示例17: QWidget

Capture::Capture(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Capture)
{
    ui->setupUi(this);

    //initialize
    ///111
    take_photo_flag = 0;
    ///111
    num = 0;
    send_frame_flag = 0;
    //capture = NULL;
    //timer = new QTimer(this);
    photos = new Photos();

    this->first_open_cam_flag = 0;
    this->open_cam_flag=0;
    timer=new QTimer(this);
    connect(timer,SIGNAL(timeout()),this,SLOT(update()));
    //initialize socketbind port 63636
    send_socket = new QUdpSocket(this);
    send_socket->bind(63636, QUdpSocket::ShareAddress);

    //enable button
    ui->close_pushButton->setDisabled(true);
    //ui->image_close_pushButton->setDisabled(false);
    ui->take_photo_pushButton->setDisabled(true);

    //this->setWindowFlags(Qt::Tool | Qt::X11BypassWindowManagerHint);
    this->setWindowFlags(Qt::FramelessWindowHint);
    ui->video_label->setStyleSheet ("background-color: #000000;color: #ffffff;");

    //C_translateLanguage();//set the content of button

    this->picNum = 0;

    //serial_port
    this->serial_open_flag = 0;
    struct PortSettings myComSetting = {BAUD4800,DATA_8,PAR_NONE,STOP_1,FLOW_OFF,10};
    myCom = new Posix_QextSerialPort("/dev/ttyUSB0",myComSetting,QextSerialBase::Polling);
    //myCom->open(QIODevice::ReadWrite);

    readTimer = new QTimer(this);
    readTimer->start(10);

    connect(readTimer,SIGNAL(timeout()),this,SLOT(readMyCom()));

    connect(send_socket, SIGNAL(readyRead()), this, SLOT(readData()));
    connect(ui->open_pushButton,SIGNAL(clicked()),this,SLOT(openCapture()));
    connect(ui->close_pushButton,SIGNAL(clicked()),this,SLOT(closeCapture()));
    connect(timer,SIGNAL(timeout()),this,SLOT(readFrame()));
    connect(ui->image_open_pushButton, SIGNAL(clicked()), this, SLOT(openPhotos()));
    connect(ui->image_close_pushButton, SIGNAL(clicked()), this, SLOT(closePhotos()));
    connect(photos, SIGNAL(closeImage()), this, SLOT(closePhotos()));
    connect(ui->take_photo_pushButton, SIGNAL(clicked()), this, SLOT(takePhotos()));
}
开发者ID:AchillesL,项目名称:ARM,代码行数:57,代码来源:capture.cpp


示例18: readFrame

StackVisitor::StackVisitor(CallFrame* startFrame)
{
    m_frame.m_index = 0;
    if (startFrame)
        m_frame.m_VMEntryFrame = startFrame->vm().topVMEntryFrame;
    else
        m_frame.m_VMEntryFrame = 0;
    m_frame.m_callerIsVMEntryFrame = false;
    readFrame(startFrame);
}
开发者ID:morpheus502,项目名称:webkit,代码行数:10,代码来源:StackVisitor.cpp


示例19: QDialog

Dialog1::Dialog1(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog1)
{
    ui->setupUi(this);
    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(readFrame()));
    //ui->nextLoop->setVisible(false);
    ui->openCamera_2->setVisible(false);
    ui->camFrameView->setVisible(false);
}
开发者ID:gdc0411,项目名称:M1project,代码行数:11,代码来源:dialog1.cpp


示例20: ENABLE

void StackVisitor::gotoNextFrame()
{
#if ENABLE(DFG_JIT)
    if (m_frame.isInlinedFrame()) {
        InlineCallFrame* inlineCallFrame = m_frame.inlineCallFrame();
        CodeOrigin* callerCodeOrigin = inlineCallFrame->getCallerSkippingDeadFrames();
        if (!callerCodeOrigin) {
            while (inlineCallFrame) {
                readInlinedFrame(m_frame.callFrame(), &inlineCallFrame->directCaller);
                inlineCallFrame = m_frame.inlineCallFrame();
            }
            m_frame.m_VMEntryFrame = m_frame.m_CallerVMEntryFrame;
            readFrame(m_frame.callerFrame());
        } else
            readInlinedFrame(m_frame.callFrame(), callerCodeOrigin);
        return;
    }
#endif // ENABLE(DFG_JIT)
    m_frame.m_VMEntryFrame = m_frame.m_CallerVMEntryFrame;
    readFrame(m_frame.callerFrame());
}
开发者ID:EQ4,项目名称:webkit-mips,代码行数:21,代码来源:StackVisitor.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ readFrom函数代码示例发布时间:2022-05-30
下一篇:
C++ readFloat函数代码示例发布时间: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