History

add usagetype parameter in encoder unit test to test screen content

ruil2 committed 12 years ago

Commit a15e6401 parent 9b032235 files · +37 −17Browse files

Showing the changes to test/api/BaseEncoderTest.cpp (1 of 5 files). Show all

Unified · Split

test/api/BaseEncoderTest.cpp+8−6
@@ -5,12 +5,13 @@ · 4 unmodified lines
55 #include "utils/FileInputStream.h"
66 #include "BaseEncoderTest.h"
77
8−static int InitWithParam(ISVCEncoder* encoder, int width,
8+static int InitWithParam(ISVCEncoder* encoder, EUsageType usageType,int width,
99 int height, float frameRate, SliceModeEnum sliceMode, bool denoise, int layers) {
1010 if (SM_SINGLE_SLICE == sliceMode && !denoise && layers == 1) {
1111 SEncParamBase param;
1212 memset (&param, 0, sizeof(SEncParamBase));
13−
13+
14+ param.iUsageType = usageType;
1415 param.fMaxFrameRate = frameRate;
1516 param.iPicWidth = width;
1617 param.iPicHeight = height;
@@ -22,6 +23,7 @@ static int InitWithParam(ISVCEncoder* encoder, int width, · 5 unmodified lines
2223 SEncParamExt param;
2324 encoder->GetDefaultParams(&param);
2425
26+ param.iUsageType = usageType;
2527 param.fMaxFrameRate = frameRate;
2628 param.iPicWidth = width;
2729 param.iPicHeight = height;
@@ -61,9 +63,9 @@ void BaseEncoderTest::TearDown() { · 33 unmodified lines
6163 }
6264 }
6365
64−void BaseEncoderTest::EncodeStream(InputStream* in, int width, int height,
66+void BaseEncoderTest::EncodeStream(InputStream* in, EUsageType usageType, int width, int height,
6567 float frameRate, SliceModeEnum slices, bool denoise, int layers, Callback* cbk) {
66− int rv = InitWithParam(encoder_, width, height, frameRate, slices, denoise, layers);
68+ int rv = InitWithParam(encoder_, usageType, width, height, frameRate, slices, denoise, layers);
6769 ASSERT_TRUE(rv == cmResultSuccess);
6870
6971 // I420: 1(Y) + 1/4(U) + 1/4(V)
@@ -95,9 +97,9 @@ void BaseEncoderTest::EncodeStream(InputStream* in, int width, int height, · 25 unmodified lines
9597 }
9698 }
9799
98−void BaseEncoderTest::EncodeFile(const char* fileName, int width, int height,
100+void BaseEncoderTest::EncodeFile(const char* fileName, EUsageType usageType, int width, int height,
99101 float frameRate, SliceModeEnum slices, bool denoise, int layers, Callback* cbk) {
100102 FileInputStream fileStream;
101103 ASSERT_TRUE(fileStream.Open(fileName));
102− EncodeStream(&fileStream, width, height, frameRate, slices, denoise, layers, cbk);
104+ EncodeStream(&fileStream, usageType, width, height, frameRate, slices, denoise, layers, cbk);
103105 }

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