| 182 | } |
| 183 | |
| 184 | int set_frame(AVFrame *frame, AVBufferRef *hw_frames_ctx) override { |
| 185 | this->frame = frame; |
| 186 | |
| 187 | // If it's a hwframe, allocate buffers for hardware |
| 188 | if (hw_frames_ctx) { |
| 189 | hw_frame.reset(frame); |
| 190 | |
| 191 | if (av_hwframe_get_buffer(hw_frames_ctx, frame, 0)) { |
| 192 | return -1; |
| 193 | } |
| 194 | } else { |
| 195 | sw_frame.reset(frame); |
| 196 | } |
| 197 | |
| 198 | return 0; |
| 199 | } |
| 200 | |
| 201 | void apply_colorspace() override { |
| 202 | auto avcodec_colorspace = avcodec_colorspace_from_sunshine_colorspace(colorspace); |
no test coverage detected