add decoder capability info
This commit is contained in:
@@ -188,6 +188,7 @@ typedef void (*WelsTraceCallback) (void* ctx, int level, const char* string);
|
||||
int WelsCreateSVCEncoder (ISVCEncoder** ppEncoder);
|
||||
void WelsDestroySVCEncoder (ISVCEncoder* pEncoder);
|
||||
|
||||
int WelsGetDecoderCapability (SDecoderCapability* pDecCapability);
|
||||
long WelsCreateDecoder (ISVCDecoder** ppDecoder);
|
||||
void WelsDestroyDecoder (ISVCDecoder* pDecoder);
|
||||
|
||||
|
||||
@@ -429,4 +429,17 @@ typedef struct TagDeliveryStatus {
|
||||
int iDropFrameType; // the frame type that is dropped
|
||||
int iDropFrameSize; // the frame size that is dropped
|
||||
} SDeliveryStatus;
|
||||
|
||||
typedef struct TagDecoderCapability {
|
||||
int iProfileIdc;
|
||||
int iProfileIop;
|
||||
int iLevelIdc;
|
||||
int iMaxMbps;
|
||||
int iMaxFs;
|
||||
int iMaxCpb;
|
||||
int iMaxDpb;
|
||||
int iMaxBr;
|
||||
bool bRedPicCap;
|
||||
} SDecoderCapability;
|
||||
|
||||
#endif//WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__
|
||||
|
||||
@@ -476,7 +476,24 @@ DECODING_STATE CWelsDecoder::DecodeFrameEx (const unsigned char* kpSrc,
|
||||
|
||||
|
||||
using namespace WelsDec;
|
||||
/*
|
||||
* WelsGetDecoderCapability
|
||||
* @return: DecCapability information
|
||||
*/
|
||||
int WelsGetDecoderCapability(SDecoderCapability* pDecCapability) {
|
||||
memset (pDecCapability, 0, sizeof (SDecoderCapability));
|
||||
pDecCapability->iProfileIdc = 66; //Baseline
|
||||
pDecCapability->iProfileIop = 0xE0; //11100000b
|
||||
pDecCapability->iLevelIdc = 32; //level_idc = 3.2
|
||||
pDecCapability->iMaxMbps = 216000; //from level_idc = 3.2
|
||||
pDecCapability->iMaxFs = 5120; //from level_idc = 3.2
|
||||
pDecCapability->iMaxCpb = 20000; //from level_idc = 3.2
|
||||
pDecCapability->iMaxDpb = 20480; //from level_idc = 3.2
|
||||
pDecCapability->iMaxBr = 20000; //from level_idc = 3.2
|
||||
pDecCapability->bRedPicCap = 0; //not support redundant pic
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
/* WINAPI is indeed in prefix due to sync to application layer callings!! */
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
EXPORTS
|
||||
WelsGetDecoderCapability
|
||||
WelsCreateDecoder
|
||||
WelsDestroyDecoder
|
||||
@@ -11,6 +11,27 @@ static void UpdateHashFromPlane (SHA1Context* ctx, const uint8_t* plane,
|
||||
}
|
||||
}
|
||||
|
||||
class DecoderCapabilityTest : public ::testing::Test {
|
||||
public:
|
||||
virtual void SetUp() {}
|
||||
virtual void TearDown() {}
|
||||
};
|
||||
|
||||
TEST_F (DecoderCapabilityTest, JustInit) {
|
||||
SDecoderCapability sDecCap;
|
||||
int iRet = WelsGetDecoderCapability (&sDecCap);
|
||||
ASSERT_TRUE (iRet == 0);
|
||||
EXPECT_EQ (sDecCap.iProfileIdc, 66);
|
||||
EXPECT_EQ (sDecCap.iProfileIop, 0xE0);
|
||||
EXPECT_EQ (sDecCap.iLevelIdc, 32);
|
||||
EXPECT_EQ (sDecCap.iMaxMbps, 216000);
|
||||
EXPECT_EQ (sDecCap.iMaxFs, 5120);
|
||||
EXPECT_EQ (sDecCap.iMaxCpb, 20000);
|
||||
EXPECT_EQ (sDecCap.iMaxDpb, 20480);
|
||||
EXPECT_EQ (sDecCap.iMaxBr, 20000);
|
||||
EXPECT_EQ (sDecCap.bRedPicCap, 0);
|
||||
}
|
||||
|
||||
|
||||
class DecoderInitTest : public ::testing::Test, public BaseDecoderTest {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user