Skip to content
Snippets Groups Projects
Commit 34a3713f authored by Philippe Gorley's avatar Philippe Gorley Committed by Adrien Béraud
Browse files

sinkclient: only transfer if hardware frame

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