| 26 | } |
| 27 | |
| 28 | int ActiveDecoder::open(const Stream_meta *meta, void *voutObsr, uint64_t flags , const Cicada::DrmInfo *drmInfo) |
| 29 | { |
| 30 | int ret = init_decoder(meta, voutObsr, flags , drmInfo); |
| 31 | |
| 32 | if (ret < 0) { |
| 33 | close(); |
| 34 | return ret; |
| 35 | } |
| 36 | |
| 37 | mRunning = true; |
| 38 | mCodecId = meta->codec; |
| 39 | #if AF_HAVE_PTHREAD |
| 40 | auto func = [this]() -> int { return this->decode_func(); }; |
| 41 | mDecodeThread = new afThread(func, LOG_TAG); |
| 42 | mDecodeThread->start(); |
| 43 | #endif |
| 44 | return 0; |
| 45 | } |
| 46 | |
| 47 | void ActiveDecoder::close() |
| 48 | { |