Commit 34a3713f authored by Philippe Gorley's avatar Philippe Gorley Committed by Adrien Béraud

sinkclient: only transfer if hardware frame

Change-Id: I5a7764f810d39ea3f691a821a9669d549700517c
parent 21f81fc6
......@@ -355,11 +355,14 @@ SinkClient::update(Observable<std::shared_ptr<MediaFrame>>* /*obs*/,
#endif
if (doTransfer) {
std::shared_ptr<VideoFrame> frame;
#ifdef RING_ACCEL
std::shared_ptr<VideoFrame> frame {HardwareAccel::transferToMainMemory(*std::static_pointer_cast<VideoFrame>(frame_p), AV_PIX_FMT_NV12)};
#else
std::shared_ptr<VideoFrame> frame {std::static_pointer_cast<VideoFrame>(frame_p)};
auto desc = av_pix_fmt_desc_get((AVPixelFormat)(std::static_pointer_cast<VideoFrame>(frame_p))->format());
if (desc && (desc->flags & AV_PIX_FMT_FLAG_HWACCEL))
frame = HardwareAccel::transferToMainMemory(*std::static_pointer_cast<VideoFrame>(frame_p), AV_PIX_FMT_NV12);
else
#endif
frame = std::static_pointer_cast<VideoFrame>(frame_p);
AVFrameSideData* side_data = av_frame_get_side_data(frame->pointer(), AV_FRAME_DATA_DISPLAYMATRIX);
int angle = 0;
if (side_data) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment