MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / oh_encode_close

Function oh_encode_close

libavcodec/ohenc.c:353–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351}
352
353static 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
386static int oh_encode_output_packet(AVCodecContext *avctx, AVPacket *pkt,
387 OHBufferQueueItem *output)

Callers

nothing calls this directly

Calls 7

av_logFunction · 0.85
ff_oh_err_to_ff_errFunction · 0.85
av_freepFunction · 0.85
av_frame_freeFunction · 0.85
ff_mutex_destroyFunction · 0.85
ff_cond_destroyFunction · 0.85
av_fifo_freep2Function · 0.85

Tested by

no test coverage detected