Commit bf621169 authored by Cosmin Sabou's avatar Cosmin Sabou
Browse files

Backed out changeset df0ce31b1c48 (bug 1770691) for linux toolchain bustage on...

Backed out changeset df0ce31b1c48 (bug 1770691) for linux toolchain bustage on FFmpegVideoDecoder.cpp.
parent 9b3b0680
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -186,7 +186,6 @@ FFmpegLibWrapper::LinkResult FFmpegLibWrapper::Link() {
  AV_FUNC_OPTION(av_frame_get_color_range,
                 AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 |
                     AV_FUNC_AVUTIL_58)
  AV_FUNC(av_strerror, AV_FUNC_AVUTIL_ALL)

#ifdef MOZ_WAYLAND
  AV_FUNC_OPTION_SILENT(avcodec_get_hw_config, AV_FUNC_58 | AV_FUNC_59)
+0 −1
Original line number Diff line number Diff line
@@ -89,7 +89,6 @@ struct MOZ_ONLY_USED_TO_AVOID_STATIC_CONSTRUCTORS FFmpegLibWrapper {
  AVCodec* (*av_codec_iterate)(void** opaque);
  int (*av_codec_is_decoder)(const AVCodec* codec);
  void (*avcodec_align_dimensions)(AVCodecContext* s, int* width, int* height);
  int (*av_strerror)(int errnum, char* errbuf, size_t errbuf_size);

  // only used in libavcodec <= 54
  AVFrame* (*avcodec_alloc_frame)();
+7 −21
Original line number Diff line number Diff line
@@ -75,18 +75,6 @@ typedef mozilla::layers::PlanarYCbCrImage PlanarYCbCrImage;

namespace mozilla {

#if LIBAVCODEC_VERSION_MAJOR >= 58
static inline char* make_error_string(FFmpegLibWrapper* lib, char* errbuf,
                                      size_t errbuf_size, int errnum) {
  lib->av_strerror(errnum, errbuf, errbuf_size);
  return errbuf;
}
#  undef av_err2str
#  define av_err2str(errnum)                                     \
    make_error_string(mLib, (char[AV_ERROR_MAX_STRING_SIZE]){0}, \
                      AV_ERROR_MAX_STRING_SIZE, errnum)
#endif

#ifdef MOZ_WAYLAND_USE_VAAPI
nsTArray<AVCodecID> FFmpegVideoDecoder<LIBAV_VER>::mAcceleratedFormats;
#endif
@@ -849,10 +837,9 @@ MediaResult FFmpegVideoDecoder<LIBAV_VER>::DoDecode(
    // In theory, avcodec_send_packet could sent -EAGAIN should its internal
    // buffers be full. In practice this can't happen as we only feed one frame
    // at a time, and we immediately call avcodec_receive_frame right after.
    FFMPEG_LOG("avcodec_send_packet error: %s", av_err2str(res));
    return MediaResult(
        NS_ERROR_DOM_MEDIA_DECODE_ERR,
        RESULT_DETAIL("avcodec_send_packet error: %s", av_err2str(res)));
    FFMPEG_LOG("avcodec_send_packet error: %d", res);
    return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR,
                       RESULT_DETAIL("avcodec_send_packet error: %d", res));
  }
  if (aGotFrame) {
    *aGotFrame = false;
@@ -885,10 +872,9 @@ MediaResult FFmpegVideoDecoder<LIBAV_VER>::DoDecode(
      return NS_OK;
    }
    if (res < 0) {
      FFMPEG_LOG("  avcodec_receive_frame error: %s", av_err2str(res));
      return MediaResult(
          NS_ERROR_DOM_MEDIA_DECODE_ERR,
          RESULT_DETAIL("avcodec_receive_frame error: %s", av_err2str(res)));
      FFMPEG_LOG("  avcodec_receive_frame error: %d", res);
      return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR,
                         RESULT_DETAIL("avcodec_receive_frame error: %d", res));
    }

    UpdateDecodeTimes(decodeStart);