1.6.3
This commit is contained in:
parent
4b72a10cbf
commit
085afce461
@ -440,7 +440,12 @@ private class GiftMp4AlphaRenderer(
|
|||||||
|
|
||||||
GLES20.glViewport(0, 0, viewWidth, viewHeight)
|
GLES20.glViewport(0, 0, viewWidth, viewHeight)
|
||||||
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT)
|
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT)
|
||||||
val viewport = contentViewport(viewWidth, viewHeight, layout.contentAspectRatio)
|
val viewport = contentViewport(
|
||||||
|
viewWidth,
|
||||||
|
viewHeight,
|
||||||
|
layout.contentAspectRatio,
|
||||||
|
cover = !layout.hasAlphaMask,
|
||||||
|
)
|
||||||
GLES20.glViewport(viewport.x, viewport.y, viewport.width, viewport.height)
|
GLES20.glViewport(viewport.x, viewport.y, viewport.width, viewport.height)
|
||||||
GLES20.glUseProgram(program)
|
GLES20.glUseProgram(program)
|
||||||
GLES20.glActiveTexture(GLES20.GL_TEXTURE0)
|
GLES20.glActiveTexture(GLES20.GL_TEXTURE0)
|
||||||
@ -610,6 +615,20 @@ private data class GiftMp4NativeLayout(
|
|||||||
fun defaultLayout(): GiftMp4NativeLayout =
|
fun defaultLayout(): GiftMp4NativeLayout =
|
||||||
GiftMp4NativeLayout(GiftMp4Rect(0f, 0f, 1f, 1f), null)
|
GiftMp4NativeLayout(GiftMp4Rect(0f, 0f, 1f, 1f), null)
|
||||||
|
|
||||||
|
fun normalLayout(width: Int, height: Int): GiftMp4NativeLayout {
|
||||||
|
val aspectRatio =
|
||||||
|
if (width > 0 && height > 0) {
|
||||||
|
width.toFloat() / height.toFloat()
|
||||||
|
} else {
|
||||||
|
1f
|
||||||
|
}
|
||||||
|
return GiftMp4NativeLayout(
|
||||||
|
GiftMp4Rect(0f, 0f, 1f, 1f),
|
||||||
|
null,
|
||||||
|
aspectRatio,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
fun fromCreationParams(data: Any?): GiftMp4NativeLayout? = runCatching {
|
fun fromCreationParams(data: Any?): GiftMp4NativeLayout? = runCatching {
|
||||||
val map = data as? Map<*, *> ?: return null
|
val map = data as? Map<*, *> ?: return null
|
||||||
val color = readLayoutRect(map["colorRect"]) ?: return null
|
val color = readLayoutRect(map["colorRect"]) ?: return null
|
||||||
@ -709,12 +728,15 @@ private data class GiftMp4NativeLayout(
|
|||||||
val best = sortedCandidates.firstOrNull()
|
val best = sortedCandidates.firstOrNull()
|
||||||
val runnerUpScore = sortedCandidates.drop(1).firstOrNull()?.score ?: 0.0
|
val runnerUpScore = sortedCandidates.drop(1).firstOrNull()?.score ?: 0.0
|
||||||
val selected =
|
val selected =
|
||||||
if (best != null && (best.score - runnerUpScore >= 0.12 || best.score >= 0.35)) {
|
best?.takeIf {
|
||||||
best.candidate
|
it.score - runnerUpScore >= 0.12 || it.score >= 0.35
|
||||||
} else {
|
}?.candidate
|
||||||
candidates.first()
|
val bitmapWidth = bitmap.width
|
||||||
}
|
val bitmapHeight = bitmap.height
|
||||||
bitmap.recycle()
|
bitmap.recycle()
|
||||||
|
if (selected == null) {
|
||||||
|
return normalLayout(bitmapWidth, bitmapHeight)
|
||||||
|
}
|
||||||
return GiftMp4NativeLayout(selected.colorRect, selected.alphaRect)
|
return GiftMp4NativeLayout(selected.colorRect, selected.alphaRect)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1056,12 +1078,18 @@ private data class GiftMp4FrameStats(
|
|||||||
val colorScore: Double,
|
val colorScore: Double,
|
||||||
)
|
)
|
||||||
|
|
||||||
private fun contentViewport(width: Int, height: Int, aspectRatio: Float): GiftMp4Viewport {
|
private fun contentViewport(
|
||||||
|
width: Int,
|
||||||
|
height: Int,
|
||||||
|
aspectRatio: Float,
|
||||||
|
cover: Boolean,
|
||||||
|
): GiftMp4Viewport {
|
||||||
if (width <= 0 || height <= 0 || aspectRatio <= 0f) {
|
if (width <= 0 || height <= 0 || aspectRatio <= 0f) {
|
||||||
return GiftMp4Viewport(0, 0, width, height)
|
return GiftMp4Viewport(0, 0, width, height)
|
||||||
}
|
}
|
||||||
val viewAspect = width.toFloat() / height
|
val viewAspect = width.toFloat() / height
|
||||||
return if (viewAspect > aspectRatio) {
|
val fitByHeight = if (cover) viewAspect <= aspectRatio else viewAspect > aspectRatio
|
||||||
|
return if (fitByHeight) {
|
||||||
val contentWidth = (height * aspectRatio).toInt().coerceAtLeast(1)
|
val contentWidth = (height * aspectRatio).toInt().coerceAtLeast(1)
|
||||||
GiftMp4Viewport((width - contentWidth) / 2, 0, contentWidth, height)
|
GiftMp4Viewport((width - contentWidth) / 2, 0, contentWidth, height)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -524,7 +524,7 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1620;
|
CURRENT_PROJECT_VERSION = 1630;
|
||||||
DEVELOPMENT_TEAM = S9YG87C297;
|
DEVELOPMENT_TEAM = S9YG87C297;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
@ -533,7 +533,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.6.2;
|
MARKETING_VERSION = 1.6.3;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.org.yumiparty;
|
PRODUCT_BUNDLE_IDENTIFIER = com.org.yumiparty;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@ -715,7 +715,7 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = Runner/RunnerDebug.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/RunnerDebug.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1620;
|
CURRENT_PROJECT_VERSION = 1630;
|
||||||
DEVELOPMENT_TEAM = S9YG87C297;
|
DEVELOPMENT_TEAM = S9YG87C297;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
@ -724,7 +724,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.6.2;
|
MARKETING_VERSION = 1.6.3;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.org.yumiparty;
|
PRODUCT_BUNDLE_IDENTIFIER = com.org.yumiparty;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@ -744,7 +744,7 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1620;
|
CURRENT_PROJECT_VERSION = 1630;
|
||||||
DEVELOPMENT_TEAM = S9YG87C297;
|
DEVELOPMENT_TEAM = S9YG87C297;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
@ -753,7 +753,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.6.2;
|
MARKETING_VERSION = 1.6.3;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.org.yumiparty;
|
PRODUCT_BUNDLE_IDENTIFIER = com.org.yumiparty;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
|||||||
@ -163,6 +163,7 @@ private final class GiftMp4AlphaVideoView: UIView {
|
|||||||
imageView.isOpaque = false
|
imageView.isOpaque = false
|
||||||
imageView.backgroundColor = .clear
|
imageView.backgroundColor = .clear
|
||||||
imageView.contentMode = .scaleAspectFit
|
imageView.contentMode = .scaleAspectFit
|
||||||
|
imageView.clipsToBounds = true
|
||||||
addSubview(imageView)
|
addSubview(imageView)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,6 +192,7 @@ private final class GiftMp4AlphaVideoView: UIView {
|
|||||||
fileURL: url,
|
fileURL: url,
|
||||||
cacheKey: source.cacheKey
|
cacheKey: source.cacheKey
|
||||||
)
|
)
|
||||||
|
imageView.contentMode = sourceLayout.hasAlphaMask ? .scaleAspectFit : .scaleAspectFill
|
||||||
|
|
||||||
let item = AVPlayerItem(asset: asset)
|
let item = AVPlayerItem(asset: asset)
|
||||||
let output = AVPlayerItemVideoOutput(pixelBufferAttributes: [
|
let output = AVPlayerItemVideoOutput(pixelBufferAttributes: [
|
||||||
|
|||||||
@ -174,7 +174,7 @@ class _GiftPageState extends State<GiftPage> with TickerProviderStateMixin {
|
|||||||
Provider.of<SCAppGeneralManager>(
|
Provider.of<SCAppGeneralManager>(
|
||||||
context,
|
context,
|
||||||
listen: false,
|
listen: false,
|
||||||
).giftList(includeCustomized: false);
|
).giftList(includeCustomized: true);
|
||||||
Provider.of<SCAppGeneralManager>(context, listen: false).giftActivityList();
|
Provider.of<SCAppGeneralManager>(context, listen: false).giftActivityList();
|
||||||
unawaited(
|
unawaited(
|
||||||
Provider.of<SCAppGeneralManager>(
|
Provider.of<SCAppGeneralManager>(
|
||||||
@ -271,7 +271,6 @@ class _GiftPageState extends State<GiftPage> with TickerProviderStateMixin {
|
|||||||
final availableTypes =
|
final availableTypes =
|
||||||
ref.giftByTab.entries
|
ref.giftByTab.entries
|
||||||
.where((entry) => entry.value.isNotEmpty)
|
.where((entry) => entry.value.isNotEmpty)
|
||||||
.where((entry) => entry.key != "CUSTOMIZED")
|
|
||||||
.where((entry) => entry.key != _backpackGiftTab)
|
.where((entry) => entry.key != _backpackGiftTab)
|
||||||
.map((entry) => entry.key)
|
.map((entry) => entry.key)
|
||||||
.toList();
|
.toList();
|
||||||
|
|||||||
@ -213,24 +213,28 @@ class SCAppGeneralManager extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String _displayGiftTab(String? giftTab) {
|
||||||
|
return giftTab == "EXCLUSIVE" ? "CUSTOMIZED" : (giftTab ?? "");
|
||||||
|
}
|
||||||
|
|
||||||
void _rebuildGiftTabs({required bool includeCustomized}) {
|
void _rebuildGiftTabs({required bool includeCustomized}) {
|
||||||
giftByTab.clear();
|
giftByTab.clear();
|
||||||
_giftByIdMap.clear();
|
_giftByIdMap.clear();
|
||||||
_giftByStandardIdMap.clear();
|
_giftByStandardIdMap.clear();
|
||||||
for (var gift in giftResList) {
|
for (var gift in giftResList) {
|
||||||
giftByTab[gift.giftTab];
|
final tab = _displayGiftTab(gift.giftTab);
|
||||||
var gmap = giftByTab[gift.giftTab];
|
var gmap = giftByTab[tab];
|
||||||
gmap ??= [];
|
gmap ??= [];
|
||||||
gmap.add(gift);
|
gmap.add(gift);
|
||||||
giftByTab[gift.giftTab!] = gmap;
|
giftByTab[tab] = gmap;
|
||||||
var gAllMap = giftByTab["ALL"];
|
var gAllMap = giftByTab["ALL"];
|
||||||
gAllMap ??= [];
|
gAllMap ??= [];
|
||||||
if (gift.giftTab != "NSCIONAL_FLAG" &&
|
if (tab != "NSCIONAL_FLAG" &&
|
||||||
gift.giftTab != "ACTIVITY" &&
|
tab != "ACTIVITY" &&
|
||||||
gift.giftTab != "LUCKY_GIFT" &&
|
tab != "LUCKY_GIFT" &&
|
||||||
gift.giftTab != "CP" &&
|
tab != "CP" &&
|
||||||
gift.giftTab != "CUSTOMIZED" &&
|
tab != "CUSTOMIZED" &&
|
||||||
gift.giftTab != "MAGIC") {
|
tab != "MAGIC") {
|
||||||
gAllMap.add(gift);
|
gAllMap.add(gift);
|
||||||
}
|
}
|
||||||
giftByTab["ALL"] = gAllMap;
|
giftByTab["ALL"] = gAllMap;
|
||||||
|
|||||||
@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.6.2+1620
|
version: 1.6.3+1630
|
||||||
|
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user