mediabunny 1.27.3 → 1.27.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundles/mediabunny.cjs +7 -20
- package/dist/bundles/mediabunny.min.cjs +3 -3
- package/dist/bundles/mediabunny.min.mjs +3 -3
- package/dist/bundles/mediabunny.mjs +7 -20
- package/dist/mediabunny.d.ts +2 -4
- package/dist/modules/src/media-sink.d.ts.map +1 -1
- package/dist/modules/src/media-sink.js +7 -16
- package/dist/modules/src/sample.d.ts +2 -4
- package/dist/modules/src/sample.d.ts.map +1 -1
- package/dist/modules/src/sample.js +10 -10
- package/dist/modules/src/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/media-sink.ts +7 -17
- package/src/sample.ts +10 -14
|
@@ -4095,18 +4095,15 @@ var Mediabunny = (() => {
|
|
|
4095
4095
|
this._closed = true;
|
|
4096
4096
|
}
|
|
4097
4097
|
/**
|
|
4098
|
-
* Returns the number of bytes required to hold this video sample's pixel data. Throws if `format` is `null
|
|
4099
|
-
* specify an explicit RGB format in the options in this case.
|
|
4098
|
+
* Returns the number of bytes required to hold this video sample's pixel data. Throws if `format` is `null`.
|
|
4100
4099
|
*/
|
|
4101
4100
|
allocationSize(options = {}) {
|
|
4102
4101
|
validateVideoFrameCopyToOptions(options);
|
|
4103
4102
|
if (this._closed) {
|
|
4104
4103
|
throw new Error("VideoSample is closed.");
|
|
4105
4104
|
}
|
|
4106
|
-
if (
|
|
4107
|
-
throw new Error(
|
|
4108
|
-
"Cannot get allocation size when format is null. Please manually provide an RGB pixel format in the options instead."
|
|
4109
|
-
);
|
|
4105
|
+
if (this.format === null) {
|
|
4106
|
+
throw new Error("Cannot get allocation size when format is null. Sorry!");
|
|
4110
4107
|
}
|
|
4111
4108
|
assert(this._data !== null);
|
|
4112
4109
|
if (!isVideoFrame(this._data)) {
|
|
@@ -4126,8 +4123,7 @@ var Mediabunny = (() => {
|
|
|
4126
4123
|
}
|
|
4127
4124
|
}
|
|
4128
4125
|
/**
|
|
4129
|
-
* Copies this video sample's pixel data to an ArrayBuffer or ArrayBufferView. Throws if `format` is `null
|
|
4130
|
-
* specify an explicit RGB format in the options in this case.
|
|
4126
|
+
* Copies this video sample's pixel data to an ArrayBuffer or ArrayBufferView. Throws if `format` is `null`.
|
|
4131
4127
|
* @returns The byte layout of the planes of the copied data.
|
|
4132
4128
|
*/
|
|
4133
4129
|
async copyTo(destination, options = {}) {
|
|
@@ -4138,10 +4134,8 @@ var Mediabunny = (() => {
|
|
|
4138
4134
|
if (this._closed) {
|
|
4139
4135
|
throw new Error("VideoSample is closed.");
|
|
4140
4136
|
}
|
|
4141
|
-
if (
|
|
4142
|
-
throw new Error(
|
|
4143
|
-
"Cannot copy video sample data when format is null. Please manually provide an RGB pixel format in the options instead."
|
|
4144
|
-
);
|
|
4137
|
+
if (this.format === null) {
|
|
4138
|
+
throw new Error("Cannot copy video sample data when format is null. Sorry!");
|
|
4145
4139
|
}
|
|
4146
4140
|
assert(this._data !== null);
|
|
4147
4141
|
if (!isVideoFrame(this._data)) {
|
|
@@ -5430,14 +5424,7 @@ var Mediabunny = (() => {
|
|
|
5430
5424
|
const packetSink = this._createPacketSink();
|
|
5431
5425
|
const keyPacket = await packetSink.getKeyPacket(startTimestamp, { verifyKeyPackets: true }) ?? await packetSink.getFirstPacket();
|
|
5432
5426
|
let currentPacket = keyPacket;
|
|
5433
|
-
|
|
5434
|
-
if (endTimestamp < Infinity) {
|
|
5435
|
-
const packet = await packetSink.getPacket(endTimestamp);
|
|
5436
|
-
const keyPacket2 = !packet ? null : packet.type === "key" && packet.timestamp === endTimestamp ? packet : await packetSink.getNextKeyPacket(packet, { verifyKeyPackets: true });
|
|
5437
|
-
if (keyPacket2) {
|
|
5438
|
-
endPacket = keyPacket2;
|
|
5439
|
-
}
|
|
5440
|
-
}
|
|
5427
|
+
const endPacket = void 0;
|
|
5441
5428
|
const packets = packetSink.packets(keyPacket ?? void 0, endPacket);
|
|
5442
5429
|
await packets.next();
|
|
5443
5430
|
while (currentPacket && !ended && !this._track.input._disposed) {
|