Skip to content

Commit

Permalink
Bug 1811322 - P1 - apply patches to vendor libyuv to b2528b0be934 ;r=…
Browse files Browse the repository at this point in the history
…webrtc-reviewers,mjf

Depends on D167858

Differential Revision: https://phabricator.services.mozilla.com/D167859
  • Loading branch information
na-g committed Jan 25, 2023
1 parent c1bc9bc commit cb45146
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
10 changes: 6 additions & 4 deletions media/libyuv/libyuv/include/libyuv/row.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ extern "C" {

// The following functions fail on gcc/clang 32 bit with fpic and framepointer.
// caveat: clangcl uses row_win.cc which works.
#if defined(__x86_64__) || !defined(__pic__) || defined(__clang__) || \
defined(_MSC_VER)
#if !defined(MOZ_PROFILING) && \
(defined(__x86_64__) || !defined(__pic__) || defined(__clang__) || \
defined(_MSC_VER))
// TODO(fbarchard): fix build error on android_full_debug=1
// https://code.google.com/p/libyuv/issues/detail?id=517
#define HAS_I422ALPHATOARGBROW_SSSE3
Expand Down Expand Up @@ -247,8 +248,9 @@ extern "C" {
#define HAS_ARGBATTENUATEROW_AVX2
#endif

#if defined(__x86_64__) || !defined(__pic__) || defined(__clang__) || \
defined(_MSC_VER)
#if !defined(MOZ_PROFILING) && \
(defined(__x86_64__) || !defined(__pic__) || defined(__clang__) || \
defined(_MSC_VER))
// TODO(fbarchard): fix build error on android_full_debug=1
// https://code.google.com/p/libyuv/issues/detail?id=517
#define HAS_I422ALPHATOARGBROW_AVX2
Expand Down
20 changes: 18 additions & 2 deletions media/libyuv/libyuv/libyuv.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
'optimize': 'max', # enable O2 and ltcg.
},
# Allows libyuv.a redistributable library without external dependencies.
'standalone_static_library': 1,
# 'standalone_static_library': 1,
'conditions': [
# Disable -Wunused-parameter
['clang == 1', {
Expand All @@ -70,6 +70,11 @@
'-mfpu=vfpv3-d16',
# '-mthumb', # arm32 not thumb
],
'cflags_mozilla!': [
'-mfpu=vfp',
'-mfpu=vfpv3',
'-mfpu=vfpv3-d16',
],
'conditions': [
# Disable LTO in libyuv_neon target due to gcc 4.9 compiler bug.
['clang == 0 and use_lto == 1', {
Expand All @@ -84,6 +89,9 @@
'-mfpu=neon',
# '-marm', # arm32 not thumb
],
'cflags_mozilla': [
'-mfpu=neon',
],
}],
],
}],
Expand All @@ -92,7 +100,15 @@
'LIBYUV_MSA',
],
}],
['OS != "ios" and libyuv_disable_jpeg != 1', {
['build_with_mozilla == 1', {
'defines': [
'HAVE_JPEG'
],
'cflags_mozilla': [
'$(MOZ_JPEG_CFLAGS)',
],
}],
['OS != "ios" and libyuv_disable_jpeg != 1 and build_with_mozilla != 1', {
'defines': [
'HAVE_JPEG'
],
Expand Down
5 changes: 4 additions & 1 deletion media/libyuv/libyuv/source/mjpeg_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ MJpegDecoder::MJpegDecoder()
decompress_struct_->err = jpeg_std_error(&error_mgr_->base);
// Override standard exit()-based error handler.
error_mgr_->base.error_exit = &ErrorHandler;
#ifndef DEBUG_MJPEG
error_mgr_->base.output_message = &OutputHandler;
#endif
#endif
decompress_struct_->client_data = NULL;
source_mgr_->init_source = &init_source;
Expand Down Expand Up @@ -463,11 +465,12 @@ void ErrorHandler(j_common_ptr cinfo) {
longjmp(mgr->setjmp_buffer, 1);
}

#ifndef DEBUG_MJPEG
// Suppress fprintf warnings.
void OutputHandler(j_common_ptr cinfo) {
(void)cinfo;
}

#endif
#endif // HAVE_SETJMP

void MJpegDecoder::AllocOutputBuffers(int num_outbufs) {
Expand Down

0 comments on commit cb45146

Please sign in to comment.