diff options
-rw-r--r-- | media/libstagefright/codecs/hevcdec/SoftHEVC.cpp | 12 | ||||
-rw-r--r-- | media/libstagefright/codecs/hevcdec/SoftHEVC.h | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/media/libstagefright/codecs/hevcdec/SoftHEVC.cpp b/media/libstagefright/codecs/hevcdec/SoftHEVC.cpp index 5c05a0e..1db350f 100644 --- a/media/libstagefright/codecs/hevcdec/SoftHEVC.cpp +++ b/media/libstagefright/codecs/hevcdec/SoftHEVC.cpp @@ -82,7 +82,10 @@ SoftHEVC::SoftHEVC( initPorts( kNumBuffers, max(kMaxOutputBufferSize / kMinCompressionRatio, (size_t)INPUT_BUF_SIZE), kNumBuffers, CODEC_MIME_TYPE, kMinCompressionRatio); - CHECK_EQ(initDecoder(), (status_t)OK); +} + +status_t SoftHEVC::init() { + return initDecoder(); } SoftHEVC::~SoftHEVC() { @@ -766,5 +769,10 @@ void SoftHEVC::onQueueFilled(OMX_U32 portIndex) { android::SoftOMXComponent *createSoftOMXComponent(const char *name, const OMX_CALLBACKTYPE *callbacks, OMX_PTR appData, OMX_COMPONENTTYPE **component) { - return new android::SoftHEVC(name, callbacks, appData, component); + android::SoftHEVC *codec = new android::SoftHEVC(name, callbacks, appData, component); + if (codec->init() != android::OK) { + android::sp<android::SoftOMXComponent> release = codec; + return NULL; + } + return codec; } diff --git a/media/libstagefright/codecs/hevcdec/SoftHEVC.h b/media/libstagefright/codecs/hevcdec/SoftHEVC.h index a91f528..c6344cf 100644 --- a/media/libstagefright/codecs/hevcdec/SoftHEVC.h +++ b/media/libstagefright/codecs/hevcdec/SoftHEVC.h @@ -56,6 +56,8 @@ struct SoftHEVC: public SoftVideoDecoderOMXComponent { SoftHEVC(const char *name, const OMX_CALLBACKTYPE *callbacks, OMX_PTR appData, OMX_COMPONENTTYPE **component); + status_t init(); + protected: virtual ~SoftHEVC(); |