|
3 | 3 | #include "utils.h" |
4 | 4 | #include "streaming/session.h" |
5 | 5 |
|
| 6 | +#ifdef HAVE_H264BITSTREAM |
6 | 7 | #include <h264_stream.h> |
| 8 | +#endif |
7 | 9 |
|
8 | 10 | extern "C" { |
9 | 11 | #include <libavutil/mastering_display_metadata.h> |
@@ -715,8 +717,13 @@ bool FFmpegVideoDecoder::completeInitialization(const AVCodec* decoder, enum AVP |
715 | 717 | if (testMode != TestMode::TestFrameOnly) { |
716 | 718 | if ((params->videoFormat & VIDEO_FORMAT_MASK_H264) && |
717 | 719 | !(m_BackendRenderer->getDecoderCapabilities() & CAPABILITY_REFERENCE_FRAME_INVALIDATION_AVC)) { |
| 720 | +#ifdef HAVE_H264BITSTREAM |
718 | 721 | SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, |
719 | 722 | "Using H.264 SPS fixup"); |
| 723 | +#else |
| 724 | + SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, |
| 725 | + "H.264 SPS fixup cannot be performed without h264bitstream. H.264 may have excessive decoding latency!"); |
| 726 | +#endif |
720 | 727 | m_NeedsSpsFixup = true; |
721 | 728 | } |
722 | 729 | else { |
@@ -1758,6 +1765,7 @@ bool FFmpegVideoDecoder::initialize(PDECODER_PARAMETERS params) |
1758 | 1765 |
|
1759 | 1766 | void FFmpegVideoDecoder::writeBuffer(PLENTRY entry, int& offset) |
1760 | 1767 | { |
| 1768 | +#ifdef HAVE_H264BITSTREAM |
1761 | 1769 | if (m_NeedsSpsFixup && entry->bufferType == BUFFER_TYPE_SPS) { |
1762 | 1770 | h264_stream_t* stream = h264_new(); |
1763 | 1771 | int nalStart, nalEnd; |
@@ -1803,7 +1811,9 @@ void FFmpegVideoDecoder::writeBuffer(PLENTRY entry, int& offset) |
1803 | 1811 |
|
1804 | 1812 | h264_free(stream); |
1805 | 1813 | } |
1806 | | - else { |
| 1814 | + else |
| 1815 | +#endif |
| 1816 | + { |
1807 | 1817 | // Write the buffer as-is |
1808 | 1818 | memcpy(&m_DecodeBuffer.data()[offset], |
1809 | 1819 | entry->data, |
|
0 commit comments