add decoder capability info

This commit is contained in:
huili2
2014-08-27 01:21:29 -07:00
parent 0951c8fc0c
commit 0b23d0facb
5 changed files with 54 additions and 1 deletions

View File

@@ -188,6 +188,7 @@ typedef void (*WelsTraceCallback) (void* ctx, int level, const char* string);
int WelsCreateSVCEncoder (ISVCEncoder** ppEncoder); int WelsCreateSVCEncoder (ISVCEncoder** ppEncoder);
void WelsDestroySVCEncoder (ISVCEncoder* pEncoder); void WelsDestroySVCEncoder (ISVCEncoder* pEncoder);
int WelsGetDecoderCapability (SDecoderCapability* pDecCapability);
long WelsCreateDecoder (ISVCDecoder** ppDecoder); long WelsCreateDecoder (ISVCDecoder** ppDecoder);
void WelsDestroyDecoder (ISVCDecoder* pDecoder); void WelsDestroyDecoder (ISVCDecoder* pDecoder);

View File

@@ -429,4 +429,17 @@ typedef struct TagDeliveryStatus {
int iDropFrameType; // the frame type that is dropped int iDropFrameType; // the frame type that is dropped
int iDropFrameSize; // the frame size that is dropped int iDropFrameSize; // the frame size that is dropped
} SDeliveryStatus; } 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__ #endif//WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__

View File

@@ -476,7 +476,24 @@ DECODING_STATE CWelsDecoder::DecodeFrameEx (const unsigned char* kpSrc,
using namespace WelsDec; 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!! */ /* WINAPI is indeed in prefix due to sync to application layer callings!! */
/* /*

View File

@@ -1,3 +1,4 @@
EXPORTS EXPORTS
WelsGetDecoderCapability
WelsCreateDecoder WelsCreateDecoder
WelsDestroyDecoder WelsDestroyDecoder

View File

@@ -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 { class DecoderInitTest : public ::testing::Test, public BaseDecoderTest {
public: public: