Skip to content
Snippets Groups Projects
Commit ad059dcc authored by Adrien Béraud's avatar Adrien Béraud
Browse files

build: fix build without RING_ACCEL

Change-Id: I37819532d7b3033e233a391f570da3df77afe8a0
parent e20b46a8
No related branches found
No related tags found
No related merge requests found
...@@ -432,7 +432,7 @@ MediaEncoder::encode(const std::shared_ptr<VideoFrame>& input, ...@@ -432,7 +432,7 @@ MediaEncoder::encode(const std::shared_ptr<VideoFrame>& input,
return -1; return -1;
} }
#else #else
output = getScaledSWFrame(input); output = getScaledSWFrame(*input.get());
#endif // RING_ACCEL #endif // RING_ACCEL
if (!output) { if (!output) {
...@@ -1267,7 +1267,7 @@ MediaEncoder::getHWFrame(const std::shared_ptr<VideoFrame>& input, ...@@ -1267,7 +1267,7 @@ MediaEncoder::getHWFrame(const std::shared_ptr<VideoFrame>& input,
} else { } else {
output = getScaledSWFrame(*input.get()); output = getScaledSWFrame(*input.get());
} }
#elif !defined(__APPLE__) #elif !defined(__APPLE__) && defined(RING_ACCEL)
// Other Platforms // Other Platforms
auto desc = av_pix_fmt_desc_get(static_cast<AVPixelFormat>(input->format())); auto desc = av_pix_fmt_desc_get(static_cast<AVPixelFormat>(input->format()));
bool isHardware = desc && (desc->flags & AV_PIX_FMT_FLAG_HWACCEL); bool isHardware = desc && (desc->flags & AV_PIX_FMT_FLAG_HWACCEL);
...@@ -1297,6 +1297,7 @@ MediaEncoder::getHWFrame(const std::shared_ptr<VideoFrame>& input, ...@@ -1297,6 +1297,7 @@ MediaEncoder::getHWFrame(const std::shared_ptr<VideoFrame>& input,
return 0; return 0;
} }
#ifdef RING_ACCEL
std::shared_ptr<VideoFrame> std::shared_ptr<VideoFrame>
MediaEncoder::getUnlinkedHWFrame(const VideoFrame& input) MediaEncoder::getUnlinkedHWFrame(const VideoFrame& input)
{ {
...@@ -1323,6 +1324,7 @@ MediaEncoder::getHWFrameFromSWFrame(const VideoFrame& input) ...@@ -1323,6 +1324,7 @@ MediaEncoder::getHWFrameFromSWFrame(const VideoFrame& input)
} }
return framePtr; return framePtr;
} }
#endif
std::shared_ptr<VideoFrame> std::shared_ptr<VideoFrame>
MediaEncoder::getScaledSWFrame(const VideoFrame& input) MediaEncoder::getScaledSWFrame(const VideoFrame& input)
......
...@@ -272,7 +272,7 @@ MediaRecorder::onFrame(const std::string& name, const std::shared_ptr<MediaFrame ...@@ -272,7 +272,7 @@ MediaRecorder::onFrame(const std::string& name, const std::shared_ptr<MediaFrame
// copy frame to not mess with the original frame's pts (does not actually copy frame data) // copy frame to not mess with the original frame's pts (does not actually copy frame data)
std::unique_ptr<MediaFrame> clone; std::unique_ptr<MediaFrame> clone;
const auto& ms = streams_[name]->info; const auto& ms = streams_[name]->info;
#ifdef ENABLE_VIDEO #if defined(ENABLE_VIDEO) && defined(RING_ACCEL)
if (ms.isVideo) { if (ms.isVideo) {
auto desc = av_pix_fmt_desc_get( auto desc = av_pix_fmt_desc_get(
(AVPixelFormat) (std::static_pointer_cast<VideoFrame>(frame))->format()); (AVPixelFormat) (std::static_pointer_cast<VideoFrame>(frame))->format());
...@@ -290,12 +290,12 @@ MediaRecorder::onFrame(const std::string& name, const std::shared_ptr<MediaFrame ...@@ -290,12 +290,12 @@ MediaRecorder::onFrame(const std::string& name, const std::shared_ptr<MediaFrame
clone->copyFrom(*frame); clone->copyFrom(*frame);
} }
} else { } else {
#endif // ENABLE_VIDEO #endif // ENABLE_VIDEO && RING_ACCEL
clone = std::make_unique<MediaFrame>(); clone = std::make_unique<MediaFrame>();
clone->copyFrom(*frame); clone->copyFrom(*frame);
#ifdef ENABLE_VIDEO #if defined(ENABLE_VIDEO) && defined(RING_ACCEL)
} }
#endif // ENABLE_VIDEO #endif // ENABLE_VIDEO && RING_ACCEL
clone->pointer()->pts = av_rescale_q_rnd(av_gettime() - startTimeStamp_, clone->pointer()->pts = av_rescale_q_rnd(av_gettime() - startTimeStamp_,
{1, AV_TIME_BASE}, {1, AV_TIME_BASE},
ms.timeBase, ms.timeBase,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment