Exemplo n.º 1
0
bool BaseDecoderTest::DecodeFile (const char* fileName, Callback* cbk) {
  std::ifstream file (fileName, std::ios::in | std::ios::binary);
  if (!file.is_open())
    return false;

  BufferedData buf;
  while (true) {
    if (false == ReadFrame(&file, &buf))
      return false;
    if (::testing::Test::HasFatalFailure()) {
      return false;
    }
    if (buf.Length() == 0) {
      break;
    }
    DecodeFrame (buf.data(), buf.Length(), cbk);
    if (::testing::Test::HasFatalFailure()) {
      return false;
    }
  }

  int32_t iEndOfStreamFlag = 1;
  decoder_->SetOption (DECODER_OPTION_END_OF_STREAM, &iEndOfStreamFlag);

  // Get pending last frame
  DecodeFrame (NULL, 0, cbk);
  // Flush out last frames in decoder buffer
  int32_t num_of_frames_in_buffer = 0;
  decoder_->GetOption (DECODER_OPTION_NUM_OF_FRAMES_REMAINING_IN_BUFFER, &num_of_frames_in_buffer);
  for (int32_t i = 0; i < num_of_frames_in_buffer; ++i) {
    FlushFrame (cbk);
  }
  return true;
}
Exemplo n.º 2
0
void QcacheEntry_c::RankerReset()
{
	FlushFrame();

	// 01000000 is a delta restart marker
	m_dData.Add(0x40);
	m_uLastDocid = 0;
}
Exemplo n.º 3
0
void QcacheEntry_c::Append ( SphDocID_t uDocid, DWORD uWeight )
{
	m_iTotalMatches++;

	QcacheMatch_t & m = m_dFrame.Add();
	m.m_uDocid = uDocid;
	m.m_uWeight = uWeight;

	if ( m_dFrame.GetLength()==MAX_FRAME_SIZE )
		FlushFrame();
}
Exemplo n.º 4
0
void MyRenderBase::Render( const playerView_t &view ) {
    OnPreRender();

    for ( int i = 0; i < m_surfs.size(); ++i ) {
        RenderSurface( m_surfs[i] );
    }

    OnPostRender();

    m_surfs.clear();

    FlushFrame();
}