MCPcopy Create free account
hub / github.com/ClassicOldSong/Apollo / ~avcodec_encode_session_t

Method ~avcodec_encode_session_t

src/video.cpp:327–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325 avcodec_encode_session_t(avcodec_encode_session_t &&other) noexcept = default;
326
327 ~avcodec_encode_session_t() {
328 // Flush any remaining frames in the encoder
329 if (avcodec_send_frame(avcodec_ctx.get(), nullptr) == 0) {
330 packet_raw_avcodec pkt;
331 while (avcodec_receive_packet(avcodec_ctx.get(), pkt.av_packet) == 0);
332 }
333
334 // Order matters here because the context relies on the hwdevice still being valid
335 avcodec_ctx.reset();
336 device.reset();
337 }
338
339 // Ensure objects are destroyed in the correct order
340 avcodec_encode_session_t &operator=(avcodec_encode_session_t &&other) {

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected