mirror of
https://github.com/ente-io/ente.git
synced 2025-07-25 03:01:22 +00:00
[mob][photos] Fix bug in parsing rotation metadata from video using FFProbe
This commit is contained in:
parent
be00f015a7
commit
af5e9b51e1
@ -72,6 +72,7 @@ class FFProbeKeys {
|
||||
static const xiaomiSlowMoment = 'com.xiaomi.slow_moment';
|
||||
static const sideDataList = 'side_data_list';
|
||||
static const rotation = 'rotation';
|
||||
static const sideDataType = 'side_data_type';
|
||||
}
|
||||
|
||||
class MediaStreamTypes {
|
||||
@ -83,3 +84,16 @@ class MediaStreamTypes {
|
||||
static const unknown = 'unknown';
|
||||
static const video = 'video';
|
||||
}
|
||||
|
||||
enum SideDataType {
|
||||
displayMatrix;
|
||||
|
||||
getString() {
|
||||
switch (this) {
|
||||
case SideDataType.displayMatrix:
|
||||
return 'Display Matrix';
|
||||
default:
|
||||
assert(false, 'Unknown side data type: $this');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -174,7 +174,12 @@ class FFProbeProps {
|
||||
result._codecHeight = stream[key].toString();
|
||||
parsedData[key] = result._codecHeight;
|
||||
} else if (key == FFProbeKeys.sideDataList) {
|
||||
result._rotation = stream[key][0][FFProbeKeys.rotation];
|
||||
for (Map sideData in stream[key]) {
|
||||
if (sideData[FFProbeKeys.sideDataType] ==
|
||||
SideDataType.displayMatrix.getString()) {
|
||||
result._rotation = sideData[FFProbeKeys.rotation];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user