summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonghua Wu <ronghuawu@google.com>2015-07-14 14:27:50 -0700
committerRonghua Wu <ronghuawu@google.com>2015-07-14 16:19:20 -0700
commit1640bd2d959432ce2b06a99e2a14e8c5c74efce2 (patch)
treef8d85a3f6da774d45d5b0df47cad74c93aec46c9
parent51d12c26628ab37b0fd58e08b6905652f8763225 (diff)
downloadframeworks_av-1640bd2d959432ce2b06a99e2a14e8c5c74efce2.zip
frameworks_av-1640bd2d959432ce2b06a99e2a14e8c5c74efce2.tar.gz
frameworks_av-1640bd2d959432ce2b06a99e2a14e8c5c74efce2.tar.bz2
libstagefright: remove CHECK from SoftHEVC ctor.
Bug: 22478679 Change-Id: I81933856d1217a23b256cac83a6ee3924b409d31
-rw-r--r--media/libstagefright/codecs/hevcdec/SoftHEVC.cpp12
-rw-r--r--media/libstagefright/codecs/hevcdec/SoftHEVC.h2
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();