Skip to content

Commit

Permalink
Merge pull request #1399 from meganz/release/v3.5.0
Browse files Browse the repository at this point in the history
Release/v3.5.0
sergiohs84 authored Apr 15, 2019
2 parents 19222dd + 373cd0c commit a69204a
Showing 38 changed files with 5,766 additions and 118 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@
/tests/sdk_test
/tests/misc_test
/tests/purge_account
/tests/sync_test
examples/megacli
examples/megasimplesync
examples/linux/megafuse
@@ -68,6 +69,7 @@ py-compile
# Documentation generator
doc/_build
doc/api
doc/lib
doc/sphinx_api
doc/Doxyfile
doc/example/lsmega
@@ -89,3 +91,5 @@ megaclient_statecache*
/third_party/Makefile

/contrib/QtCreator/build-*
/contrib/cmake/.idea
/contrib/cmake/cmake-build-*
5 changes: 2 additions & 3 deletions bindings/ios/MEGASDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -701,7 +701,7 @@
9472043B19ED916F00F6805F /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = MEGA;
TargetAttributes = {
9472044219ED916F00F6805F = {
@@ -711,10 +711,9 @@
};
buildConfigurationList = 9472043E19ED916F00F6805F /* Build configuration list for PBXProject "MEGASDK" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 9472043A19ED916F00F6805F;
productRefGroup = 9472044419ED916F00F6805F /* Products */;
20 changes: 18 additions & 2 deletions bindings/java/nz/mega/sdk/AndroidGfxProcessor.java
Original file line number Diff line number Diff line change
@@ -22,6 +22,8 @@
import android.provider.BaseColumns;
import android.provider.MediaStore;

import mega.privacy.android.app.utils.Util;

public class AndroidGfxProcessor extends MegaGfxProcessor {
Rect size;
int orientation;
@@ -60,10 +62,20 @@ public static Rect getImageDimensions(String path, int orientation) {

MediaMetadataRetriever retriever = new MediaMetadataRetriever();
retriever.setDataSource(path);
int width = Integer.valueOf(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH));
int height = Integer.valueOf(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT));
int width;
int height;
int interchangeOrientation = Integer.valueOf(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION));
if (interchangeOrientation == 90 || interchangeOrientation == 270) {
width = Integer.valueOf(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT));
height = Integer.valueOf(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH));
}
else {
width = Integer.valueOf(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH));
height = Integer.valueOf(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT));
}
retriever.release();

log("getImageDimensions width: "+width+" height: "+height+" orientation: "+interchangeOrientation);
rect.right = width;
rect.bottom = height;
} catch (Exception e) {
@@ -347,4 +359,8 @@ public void freeBitmap() {
srcPath = null;
orientation = 0;
}

public static void log(String log) {
Util.log("AndroidGfxProcessor", log);
}
}
20 changes: 20 additions & 0 deletions bindings/qt/sdk.pri
Original file line number Diff line number Diff line change
@@ -187,6 +187,25 @@ CONFIG(USE_LIBRAW) {
}
}

CONFIG(USE_PDFIUM) {
unix:!macx {
exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/lib/libpdfium.a) {
DEFINES += HAVE_PDFIUM
INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/pdfium
LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/lib/libpdfium.a
}
else:exists(/usr/include/fpdfview.h) {
DEFINES += HAVE_PDFIUM
LIBS += -lpdfium
}
}
else {#win/mac
DEFINES += HAVE_PDFIUM
INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/pdfium
LIBS += -lpdfium
}
}

CONFIG(USE_FFMPEG) {

unix:!macx {
@@ -546,6 +565,7 @@ macx {
INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/cares
INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/mediainfo
INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/zenlib
INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/pdfium

CONFIG(USE_PCRE) {
INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/pcre
15 changes: 15 additions & 0 deletions contrib/build_ffmpeg/packaging/ffmpeg.dsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Format: 1.0
Source: ffmpeg-mega
Binary: ffmpeg-mega
Standards-Version: 3.6.1
Architecture: any
Version: 1.0
DEBTRANSFORM-RELEASE: 1
Maintainer: MEGA Linux Team <linux@mega.co.nz>
Homepage: https://mega.nz/#sync
Build-Depends: pkg-config, debhelper, zlib1g-dev, wget, cmake, dh-autoreconf, cdbs, unzip, wget, libtool-bin (>= 2.4.2-1.10) | libtool (<< 2.4.2-1.10)
Package-List:
ffmpeg-mega
Files:
00000000000000000000000000000000 0 ffmpeg.tar.gz

9 changes: 9 additions & 0 deletions contrib/build_pdfium/args_linux.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use_sysroot = false
use_custom_libcxx = false
pdf_is_complete_lib = true
pdf_is_standalone = true
pdf_enable_v8 = false
pdf_enable_xfa = false
pdf_bundle_freetype = true
symbol_level = 0
is_debug=false
63 changes: 63 additions & 0 deletions contrib/build_pdfium/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/env bash
PDFium_BRANCH=chromium/3710

set -ex

BASEDIR="$PWD"
if [[ $# -ne 0 ]] ; then
if [ -d "$1" ]; then
BASEDIR="$1"
else
echo "must provide a valid folder"
exit 1
fi
fi

echo "using BASEDIR=$BASEDIR"

CURDIR="$PWD"
PDFIUMDIR="$BASEDIR/pdfium"
DepotTools_URL='https://chromium.googlesource.com/chromium/tools/depot_tools.git'
DepotTools_DIR="$PDFIUMDIR/depot_tools"
PDFium_URL='https://pdfium.googlesource.com/pdfium.git'
PDFium_BUILD_DIR="$PDFIUMDIR/out"
PDFium_ARGS="$PWD/args_linux.gn"
outputDIR="$BASEDIR/pdfium-mega-1.0"

# Prepare directories
mkdir -p "$PDFium_BUILD_DIR"

# Download depot_tools if not exists in this location or update utherwise
if [ ! -d "$DepotTools_DIR" ]; then
git clone "$DepotTools_URL" "$DepotTools_DIR"
else
cd "$DepotTools_DIR"
git pull
cd ..
fi
export PATH="$DepotTools_DIR:$PATH"

# Clone
cd "$BASEDIR"
gclient config --unmanaged "$PDFium_URL"
gclient sync

# Checkout
cd "$PDFIUMDIR"
git checkout "${PDFium_BRANCH:-master}"
gclient sync

# Configure
cp "$PDFium_ARGS" "$PDFium_BUILD_DIR/args.gn"

# Generate Ninja files
cd "$PDFIUMDIR"
gn gen "$PDFium_BUILD_DIR"

cd "$PDFIUMDIR"
echo "saving min pdfium stuff required for compilation"
rsync -a --files-from="$CURDIR/filespdfium.txt" "$PDFIUMDIR" "$outputDIR"


cd "$BASEDIR"
tar -zcvf pdfium.tar.gz "pdfium-mega-1.0"
85 changes: 85 additions & 0 deletions contrib/build_pdfium/buildpdfium.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
: Variables to provide:
set CONFIGURATION=Release
set PDFium_BRANCH=chromium/3710
set PLATFORM=x86
set GITPATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd
set WINSDKVER=10.0.17763.0

: Input
set WindowsSDK_DIR=C:\Program Files (x86)\Windows Kits\10\bin\%WINSDKVER%\%PLATFORM%
set DepotTools_URL=https://storage.googleapis.com/chrome-infra/depot_tools.zip
set DepotTools_DIR=%CD%/depot_tools
set PDFium_URL=https://pdfium.googlesource.com/pdfium.git
set PDFium_SOURCE_DIR=%CD%\pdfium
set PDFium_BUILD_DIR=%PDFium_SOURCE_DIR%\out
set PDFium_PATCH_DIR=%CD%\patches
set PDFium_ARGS=%CD%\windows.args.gn

: Output
set PDFium_STAGING_DIR=%CD%\staging
set PDFium_INCLUDE_DIR=%PDFium_STAGING_DIR%\include
set PDFium_LIB_DIR=%PDFium_STAGING_DIR%\%PLATFORM%\lib
set PDFium_ARTIFACT=%CD%\pdfium-windows-%PLATFORM%.zip
if "%CONFIGURATION%"=="Debug" set PDFium_ARTIFACT=%CD%\pdfium-windows-%PLATFORM%-debug.zip

echo on

: Prepare directories
mkdir %PDFium_BUILD_DIR%
mkdir %PDFium_STAGING_DIR%
mkdir %PDFium_LIB_DIR%

: Download depot_tools
set PATH=%GITPATH%;%PATH%
call curl -fsSL -o depot_tools.zip %DepotTools_URL% || exit /b
if not exist %DepotTools_DIR% powershell Expand-Archive depot_tools.zip %DepotTools_DIR% || exit /b

set PATH=%DepotTools_DIR%;%WindowsSDK_DIR%;%PATH%
set DEPOT_TOOLS_WIN_TOOLCHAIN=0

: check that rc.exe is in PATH
where rc.exe || exit /b

:: Clone
:call gclient config --unmanaged %PDFium_URL% || exit /b
:call gclient sync || exit /b

:: Checkout branch (or ignore if it doesn't exist)
echo on
cd %PDFium_SOURCE_DIR%
:git.exe checkout %PDFium_BRANCH% && call gclient sync

:: Patch
cd %PDFium_SOURCE_DIR%
copy "%PDFium_PATCH_DIR%\resources.rc" . || exit /b
git.exe apply -v "%PDFium_PATCH_DIR%\shared_library.patch" || exit /b
git.exe -C build apply -v "%PDFium_PATCH_DIR%\rc_compiler.patch" || exit /b

: Configure
cd %PDFium_SOURCE_DIR%
copy %PDFium_ARGS% %PDFium_BUILD_DIR%\args.gn
if "%CONFIGURATION%"=="Release" echo is_debug=false >> %PDFium_BUILD_DIR%\args.gn
if "%PLATFORM%"=="x86" echo target_cpu="x86" >> %PDFium_BUILD_DIR%\args.gn

: Generate Ninja files
call gn gen %PDFium_BUILD_DIR% || exit /b

: Build
:call ninja -C %PDFium_BUILD_DIR% pdfium -t clean || exit /b
call ninja -C %PDFium_BUILD_DIR% pdfium -j 5 || exit /b

: Install
echo on
copy %PDFium_SOURCE_DIR%\LICENSE %PDFium_STAGING_DIR% || exit /b
xcopy /S /Y %PDFium_SOURCE_DIR%\public %PDFium_INCLUDE_DIR%\ || exit /b
del %PDFium_INCLUDE_DIR%\DEPS
del %PDFium_INCLUDE_DIR%\README
del %PDFium_INCLUDE_DIR%\PRESUBMIT.py
move %PDFium_BUILD_DIR%\pdfium.dll.lib %PDFium_LIB_DIR%\pdfium.lib || exit /b
move %PDFium_BUILD_DIR%\pdfium.dll %PDFium_LIB_DIR% || exit /b
move %PDFium_BUILD_DIR%\pdfium.dll.pdb %PDFium_LIB_DIR%

: Pack
cd %PDFium_STAGING_DIR%
del %PDFium_ARTIFACT%
call powershell Compress-Archive * %PDFium_ARTIFACT%
Loading

0 comments on commit a69204a

Please sign in to comment.