Skip to content
Snippets Groups Projects
Commit 2b2412e4 authored by Mohamed Amine Younes Bouacida's avatar Mohamed Amine Younes Bouacida Committed by Adrien Béraud
Browse files

video: copy the frame props

+ Save the frame props on Scale or Copy

Change-Id: I816de4400392da13d3068609bd432a6918bfc81d
parent 0bef03f1
No related branches found
No related tags found
No related merge requests found
......@@ -67,8 +67,11 @@ void
MediaFrame::copyFrom(const MediaFrame& o)
{
reset();
if (o.frame_)
if (o.frame_) {
av_frame_ref(frame_.get(), o.frame_.get());
av_frame_copy_props(frame_.get(), o.frame_.get());
}
if (o.packet_) {
packet_.reset(av_packet_alloc());
av_packet_ref(packet_.get(), o.packet_.get());
......
......@@ -150,6 +150,7 @@ VideoScaler::convertFormat(const VideoFrame& input, AVPixelFormat pix)
auto output = std::make_unique<VideoFrame>();
output->reserve(pix, input.width(), input.height());
scale(input, *output);
av_frame_copy_props(output->pointer(), input.pointer());
return output;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment