| 200 | } |
| 201 | |
| 202 | int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt) |
| 203 | { |
| 204 | FFBSFContext *const bsfi = ffbsfcontext(ctx); |
| 205 | int ret; |
| 206 | |
| 207 | if (!pkt || AVPACKET_IS_EMPTY(pkt)) { |
| 208 | if (pkt) |
| 209 | av_packet_unref(pkt); |
| 210 | bsfi->eof = 1; |
| 211 | return 0; |
| 212 | } |
| 213 | |
| 214 | if (bsfi->eof) { |
| 215 | av_log(ctx, AV_LOG_ERROR, "A non-NULL packet sent after an EOF.\n"); |
| 216 | return AVERROR(EINVAL); |
| 217 | } |
| 218 | |
| 219 | if (!AVPACKET_IS_EMPTY(bsfi->buffer_pkt)) |
| 220 | return AVERROR(EAGAIN); |
| 221 | |
| 222 | ret = av_packet_make_refcounted(pkt); |
| 223 | if (ret < 0) |
| 224 | return ret; |
| 225 | av_packet_move_ref(bsfi->buffer_pkt, pkt); |
| 226 | |
| 227 | return 0; |
| 228 | } |
| 229 | |
| 230 | int av_bsf_receive_packet(AVBSFContext *ctx, AVPacket *pkt) |
| 231 | { |
no test coverage detected