| 351 | } |
| 352 | |
| 353 | static av_cold int oh_encode_close(AVCodecContext *avctx) |
| 354 | { |
| 355 | OHCodecEncContext *s = avctx->priv_data; |
| 356 | |
| 357 | if (s->enc) { |
| 358 | if (s->native_window) { |
| 359 | OH_NativeWindow_DestroyNativeWindow(s->native_window); |
| 360 | s->native_window = NULL; |
| 361 | } |
| 362 | OH_VideoEncoder_Stop(s->enc); |
| 363 | OH_AVErrCode err = OH_VideoEncoder_Destroy(s->enc); |
| 364 | if (err == AV_ERR_OK) |
| 365 | av_log(avctx, AV_LOG_DEBUG, "Destroy encoder success\n"); |
| 366 | else |
| 367 | av_log(avctx, AV_LOG_ERROR, "Destroy decoder failed, %d, %s\n", |
| 368 | err, av_err2str(ff_oh_err_to_ff_err(err))); |
| 369 | s->enc = NULL; |
| 370 | } |
| 371 | |
| 372 | av_freep(&s->extradata); |
| 373 | av_frame_free(&s->frame); |
| 374 | |
| 375 | ff_mutex_destroy(&s->input_mutex); |
| 376 | ff_cond_destroy(&s->input_cond); |
| 377 | av_fifo_freep2(&s->input_queue); |
| 378 | |
| 379 | ff_mutex_destroy(&s->output_mutex); |
| 380 | ff_cond_destroy(&s->output_cond); |
| 381 | av_fifo_freep2(&s->output_queue); |
| 382 | |
| 383 | return 0; |
| 384 | } |
| 385 | |
| 386 | static int oh_encode_output_packet(AVCodecContext *avctx, AVPacket *pkt, |
| 387 | OHBufferQueueItem *output) |
nothing calls this directly
no test coverage detected