History

remove parseonly in decoder ctx

huili2 committed 10 years ago

Commit 926fc671 parent 60aaf4811 files · +128 −86Browse files

Showing the changes to test/decoder/DecUT_DecExt.cpp (1 of 11 files). Show all

Unified · Split

test/decoder/DecUT_DecExt.cpp+26−6
@@ -26,6 +26,8 @@ class DecoderInterfaceTest : public ::testing::Test { · 25 unmodified lines
26 }26 }
27 //Init members27 //Init members
28 void Init();28 void Init();
29 //Init valid members
30 void ValidInit();
29 //Uninit members31 //Uninit members
30 void Uninit();32 void Uninit();
31 //Mock input data for test33 //Mock input data for test
@@ -94,6 +96,24 @@ void DecoderInterfaceTest::Init() { · 62 unmodified lines
94 ASSERT_EQ (eRet, cmResultSuccess);96 ASSERT_EQ (eRet, cmResultSuccess);
95}97}
96 98
99void DecoderInterfaceTest::ValidInit() {
100 memset (&m_sBufferInfo, 0, sizeof (SBufferInfo));
101 memset (&m_sDecParam, 0, sizeof (SDecodingParam));
102 m_sDecParam.pFileNameRestructed = NULL;
103 m_sDecParam.uiCpuLoad = 1;
104 m_sDecParam.uiTargetDqLayer = 1;
105 m_sDecParam.eEcActiveIdc = (ERROR_CON_IDC) (rand() & 7);
106 m_sDecParam.sVideoProperty.size = sizeof (SVideoProperty);
107 m_sDecParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_DEFAULT;
108
109 m_pData[0] = m_pData[1] = m_pData[2] = NULL;
110 m_szBuffer[0] = m_szBuffer[1] = m_szBuffer[2] = 0;
111 m_szBuffer[3] = 1;
112 m_iBufLength = 4;
113 CM_RETURN eRet = (CM_RETURN) m_pDec->Initialize (&m_sDecParam);
114 ASSERT_EQ (eRet, cmResultSuccess);
115}
116
97void DecoderInterfaceTest::Uninit() {117void DecoderInterfaceTest::Uninit() {
98 if (m_pDec) {118 if (m_pDec) {
99 CM_RETURN eRet = (CM_RETURN) m_pDec->Uninitialize();119 CM_RETURN eRet = (CM_RETURN) m_pDec->Uninitialize();
@@ -310,7 +330,7 @@ void DecoderInterfaceTest::TestEndOfStream() { · 210 unmodified lines
310 int iTmp, iOut;330 int iTmp, iOut;
311 CM_RETURN eRet;331 CM_RETURN eRet;
312 332
313 Init();333 ValidInit();
314 334
315 //invalid input335 //invalid input
316 eRet = (CM_RETURN) m_pDec->SetOption (DECODER_OPTION_END_OF_STREAM, NULL);336 eRet = (CM_RETURN) m_pDec->SetOption (DECODER_OPTION_END_OF_STREAM, NULL);
@@ -372,7 +392,7 @@ void DecoderInterfaceTest::TestVclNal() { · 55 unmodified lines
372 int iTmp, iOut;392 int iTmp, iOut;
373 CM_RETURN eRet;393 CM_RETURN eRet;
374 394
375 Init();395 ValidInit();
376 396
377 //Test SetOption397 //Test SetOption
378 //VclNal never supports SetOption398 //VclNal never supports SetOption
@@ -481,7 +501,7 @@ void DecoderInterfaceTest::TestGetDecStatistics() { · 102 unmodified lines
481 SDecoderStatistics sDecStatic;501 SDecoderStatistics sDecStatic;
482 int32_t iError = 0;502 int32_t iError = 0;
483 503
484 Init();504 ValidInit();
485 // setoption not support,505 // setoption not support,
486 eRet = (CM_RETURN)m_pDec->SetOption (DECODER_OPTION_GET_STATISTICS, NULL);506 eRet = (CM_RETURN)m_pDec->SetOption (DECODER_OPTION_GET_STATISTICS, NULL);
487 EXPECT_EQ (eRet, cmInitParaError);507 EXPECT_EQ (eRet, cmInitParaError);
@@ -504,7 +524,7 @@ void DecoderInterfaceTest::TestGetDecStatistics() { · 16 unmodified lines
504 Uninit();524 Uninit();
505 525
506 //Decoder error bs when the first IDR lost526 //Decoder error bs when the first IDR lost
507 Init();527 ValidInit();
508 iError = 2;528 iError = 2;
509 m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError);529 m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError);
510 DecoderBs ("res/BA_MW_D_IDR_LOST.264");530 DecoderBs ("res/BA_MW_D_IDR_LOST.264");
@@ -522,7 +542,7 @@ void DecoderInterfaceTest::TestGetDecStatistics() { · 11 unmodified lines
522 Uninit();542 Uninit();
523 543
524 //ecoder error bs when the first P lost544 //ecoder error bs when the first P lost
525 Init();545 ValidInit();
526 iError = 2;546 iError = 2;
527 m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError);547 m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError);
528 548
@@ -543,7 +563,7 @@ void DecoderInterfaceTest::TestGetDecStatistics() { · 14 unmodified lines
543 //EC enable563 //EC enable
544 564
545 //EC Off UT just correc bitstream565 //EC Off UT just correc bitstream
546 Init();566 ValidInit();
547 iError = 0;567 iError = 0;
548 m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError);568 m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError);
549 DecoderBs ("res/test_vd_1d.264");569 DecoderBs ("res/test_vd_1d.264");

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t