Skip to content

Commit fb2e545

Browse files
committed
update to 11.4.2 (5469)
1 parent 9b78d43 commit fb2e545

File tree

295 files changed

+18934
-3822
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

295 files changed

+18934
-3822
lines changed

TMessagesProj/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ apply plugin: 'com.google.gms.google-services'
210210
task checkVisibility {
211211
doFirst {
212212
def isPrivateBuild = project.gradle.startParameter.taskNames.find {
213-
it.contains("HA_private") || it.contains("Debug") || it.contains("Release")
213+
it.contains("HA_private") || it.contains("HA_hardcore") || it.contains("Debug") || it.contains("Release")
214214
}
215215
def isPublicAllowed = !project.hasProperty("IS_PRIVATE") || !project.property("IS_PRIVATE").toBoolean()
216216
if (!isPrivateBuild && !isPublicAllowed) {

TMessagesProj/jni/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libavresample.a,
1313
${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libavutil.a,
1414
${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libswresample.a,
1515
${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libvpx.a,
16+
${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libdav1d.a,
1617
${CMAKE_HOME_DIRECTORY}/boringssl/lib/libssl_${ANDROID_ABI}.a,
1718
${CMAKE_HOME_DIRECTORY}/boringssl/lib/libcrypto_${ANDROID_ABI}.a")
1819

@@ -49,6 +50,8 @@ set_target_properties(ssl PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/b
4950
add_library(libvpx STATIC IMPORTED)
5051
set_target_properties(libvpx PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libvpx.a)
5152

53+
add_library(libdav1d STATIC IMPORTED)
54+
set_target_properties(libdav1d PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libdav1d.a)
5255

5356
#tgnet
5457
#add_library(mozjpeg STATIC
@@ -641,6 +644,7 @@ target_link_libraries(${NATIVE_LIB}
641644
avresample
642645
swresample
643646
libvpx
647+
libdav1d
644648
avutil
645649
ssl
646650
crypto

TMessagesProj/jni/TgNetWrapper.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ jint getCurrentTime(JNIEnv *env, jclass c, jint instanceNum) {
8585
return ConnectionsManager::getInstance(instanceNum).getCurrentTime();
8686
}
8787

88+
jint getCurrentPingTime(JNIEnv *env, jclass c, jint instanceNum) {
89+
return ConnectionsManager::getInstance(instanceNum).getCurrentPingTime();
90+
}
91+
8892
jint getCurrentDatacenterId(JNIEnv *env, jclass c, jint instanceNum) {
8993
return ConnectionsManager::getInstance(instanceNum).getCurrentDatacenterId();
9094
}
@@ -486,6 +490,7 @@ static const char *ConnectionsManagerClassPathName = "org/telegram/tgnet/Connect
486490
static JNINativeMethod ConnectionsManagerMethods[] = {
487491
{"native_getCurrentTimeMillis", "(I)J", (void *) getCurrentTimeMillis},
488492
{"native_getCurrentTime", "(I)I", (void *) getCurrentTime},
493+
{"native_getCurrentPingTime", "(I)I", (void *) getCurrentPingTime},
489494
{"native_getCurrentDatacenterId", "(I)I", (void *) getCurrentDatacenterId},
490495
{"native_isTestBackend", "(I)I", (void *) isTestBackend},
491496
{"native_getTimeDifference", "(I)I", (void *) getTimeDifference},
Binary file not shown.
824 Bytes
Binary file not shown.
Binary file not shown.
504 Bytes
Binary file not shown.
1.02 MB
Binary file not shown.
Binary file not shown.
32 Bytes
Binary file not shown.
5.06 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
440 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
64 Bytes
Binary file not shown.
5.07 KB
Binary file not shown.

TMessagesProj/jni/ffmpeg/build_ffmpeg/build_ffmpeg.sh

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,26 @@
55
# ffmpeg 4.4.3
66
# lib vpx 1.10.9
77
# NDK for compile libvpx. Last successful build with 21.1.6352462
8+
# and dav1d. Last successful build with
89
# NDK r10e for compile ffmpeg
910
#
1011
# 1) download ffmpeg
1112
# 2) set NDK_r10e and NDK variables
1213
# 3) download lib vpx
1314
# 4) copy libvpx to vpx-android folder and rename as libvpx
1415
# 5) copy build_ffmpeg foleder in ffmepg directory
15-
# 6) run build_ffmpeg.sh
16-
# 7) see compiled library in build_ffmpeg/adnroid folder
16+
# 6) download dav1d into android-dav1d/dav1d folder
17+
# 7.1) in ffmpeg fix typos in 3 files, replacing 'int B0' into 'int b0'
18+
# 7.2) install python3.9 and replace python in vpx-android/_settings.sh
19+
# 7.3) (macos) replace HOST_NUM_CORES with $(sysctl -n hw.physicalcpu)
20+
# 7.4) (macos) press allow and open for each executable in system preferences
21+
# 8) patch ffmpeg/configure to take dav1d as an external lib from folder:
22+
# enabled libdav1d && {
23+
# require_pkg_config libdav1d "libdav1d >= 0.5.0" "dav1d/dav1d.h" dav1d_version ||
24+
# check_lib libdav1d "dav1d/dav1d.h" "DAV1D_VERSION" "-ldav1d $libm_extralibs $pthreads_extralibs"
25+
# }
26+
# 9) run build_ffmpeg.sh
27+
# 10) see compiled library in build_ffmpeg/android folder
1728

1829
NDK="/opt/android/ndk/android-ndk-r21e"
1930
NDK_r10e="/opt/android/ndk/android-ndk-r10e"
@@ -24,6 +35,11 @@ export ANDROID_NDK=$NDK
2435
sh build-vpx.sh
2536
cd ..
2637

38+
#build dav1d
39+
cd ./dav1d-android
40+
export ANDROID_NDK=$NDK
41+
./build_dav1d.sh
42+
cd ..
2743

2844
NDK=$NDK_r10e
2945

@@ -37,7 +53,7 @@ echo "Configuring..."
3753

3854
INCLUDES=" -I${PREFIX}/include"
3955
LIBS=" -L${PREFIX}/lib"
40-
56+
4157
./configure \
4258
--cc=$CC \
4359
--nm=$NM \
@@ -80,6 +96,10 @@ LIBS=" -L${PREFIX}/lib"
8096
--enable-muxer=matroska \
8197
--enable-bsf=vp9_superframe \
8298
--enable-bsf=vp9_raw_reorder \
99+
\
100+
--enable-libdav1d \
101+
--enable-decoder=libdav1d \
102+
--enable-decoder=av1 \
83103
--enable-runtime-cpudetect \
84104
--enable-pthreads \
85105
--enable-avresample \
@@ -106,7 +126,7 @@ $ADDITIONAL_CONFIGURE_FLAG
106126

107127
#echo "continue?"
108128
#read
109-
make -j8 install
129+
make -j${HOST_NUM_CORES} install
110130

111131
}
112132

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#!/bin/bash
2+
3+
PREFIX="$(pwd)/../android"
4+
mkdir -p "$PREFIX"
5+
echo "Building dav1d into $PREFIX"
6+
7+
pushd dav1d
8+
9+
meson setup builddir-arm64 \
10+
--prefix "$PREFIX/arm64-v8a" \
11+
--libdir="lib" \
12+
--includedir="include" \
13+
--buildtype=release -Denable_tests=false -Denable_tools=false -Ddefault_library=static \
14+
--cross-file <(echo "
15+
[binaries]
16+
c = '${ANDROID_NDK}/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang'
17+
ar = '${ANDROID_NDK}/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ar'
18+
19+
[host_machine]
20+
system = 'android'
21+
cpu_family = 'aarch64'
22+
cpu = 'arm64'
23+
endian = 'little'
24+
")
25+
ninja -C builddir-arm64
26+
ninja -C builddir-arm64 install
27+
28+
meson setup builddir-armv7 \
29+
--prefix "$PREFIX/armeabi-v7a" \
30+
--libdir="lib" \
31+
--includedir="include" \
32+
--buildtype=release -Denable_tests=false -Denable_tools=false -Ddefault_library=static \
33+
--cross-file <(echo "
34+
[binaries]
35+
c = '${ANDROID_NDK}/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi21-clang'
36+
ar = '${ANDROID_NDK}/toolchains/llvm/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ar'
37+
38+
[host_machine]
39+
system = 'android'
40+
cpu_family = 'arm'
41+
cpu = 'armv7'
42+
endian = 'little'
43+
") \
44+
-Dc_args="-DDAV1D_NO_GETAUXVAL"
45+
ninja -C builddir-armv7
46+
ninja -C builddir-armv7 install
47+
48+
meson setup builddir-x86 \
49+
--prefix "$PREFIX/x86" \
50+
--libdir="lib" \
51+
--includedir="include" \
52+
--buildtype=release -Denable_tests=false -Denable_tools=false -Ddefault_library=static \
53+
--cross-file <(echo "
54+
[binaries]
55+
c = '${ANDROID_NDK}/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android21-clang'
56+
ar = '${ANDROID_NDK}/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android-ar'
57+
58+
[host_machine]
59+
system = 'android'
60+
cpu_family = 'x86'
61+
cpu = 'i686'
62+
endian = 'little'
63+
")
64+
ninja -C builddir-x86
65+
ninja -C builddir-x86 install
66+
67+
meson setup builddir-x86_64 \
68+
--prefix "$PREFIX/x86_64" \
69+
--libdir="lib" \
70+
--includedir="include" \
71+
--buildtype=release -Denable_tests=false -Denable_tools=false -Ddefault_library=static \
72+
--cross-file <(echo "
73+
[binaries]
74+
c = '${ANDROID_NDK}/toolchains/llvm/prebuilt/darwin-x86_64/bin/x86_64-linux-android21-clang'
75+
ar = '${ANDROID_NDK}/toolchains/llvm/prebuilt/darwin-x86_64/bin/x86_64-linux-android-ar'
76+
77+
[host_machine]
78+
system = 'android'
79+
cpu_family = 'x86_64'
80+
cpu = 'x86_64'
81+
endian = 'little'
82+
")
83+
ninja -C builddir-x86_64
84+
ninja -C builddir-x86_64 install
85+
86+
popd
87+
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* Copyright © 2018, VideoLAN and dav1d authors
3+
* Copyright © 2018, Two Orioles, LLC
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice, this
10+
* list of conditions and the following disclaimer.
11+
*
12+
* 2. Redistributions in binary form must reproduce the above copyright notice,
13+
* this list of conditions and the following disclaimer in the documentation
14+
* and/or other materials provided with the distribution.
15+
*
16+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20+
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26+
*/
27+
28+
#ifndef DAV1D_COMMON_H
29+
#define DAV1D_COMMON_H
30+
31+
#include <errno.h>
32+
#include <stddef.h>
33+
#include <stdint.h>
34+
35+
#ifdef __cplusplus
36+
extern "C" {
37+
#endif
38+
39+
#ifndef DAV1D_API
40+
#if defined _WIN32
41+
#if defined DAV1D_BUILDING_DLL
42+
#define DAV1D_API __declspec(dllexport)
43+
#else
44+
#define DAV1D_API
45+
#endif
46+
#else
47+
#if __GNUC__ >= 4
48+
#define DAV1D_API __attribute__ ((visibility ("default")))
49+
#else
50+
#define DAV1D_API
51+
#endif
52+
#endif
53+
#endif
54+
55+
#if EPERM > 0
56+
#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
57+
#else
58+
#define DAV1D_ERR(e) (e)
59+
#endif
60+
61+
/**
62+
* A reference-counted object wrapper for a user-configurable pointer.
63+
*/
64+
typedef struct Dav1dUserData {
65+
const uint8_t *data; ///< data pointer
66+
struct Dav1dRef *ref; ///< allocation origin
67+
} Dav1dUserData;
68+
69+
/**
70+
* Input packet metadata which are copied from the input data used to
71+
* decode each image into the matching structure of the output image
72+
* returned back to the user. Since these are metadata fields, they
73+
* can be used for other purposes than the documented ones, they will
74+
* still be passed from input data to output picture without being
75+
* used internally.
76+
*/
77+
typedef struct Dav1dDataProps {
78+
int64_t timestamp; ///< container timestamp of input data, INT64_MIN if unknown (default)
79+
int64_t duration; ///< container duration of input data, 0 if unknown (default)
80+
int64_t offset; ///< stream offset of input data, -1 if unknown (default)
81+
size_t size; ///< packet size, default Dav1dData.sz
82+
struct Dav1dUserData user_data; ///< user-configurable data, default NULL members
83+
} Dav1dDataProps;
84+
85+
/**
86+
* Release reference to a Dav1dDataProps.
87+
*/
88+
DAV1D_API void dav1d_data_props_unref(Dav1dDataProps *props);
89+
90+
#ifdef __cplusplus
91+
} /* extern "C" */
92+
#endif
93+
94+
#endif /* DAV1D_COMMON_H */

0 commit comments

Comments
 (0)