History

remove bParseonly in ctx using that in param, and slightly modify the initialize process of decoder

huili2 committed 11 years ago

Commit 777dbc01 parent b700b6711 files · +133 −86Browse files

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

Unified · Split

test/decoder/DecUT_DecExt.cpp+31−6
@@ -26,6 +26,8 @@ class DecoderInterfaceTest : public ::testing::Test { · 25 unmodified lines
2626 }
2727 //Init members
2828 void Init();
29+ //Init valid members
30+ void ValidInit();
2931 //Uninit members
3032 void Uninit();
3133 //Mock input data for test
@@ -97,6 +99,29 @@ void DecoderInterfaceTest::Init() { · 65 unmodified lines
9799 ASSERT_EQ (eRet, cmResultSuccess);
98100 }
99101
102+void DecoderInterfaceTest::ValidInit() {
103+ memset (&m_sBufferInfo, 0, sizeof (SBufferInfo));
104+ memset (&m_sDecParam, 0, sizeof (SDecodingParam));
105+ m_sDecParam.pFileNameRestructed = NULL;
106+ m_sDecParam.eOutputColorFormat = (EVideoFormatType) 23;
107+ m_sDecParam.uiCpuLoad = 1;
108+ m_sDecParam.uiTargetDqLayer = 1;
109+ m_sDecParam.eEcActiveIdc = (ERROR_CON_IDC) (rand() & 7);
110+ m_sDecParam.sVideoProperty.size = sizeof (SVideoProperty);
111+ m_sDecParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_DEFAULT;
112+
113+ m_pData[0] = m_pData[1] = m_pData[2] = NULL;
114+ m_szBuffer[0] = m_szBuffer[1] = m_szBuffer[2] = 0;
115+ m_szBuffer[3] = 1;
116+ m_iBufLength = 4;
117+ CM_RETURN eRet = (CM_RETURN) m_pDec->Initialize (&m_sDecParam);
118+ if ((m_sDecParam.eOutputColorFormat != videoFormatI420) &&
119+ (m_sDecParam.eOutputColorFormat != videoFormatInternal))
120+ ASSERT_EQ (eRet, cmUnsupportedData);
121+ else
122+ ASSERT_EQ (eRet, cmResultSuccess);
123+}
124+
100125 void DecoderInterfaceTest::Uninit() {
101126 if (m_pDec) {
102127 CM_RETURN eRet = (CM_RETURN) m_pDec->Uninitialize();
@@ -258,7 +283,7 @@ void DecoderInterfaceTest::TestEndOfStream() { · 155 unmodified lines
258283 int iTmp, iOut;
259284 CM_RETURN eRet;
260285
261− Init();
286+ ValidInit();
262287
263288 //invalid input
264289 eRet = (CM_RETURN) m_pDec->SetOption (DECODER_OPTION_END_OF_STREAM, NULL);
@@ -320,7 +345,7 @@ void DecoderInterfaceTest::TestVclNal() { · 55 unmodified lines
320345 int iTmp, iOut;
321346 CM_RETURN eRet;
322347
323− Init();
348+ ValidInit();
324349
325350 //Test SetOption
326351 //VclNal never supports SetOption
@@ -429,7 +454,7 @@ void DecoderInterfaceTest::TestGetDecStatistics() { · 102 unmodified lines
429454 SDecoderStatistics sDecStatic;
430455 int32_t iError = 0;
431456
432− Init();
457+ ValidInit();
433458 // setoption not support,
434459 eRet = (CM_RETURN)m_pDec->SetOption (DECODER_OPTION_GET_STATISTICS, NULL);
435460 EXPECT_EQ (eRet, cmInitParaError);
@@ -452,7 +477,7 @@ void DecoderInterfaceTest::TestGetDecStatistics() { · 16 unmodified lines
452477 Uninit();
453478
454479 //Decoder error bs when the first IDR lost
455− Init();
480+ ValidInit();
456481 iError = 2;
457482 m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError);
458483 DecoderBs ("res/BA_MW_D_IDR_LOST.264");
@@ -470,7 +495,7 @@ void DecoderInterfaceTest::TestGetDecStatistics() { · 11 unmodified lines
470495 Uninit();
471496
472497 //ecoder error bs when the first P lost
473− Init();
498+ ValidInit();
474499 iError = 2;
475500 m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError);
476501
@@ -491,7 +516,7 @@ void DecoderInterfaceTest::TestGetDecStatistics() { · 14 unmodified lines
491516 //EC enable
492517
493518 //EC Off UT just correc bitstream
494− Init();
519+ ValidInit();
495520 iError = 0;
496521 m_pDec->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iError);
497522 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