| 187 | } |
| 188 | |
| 189 | int ActiveDecoder::send_packet(unique_ptr<IAFPacket> &packet, uint64_t timeOut) |
| 190 | { |
| 191 | if (needDrop(packet.get())) { |
| 192 | packet = nullptr; |
| 193 | return 0; |
| 194 | } |
| 195 | |
| 196 | #if AF_HAVE_PTHREAD |
| 197 | return thread_send_packet(packet); |
| 198 | #else |
| 199 | int status = 0; |
| 200 | int ret = enqueue_decoder(packet.get()); |
| 201 | |
| 202 | if (ret == AVERROR(EAGAIN)) { |
| 203 | status = STATUS_RETRY_IN; |
| 204 | } else { |
| 205 | if (ret < 0) { |
| 206 | AF_LOGW("enqueue_decoder error %d\n", ret); |
| 207 | enqueueError(ret, packet->getInfo().pts); |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | return status; |
| 212 | #endif |
| 213 | } |
| 214 | |
| 215 | int ActiveDecoder::thread_send_packet(unique_ptr<IAFPacket> &packet) |
| 216 | { |