MCPcopy Create free account
hub / github.com/Vhonowslend/StreamFX-Public / create_frame

Method create_frame

components/ffmpeg/source/ffmpeg/avframe-queue.cpp:11–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9using namespace streamfx::ffmpeg;
10
11std::shared_ptr<AVFrame> avframe_queue::create_frame()
12{
13 std::shared_ptr<AVFrame> frame = std::shared_ptr<AVFrame>(av_frame_alloc(), [](AVFrame* frame) {
14 av_frame_unref(frame);
15 av_frame_free(&frame);
16 });
17 frame->width = this->_resolution.first;
18 frame->height = this->_resolution.second;
19 frame->format = this->_format;
20
21 int res = av_frame_get_buffer(frame.get(), 32);
22 if (res < 0) {
23 throw std::runtime_error(tools::get_error_description(res));
24 }
25
26 return frame;
27}
28
29avframe_queue::avframe_queue() = default;
30

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected