Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.7 KiB
C++
Raw Normal View History

/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "sdk/android/native_api/codecs/wrapper.h"
Use std::make_unique instead of absl::make_unique. WebRTC is now using C++14 so there is no need to use the Abseil version of std::make_unique. This CL has been created with the following steps: git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \ uniq > /tmp/only_make_unique.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/only_make_unique.txt /tmp/memory.txt | \ xargs grep -l "absl/memory" > /tmp/add-memory.txt git grep -l "\babsl::make_unique\b" | \ xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g" git checkout PRESUBMIT.py abseil-in-webrtc.md cat /tmp/add-memory.txt | \ xargs sed -i \ 's/#include "absl\/memory\/memory.h"/#include <memory>/g' git cl format # Manual fix order of the new inserted #include <memory> cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \ xargs sed -i '/#include "absl\/memory\/memory.h"/d' git ls-files | grep BUILD.gn | \ xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d' python tools_webrtc/gn_check_autofix.py \ -m tryserver.webrtc -b linux_rel # Repead the gn_check_autofix step for other platforms git ls-files | grep BUILD.gn | \ xargs sed -i 's/absl\/memory:memory/absl\/memory/g' git cl format Bug: webrtc:10945 Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 17:06:18 +02:00
#include <memory>
#include "sdk/android/native_api/jni/scoped_java_ref.h"
#include "sdk/android/src/jni/video_codec_info.h"
#include "sdk/android/src/jni/video_decoder_factory_wrapper.h"
#include "sdk/android/src/jni/video_encoder_factory_wrapper.h"
#include "sdk/android/src/jni/video_encoder_wrapper.h"
namespace webrtc {
SdpVideoFormat JavaToNativeVideoCodecInfo(JNIEnv* jni, jobject codec_info) {
return jni::VideoCodecInfoToSdpVideoFormat(
Revert "Reland "Remove jni_zero type aliases in jni_generator_helper.h."" This reverts commit 6cb7b3a424455f82ad5df78a7295a3e5253b1445. Reason for revert: Breaks downstream project (possibly due to alias change) Original change's description: > Reland "Remove jni_zero type aliases in jni_generator_helper.h." > > This is a reland of commit 9fcaa034bc032da9de5d6fcdd45528169f44d343 > > Original change's description: > > Remove jni_zero type aliases in jni_generator_helper.h. > > > > This CL removes some type alias from > > sdk/android/src/jni/jni_generator_helper.h and make sure all the > > jni_zero types are referred to using the jni_zero:: namespace. > > > > The goal is to remove sdk/android/src/jni/jni_generator_helper.h > > in future CLs. > > > > Bug: b/319078685, b/351773023 > > Change-Id: Ief60fce3e8f301f09ac5392d143aa5a82a445bcb > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356882 > > Reviewed-by: Zoé Lepaul <xalep@webrtc.org> > > Reviewed-by: Jeremy Leconte <jleconte@google.com> > > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#42618} > > No-Presubmit: True > Bug: b/319078685, b/351773023 > Change-Id: I605a726788ee84efdbdc9e75098b404cbd7c1f30 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358922 > Reviewed-by: Zoé Lepaul <xalep@webrtc.org> > Reviewed-by: Christoffer Dewerin <jansson@webrtc.org> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#42751} Bug: b/319078685, b/351773023 Change-Id: Ia9d7ab4ef667c68d2ae5c96318e8126c635a1519 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359000 Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Owners-Override: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Rayan Osseiran <rayano@google.com> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42755}
2024-08-09 15:41:47 +00:00
jni, JavaParamRef<jobject>(jni, codec_info));
}
std::unique_ptr<VideoDecoderFactory> JavaToNativeVideoDecoderFactory(
JNIEnv* jni,
jobject decoder_factory) {
Use std::make_unique instead of absl::make_unique. WebRTC is now using C++14 so there is no need to use the Abseil version of std::make_unique. This CL has been created with the following steps: git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \ uniq > /tmp/only_make_unique.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/only_make_unique.txt /tmp/memory.txt | \ xargs grep -l "absl/memory" > /tmp/add-memory.txt git grep -l "\babsl::make_unique\b" | \ xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g" git checkout PRESUBMIT.py abseil-in-webrtc.md cat /tmp/add-memory.txt | \ xargs sed -i \ 's/#include "absl\/memory\/memory.h"/#include <memory>/g' git cl format # Manual fix order of the new inserted #include <memory> cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \ xargs sed -i '/#include "absl\/memory\/memory.h"/d' git ls-files | grep BUILD.gn | \ xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d' python tools_webrtc/gn_check_autofix.py \ -m tryserver.webrtc -b linux_rel # Repead the gn_check_autofix step for other platforms git ls-files | grep BUILD.gn | \ xargs sed -i 's/absl\/memory:memory/absl\/memory/g' git cl format Bug: webrtc:10945 Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 17:06:18 +02:00
return std::make_unique<jni::VideoDecoderFactoryWrapper>(
Revert "Reland "Remove jni_zero type aliases in jni_generator_helper.h."" This reverts commit 6cb7b3a424455f82ad5df78a7295a3e5253b1445. Reason for revert: Breaks downstream project (possibly due to alias change) Original change's description: > Reland "Remove jni_zero type aliases in jni_generator_helper.h." > > This is a reland of commit 9fcaa034bc032da9de5d6fcdd45528169f44d343 > > Original change's description: > > Remove jni_zero type aliases in jni_generator_helper.h. > > > > This CL removes some type alias from > > sdk/android/src/jni/jni_generator_helper.h and make sure all the > > jni_zero types are referred to using the jni_zero:: namespace. > > > > The goal is to remove sdk/android/src/jni/jni_generator_helper.h > > in future CLs. > > > > Bug: b/319078685, b/351773023 > > Change-Id: Ief60fce3e8f301f09ac5392d143aa5a82a445bcb > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356882 > > Reviewed-by: Zoé Lepaul <xalep@webrtc.org> > > Reviewed-by: Jeremy Leconte <jleconte@google.com> > > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#42618} > > No-Presubmit: True > Bug: b/319078685, b/351773023 > Change-Id: I605a726788ee84efdbdc9e75098b404cbd7c1f30 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358922 > Reviewed-by: Zoé Lepaul <xalep@webrtc.org> > Reviewed-by: Christoffer Dewerin <jansson@webrtc.org> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#42751} Bug: b/319078685, b/351773023 Change-Id: Ia9d7ab4ef667c68d2ae5c96318e8126c635a1519 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359000 Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Owners-Override: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Rayan Osseiran <rayano@google.com> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42755}
2024-08-09 15:41:47 +00:00
jni, JavaParamRef<jobject>(jni, decoder_factory));
}
std::unique_ptr<VideoEncoderFactory> JavaToNativeVideoEncoderFactory(
JNIEnv* jni,
jobject encoder_factory) {
Use std::make_unique instead of absl::make_unique. WebRTC is now using C++14 so there is no need to use the Abseil version of std::make_unique. This CL has been created with the following steps: git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \ uniq > /tmp/only_make_unique.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/only_make_unique.txt /tmp/memory.txt | \ xargs grep -l "absl/memory" > /tmp/add-memory.txt git grep -l "\babsl::make_unique\b" | \ xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g" git checkout PRESUBMIT.py abseil-in-webrtc.md cat /tmp/add-memory.txt | \ xargs sed -i \ 's/#include "absl\/memory\/memory.h"/#include <memory>/g' git cl format # Manual fix order of the new inserted #include <memory> cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \ xargs sed -i '/#include "absl\/memory\/memory.h"/d' git ls-files | grep BUILD.gn | \ xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d' python tools_webrtc/gn_check_autofix.py \ -m tryserver.webrtc -b linux_rel # Repead the gn_check_autofix step for other platforms git ls-files | grep BUILD.gn | \ xargs sed -i 's/absl\/memory:memory/absl\/memory/g' git cl format Bug: webrtc:10945 Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 17:06:18 +02:00
return std::make_unique<jni::VideoEncoderFactoryWrapper>(
Revert "Reland "Remove jni_zero type aliases in jni_generator_helper.h."" This reverts commit 6cb7b3a424455f82ad5df78a7295a3e5253b1445. Reason for revert: Breaks downstream project (possibly due to alias change) Original change's description: > Reland "Remove jni_zero type aliases in jni_generator_helper.h." > > This is a reland of commit 9fcaa034bc032da9de5d6fcdd45528169f44d343 > > Original change's description: > > Remove jni_zero type aliases in jni_generator_helper.h. > > > > This CL removes some type alias from > > sdk/android/src/jni/jni_generator_helper.h and make sure all the > > jni_zero types are referred to using the jni_zero:: namespace. > > > > The goal is to remove sdk/android/src/jni/jni_generator_helper.h > > in future CLs. > > > > Bug: b/319078685, b/351773023 > > Change-Id: Ief60fce3e8f301f09ac5392d143aa5a82a445bcb > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356882 > > Reviewed-by: Zoé Lepaul <xalep@webrtc.org> > > Reviewed-by: Jeremy Leconte <jleconte@google.com> > > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#42618} > > No-Presubmit: True > Bug: b/319078685, b/351773023 > Change-Id: I605a726788ee84efdbdc9e75098b404cbd7c1f30 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358922 > Reviewed-by: Zoé Lepaul <xalep@webrtc.org> > Reviewed-by: Christoffer Dewerin <jansson@webrtc.org> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#42751} Bug: b/319078685, b/351773023 Change-Id: Ia9d7ab4ef667c68d2ae5c96318e8126c635a1519 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359000 Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Owners-Override: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Rayan Osseiran <rayano@google.com> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42755}
2024-08-09 15:41:47 +00:00
jni, JavaParamRef<jobject>(jni, encoder_factory));
}
std::vector<VideoEncoder::ResolutionBitrateLimits>
JavaToNativeResolutionBitrateLimits(JNIEnv* jni,
const jobjectArray j_bitrate_limits_array) {
return jni::JavaToNativeResolutionBitrateLimits(
Revert "Reland "Remove jni_zero type aliases in jni_generator_helper.h."" This reverts commit 6cb7b3a424455f82ad5df78a7295a3e5253b1445. Reason for revert: Breaks downstream project (possibly due to alias change) Original change's description: > Reland "Remove jni_zero type aliases in jni_generator_helper.h." > > This is a reland of commit 9fcaa034bc032da9de5d6fcdd45528169f44d343 > > Original change's description: > > Remove jni_zero type aliases in jni_generator_helper.h. > > > > This CL removes some type alias from > > sdk/android/src/jni/jni_generator_helper.h and make sure all the > > jni_zero types are referred to using the jni_zero:: namespace. > > > > The goal is to remove sdk/android/src/jni/jni_generator_helper.h > > in future CLs. > > > > Bug: b/319078685, b/351773023 > > Change-Id: Ief60fce3e8f301f09ac5392d143aa5a82a445bcb > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356882 > > Reviewed-by: Zoé Lepaul <xalep@webrtc.org> > > Reviewed-by: Jeremy Leconte <jleconte@google.com> > > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#42618} > > No-Presubmit: True > Bug: b/319078685, b/351773023 > Change-Id: I605a726788ee84efdbdc9e75098b404cbd7c1f30 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358922 > Reviewed-by: Zoé Lepaul <xalep@webrtc.org> > Reviewed-by: Christoffer Dewerin <jansson@webrtc.org> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#42751} Bug: b/319078685, b/351773023 Change-Id: Ia9d7ab4ef667c68d2ae5c96318e8126c635a1519 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359000 Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Owners-Override: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Rayan Osseiran <rayano@google.com> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42755}
2024-08-09 15:41:47 +00:00
jni, JavaParamRef<jobjectArray>(jni, j_bitrate_limits_array));
}
} // namespace webrtc