示例#1
0
int OMXReader::GetSourceBitrate()
{
  int ret = 0;

  if(!m_pFile)
    return 0;

  if(m_pFile->GetBitstreamStats())
  {
    BitstreamStats *status = m_pFile->GetBitstreamStats();
    ret = status->GetBitrate();
  }

  return ret;
}
示例#2
0
TEST(TestBitstreamStats, General)
{
  int i;
  BitstreamStats a;
  CTestBitstreamStatsThread t;

  i = 0;
  a.Start();
  EXPECT_EQ(0.0, a.GetBitrate());
  EXPECT_EQ(0.0, a.GetMaxBitrate());
  EXPECT_EQ(-1.0, a.GetMinBitrate());
  while (i <= BITS)
  {
    a.AddSampleBits(1);
    i++;
    t.Sleep(1);
  }
  a.CalculateBitrate();
  EXPECT_GT(a.GetBitrate(), 0.0);
  EXPECT_GT(a.GetMaxBitrate(), 0.0);
  EXPECT_GT(a.GetMinBitrate(), 0.0);

  i = 0;
  while (i <= BYTES)
  {
    a.AddSampleBytes(1);
    t.Sleep(2);
    i++;
  }
  a.CalculateBitrate();
  EXPECT_GT(a.GetBitrate(), 0.0);
  EXPECT_GT(a.GetMaxBitrate(), 0.0);
  EXPECT_LE(a.GetMinBitrate(), a.GetMaxBitrate());
}