mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Create orientation matrix byte array using util method
PiperOrigin-RevId: 514375835
This commit is contained in:
parent
06741778e4
commit
db6064288c
3 changed files with 71 additions and 0 deletions
|
|
@ -200,6 +200,23 @@ public final class Util {
|
||||||
return outputStream.toByteArray();
|
return outputStream.toByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts an array of 32-bit integers into an equivalent byte array.
|
||||||
|
*
|
||||||
|
* <p>Each integer is converted into 4 sequential bytes.
|
||||||
|
*/
|
||||||
|
public static byte[] toByteArray(int... values) {
|
||||||
|
byte[] array = new byte[values.length * 4];
|
||||||
|
int index = 0;
|
||||||
|
for (int value : values) {
|
||||||
|
array[index++] = (byte) (value >> 24);
|
||||||
|
array[index++] = (byte) (value >> 16);
|
||||||
|
array[index++] = (byte) (value >> 8);
|
||||||
|
array[index++] = (byte) (value /* >> 0 */);
|
||||||
|
}
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers a {@link BroadcastReceiver} that's not intended to receive broadcasts from other
|
* Registers a {@link BroadcastReceiver} that's not intended to receive broadcasts from other
|
||||||
* apps. This will be enforced by specifying {@link Context#RECEIVER_NOT_EXPORTED} if {@link
|
* apps. This will be enforced by specifying {@link Context#RECEIVER_NOT_EXPORTED} if {@link
|
||||||
|
|
|
||||||
27
testdata/src/test/assets/muxerdumps/mp4_with_180_orientation.mp4.dump
vendored
Normal file
27
testdata/src/test/assets/muxerdumps/mp4_with_180_orientation.mp4.dump
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
seekMap:
|
||||||
|
isSeekable = true
|
||||||
|
duration = 0
|
||||||
|
getPosition(0) = [[timeUs=0, position=44]]
|
||||||
|
getPosition(1) = [[timeUs=0, position=44]]
|
||||||
|
getPosition(0) = [[timeUs=0, position=44]]
|
||||||
|
getPosition(0) = [[timeUs=0, position=44]]
|
||||||
|
numberOfTracks = 1
|
||||||
|
track 0:
|
||||||
|
total output bytes = 55
|
||||||
|
sample count = 1
|
||||||
|
format 0:
|
||||||
|
id = 1
|
||||||
|
sampleMimeType = video/avc
|
||||||
|
codecs = avc1.9B2BF3
|
||||||
|
maxInputSize = 85
|
||||||
|
width = 12
|
||||||
|
height = 10
|
||||||
|
rotationDegrees = 180
|
||||||
|
initializationData:
|
||||||
|
data = length 24, hash 7F12E259
|
||||||
|
data = length 5, hash 1B4D906
|
||||||
|
sample 0:
|
||||||
|
time = 0
|
||||||
|
flags = 536870913
|
||||||
|
data = length 55, hash A481CEF4
|
||||||
|
tracksEnded = true
|
||||||
27
testdata/src/test/assets/muxerdumps/mp4_with_270_orientation.mp4.dump
vendored
Normal file
27
testdata/src/test/assets/muxerdumps/mp4_with_270_orientation.mp4.dump
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
seekMap:
|
||||||
|
isSeekable = true
|
||||||
|
duration = 0
|
||||||
|
getPosition(0) = [[timeUs=0, position=44]]
|
||||||
|
getPosition(1) = [[timeUs=0, position=44]]
|
||||||
|
getPosition(0) = [[timeUs=0, position=44]]
|
||||||
|
getPosition(0) = [[timeUs=0, position=44]]
|
||||||
|
numberOfTracks = 1
|
||||||
|
track 0:
|
||||||
|
total output bytes = 55
|
||||||
|
sample count = 1
|
||||||
|
format 0:
|
||||||
|
id = 1
|
||||||
|
sampleMimeType = video/avc
|
||||||
|
codecs = avc1.9B2BF3
|
||||||
|
maxInputSize = 85
|
||||||
|
width = 12
|
||||||
|
height = 10
|
||||||
|
rotationDegrees = 270
|
||||||
|
initializationData:
|
||||||
|
data = length 24, hash 7F12E259
|
||||||
|
data = length 5, hash 1B4D906
|
||||||
|
sample 0:
|
||||||
|
time = 0
|
||||||
|
flags = 536870913
|
||||||
|
data = length 55, hash A481CEF4
|
||||||
|
tracksEnded = true
|
||||||
Loading…
Reference in a new issue