Beispiel #1
0
TEST_F(ModeMapTest, Removal)
{
    unsigned n;
    gmac::opencl::lite::ModeMap map; 
    std::list<cl_context> contexts;

    SCOPED_TRACE("CreateContext");
    CreateContexts(contexts, map, num_modes);
    if(HasFatalFailure()) return;
        
    std::list<cl_context>::iterator i;
    for(n = 0, i = contexts.begin(); i != contexts.end(); n++) {
        if((n % 2) == 0) { i++; continue; }
        ASSERT_TRUE(map.get(*i) != NULL);
        map.remove(*i);
        ASSERT_TRUE(map.get(*i) == NULL);
        ASSERT_EQ(CL_SUCCESS, clReleaseContext(*i));
        i = contexts.erase(i);
    }

    for(i = contexts.begin(); i != contexts.end(); i++) {
        ASSERT_TRUE(map.get(*i) != NULL);
    }

    SCOPED_TRACE("CleanUpContext");
    CleanUpContexts(contexts, map);
    if(HasFatalFailure()) return;
}
Beispiel #2
0
 virtual void SetUp() {
   BaseDecoderTest::SetUp();
   if (HasFatalFailure()) {
     return;
   }
   BaseEncoderTest::SetUp();
   if (HasFatalFailure()) {
     return;
   }
   SHA1_Init(&ctx_);
 }
Beispiel #3
0
TEST_F(ModeMapTest, Insertion)
{
    gmac::opencl::lite::ModeMap map; 
    std::list<cl_context> contexts;

    SCOPED_TRACE("CreateContext");
    CreateContexts(contexts, map, num_modes);
    if(HasFatalFailure()) return;
    SCOPED_TRACE("CleanUpContext");
    CleanUpContexts(contexts, map);
    if(HasFatalFailure()) return;
}
Beispiel #4
0
 virtual void SetUp() {
   EncoderInitTest::SetUp();
   if (HasFatalFailure()) {
     return;
   }
   SHA1Reset (&ctx_);
 }
    CameraFrameTest() : CameraStreamFixture(STREAM_PARAMETERS) {
        TEST_EXTENSION_FORKING_CONSTRUCTOR;

        if (!HasFatalFailure()) {
            CreateStream();
        }
    }
TEST(SubroutineAsserts, Test) {
	Foo(3);

	if (HasFatalFailure())
		return FailTest();

	ASSERT_TRUE(false);
}
Beispiel #7
0
TEST_P(DecoderOutputTest, CompareOutput) {
  FileParam p = GetParam();
  DecodeFile(p.fileName, this);

  unsigned char digest[SHA_DIGEST_LENGTH];
  SHA1Result(&ctx_, digest);
  if (!HasFatalFailure()) {
    CompareHash(digest, p.hashStr);
  }
}
Beispiel #8
0
TEST_P(DecodeEncodeTest, CompareOutput) {
  DecodeEncodeFileParam p = GetParam();

  ASSERT_TRUE(Open(p.fileName));
  EncodeStream(this, p.width, p.height, p.frameRate, this);
  unsigned char digest[SHA_DIGEST_LENGTH];
  SHA1_Final(digest, &ctx_);
  if (!HasFatalFailure()) {
    ASSERT_TRUE(CompareHash(digest, p.hashStr));
  }
}
TEST_P (DecodeEncodeTest, CompareOutput) {
  DecodeEncodeFileParam p = GetParam();

  ASSERT_TRUE (Open (p.fileName));
  EncodeStream (this, CAMERA_VIDEO_REAL_TIME, p.width, p.height, p.frameRate, SM_SINGLE_SLICE, false, 1, this);
  unsigned char digest[SHA_DIGEST_LENGTH];
  SHA1Result (&ctx_, digest);
  if (!HasFatalFailure()) {
    CompareHash (digest, p.hashStr);
  }
}
Beispiel #10
0
TEST_P (EncoderOutputTest, CompareOutput) {
  EncodeFileParam p = GetParam();
  EncodeFile (p.fileName, p.usageType , p.width, p.height, p.frameRate, p.slices, p.denoise, p.layers, this);

  //will remove this after screen content algorithms are ready,
  //because the bitstream output will vary when the different algorithms are added.
  unsigned char digest[SHA_DIGEST_LENGTH];
  SHA1Result (&ctx_, digest);
  if (!HasFatalFailure()) {
    CompareHash (digest, p.hashStr);
  }
}
TEST_P (DecoderOutputTest, CompareOutput) {
  FileParam p = GetParam();
#if defined(ANDROID_NDK)
  std::string filename = std::string ("/sdcard/") + p.fileName;
  DecodeFile (filename.c_str(), this);
#else
  DecodeFile (p.fileName, this);
#endif

  unsigned char digest[SHA_DIGEST_LENGTH];
  SHA1Result (&ctx_, digest);
  if (!HasFatalFailure()) {
    CompareHash (digest, p.hashStr);
  }
}
Beispiel #12
0
 virtual int read(void* ptr, size_t len) {
   while (buf_.Length() < len) {
     bool hasNext = DecodeNextFrame(this);
     if (HasFatalFailure()) {
       return -1;
     }
     if (!hasNext) {
       if (buf_.Length() == 0) {
         return -1;
       }
       break;
     }
   }
   return buf_.PopFront(static_cast<uint8_t*>(ptr), len);
 }
Beispiel #13
0
TEST_P (EncoderOutputTest, CompareOutput) {
  EncodeFileParam p = GetParam();
#if defined(ANDROID_NDK)
  std::string filename = std::string ("/sdcard/") + p.fileName;
  EncodeFile (filename.c_str(), p.usageType , p.width, p.height, p.frameRate, p.slices, p.denoise, p.layers, p.isLossless, p.enableLtr, this);
#else
  EncodeFile (p.fileName, p.usageType , p.width, p.height, p.frameRate, p.slices, p.denoise, p.layers, p.isLossless, p.enableLtr, this);
#endif
  //will remove this after screen content algorithms are ready,
  //because the bitstream output will vary when the different algorithms are added.
  unsigned char digest[SHA_DIGEST_LENGTH];
  SHA1Result (&ctx_, digest);
  if (!HasFatalFailure()) {
    CompareHash (digest, p.hashStr);
  }
}
TEST_P (DecodeEncodeTest, CompareOutput) {
    DecodeEncodeFileParam p = GetParam();
    SEncParamExt  EnxParamExt;
    DecEncFileParamToParamExt (&p, &EnxParamExt);

#if defined(ANDROID_NDK)
    std::string filename = std::string ("/sdcard/") + p.fileName;
    ASSERT_TRUE (Open (filename.c_str()));
#else
    ASSERT_TRUE (Open (p.fileName));
#endif
    EncodeStream (this, &EnxParamExt, this);
    unsigned char digest[SHA_DIGEST_LENGTH];
    SHA1Result (&ctx_, digest);
    if (!HasFatalFailure()) {
        CompareHash (digest, p.hashStr);
    }
}
Beispiel #15
0
TEST_P (EncoderOutputTest, CompareOutput) {
  EncodeFileParam p = GetParam();
  SEncParamExt EnxParamExt;

  EncFileParamToParamExt (&p, &EnxParamExt);

#if defined(ANDROID_NDK)
  std::string filename = std::string ("/sdcard/") + p.pkcFileName;
  EncodeFile (p.pkcFileName, &EnxParamExt, this);
#else
  EncodeFile (p.pkcFileName, &EnxParamExt, this);
#endif
  //will remove this after screen content algorithms are ready,
  //because the bitstream output will vary when the different algorithms are added.
  unsigned char digest[SHA_DIGEST_LENGTH];
  SHA1Result (&ctx_, digest);
  if (!HasFatalFailure()) {
    CompareHash (digest, p.pkcHashStr);
  }
}