MCPcopy Create free account
hub / github.com/cisco/openh264 / EncodeTestAPI

Class EncodeTestAPI

test/api/encode_options_test.cpp:1302–1325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1300};
1301
1302class EncodeTestAPI : public ::testing::TestWithParam<EncodeOptionParam>, public ::EncodeDecodeTestAPIBase {
1303 public:
1304 void SetUp() {
1305 EncodeDecodeTestAPIBase::SetUp();
1306 }
1307
1308 void TearDown() {
1309 EncodeDecodeTestAPIBase::TearDown();
1310 }
1311 void EncodeOneFrameRandom (int iCheckTypeIndex, bool bAllRandom) {
1312 int frameSize = EncPic.iPicWidth * EncPic.iPicHeight * 3 / 2;
1313 uint8_t* ptr = buf_.data();
1314 uint8_t uiVal = rand() % 256;
1315 for (int i = 0; i < frameSize; i++) {
1316 ptr[i] = bAllRandom ? (rand() % 256) : uiVal;
1317 }
1318 int rv = encoder_->EncodeFrame (&EncPic, &info);
1319 if (0 == iCheckTypeIndex) {
1320 ASSERT_TRUE (rv == cmResultSuccess) << "rv=" << rv;
1321 } else if (1 == iCheckTypeIndex) {
1322 ASSERT_TRUE (rv == cmResultSuccess || rv == cmUnknownReason) << "rv=" << rv;
1323 }
1324 }
1325};
1326
1327INSTANTIATE_TEST_CASE_P (EncodeDecodeTestAPIBase, EncodeTestAPI,
1328 ::testing::ValuesIn (kOptionParamArray));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected