Showing the changes to test/api/BaseEncoderTest.cpp (1 of 5 files). Show all
Unified · Split
| @@ -5,12 +5,13 @@ · 4 unmodified lines | ||
| 5 | 5 | #include "utils/FileInputStream.h" |
| 6 | 6 | #include "BaseEncoderTest.h" |
| 7 | 7 | |
| 8 | −static int InitWithParam(ISVCEncoder* encoder, int width, | |
| 8 | +static int InitWithParam(ISVCEncoder* encoder, EUsageType usageType,int width, | |
| 9 | 9 | int height, float frameRate, SliceModeEnum sliceMode, bool denoise, int layers) { |
| 10 | 10 | if (SM_SINGLE_SLICE == sliceMode && !denoise && layers == 1) { |
| 11 | 11 | SEncParamBase param; |
| 12 | 12 | memset (¶m, 0, sizeof(SEncParamBase)); |
| 13 | − | |
| 13 | + | |
| 14 | + param.iUsageType = usageType; | |
| 14 | 15 | param.fMaxFrameRate = frameRate; |
| 15 | 16 | param.iPicWidth = width; |
| 16 | 17 | param.iPicHeight = height; |
| @@ -22,6 +23,7 @@ static int InitWithParam(ISVCEncoder* encoder, int width, · 5 unmodified lines | ||
| 22 | 23 | SEncParamExt param; |
| 23 | 24 | encoder->GetDefaultParams(¶m); |
| 24 | 25 | |
| 26 | + param.iUsageType = usageType; | |
| 25 | 27 | param.fMaxFrameRate = frameRate; |
| 26 | 28 | param.iPicWidth = width; |
| 27 | 29 | param.iPicHeight = height; |
| @@ -61,9 +63,9 @@ void BaseEncoderTest::TearDown() { · 33 unmodified lines | ||
| 61 | 63 | } |
| 62 | 64 | } |
| 63 | 65 | |
| 64 | −void BaseEncoderTest::EncodeStream(InputStream* in, int width, int height, | |
| 66 | +void BaseEncoderTest::EncodeStream(InputStream* in, EUsageType usageType, int width, int height, | |
| 65 | 67 | 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); | |
| 67 | 69 | ASSERT_TRUE(rv == cmResultSuccess); |
| 68 | 70 | |
| 69 | 71 | // 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 | ||
| 95 | 97 | } |
| 96 | 98 | } |
| 97 | 99 | |
| 98 | −void BaseEncoderTest::EncodeFile(const char* fileName, int width, int height, | |
| 100 | +void BaseEncoderTest::EncodeFile(const char* fileName, EUsageType usageType, int width, int height, | |
| 99 | 101 | float frameRate, SliceModeEnum slices, bool denoise, int layers, Callback* cbk) { |
| 100 | 102 | FileInputStream fileStream; |
| 101 | 103 | 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); | |
| 103 | 105 | } |