encoders/prores_aw: Update to match new std::shared_ptr<AVFrame> code
This commit is contained in:
@@ -273,9 +273,9 @@ bool obsffmpeg::encoder::prores_aw::encode(encoder_frame* frame, encoder_packet*
|
|||||||
int res = 0;
|
int res = 0;
|
||||||
|
|
||||||
{
|
{
|
||||||
ScopeProfiler sp_frame("frame");
|
ScopeProfiler sp_frame("frame");
|
||||||
AVFrame* vframe = frame_queue.pop();
|
std::shared_ptr<AVFrame> vframe = frame_queue.pop();
|
||||||
vframe->pts = frame->pts;
|
vframe->pts = frame->pts;
|
||||||
|
|
||||||
vframe->color_range = this->avcontext->color_range;
|
vframe->color_range = this->avcontext->color_range;
|
||||||
vframe->colorspace = this->avcontext->colorspace;
|
vframe->colorspace = this->avcontext->colorspace;
|
||||||
@@ -294,7 +294,7 @@ bool obsffmpeg::encoder::prores_aw::encode(encoder_frame* frame, encoder_packet*
|
|||||||
|
|
||||||
{
|
{
|
||||||
ScopeProfiler profile("send");
|
ScopeProfiler profile("send");
|
||||||
res = avcodec_send_frame(this->avcontext, vframe);
|
res = avcodec_send_frame(this->avcontext, vframe.get());
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
PLOG_ERROR(LOG_PREFIX "Failed to encode frame: %s (%ld).",
|
PLOG_ERROR(LOG_PREFIX "Failed to encode frame: %s (%ld).",
|
||||||
ffmpeg::tools::get_error_description(res), res);
|
ffmpeg::tools::get_error_description(res), res);
|
||||||
@@ -320,12 +320,10 @@ bool obsffmpeg::encoder::prores_aw::encode(encoder_frame* frame, encoder_packet*
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
AVFrame* uframe = frame_queue_used.pop_only();
|
std::shared_ptr<AVFrame> uframe = frame_queue_used.pop_only();
|
||||||
if (uframe) {
|
if (uframe) {
|
||||||
if (frame_queue.empty()) {
|
if (frame_queue.empty()) {
|
||||||
frame_queue.push(uframe);
|
frame_queue.push(uframe);
|
||||||
} else {
|
|
||||||
av_frame_free(&uframe);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
packet->type = OBS_ENCODER_VIDEO;
|
packet->type = OBS_ENCODER_VIDEO;
|
||||||
|
|||||||
@@ -15,8 +15,6 @@
|
|||||||
// along with this program; if not, write to the Free Software
|
// along with this program; if not, write to the Free Software
|
||||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
|
||||||
#ifndef OBS_FFMPEG_ENCODER_PRORES_AW
|
|
||||||
#define OBS_FFMPEG_ENCODER_PRORES_AW
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <encoder.hpp>
|
#include <encoder.hpp>
|
||||||
@@ -75,5 +73,3 @@ namespace obsffmpeg {
|
|||||||
};
|
};
|
||||||
} // namespace encoder
|
} // namespace encoder
|
||||||
} // namespace obsffmpeg
|
} // namespace obsffmpeg
|
||||||
|
|
||||||
#endif OBS_FFMPEG_ENCODER_PRORES_AW
|
|
||||||
|
|||||||
Reference in New Issue
Block a user