mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Move MpeghUtil to extractor.ts package
This commit is contained in:
parent
4822033a6c
commit
0102f4b512
2 changed files with 3 additions and 5 deletions
|
|
@ -32,7 +32,6 @@ import androidx.media3.common.util.ParsableByteArray;
|
||||||
import androidx.media3.common.util.UnstableApi;
|
import androidx.media3.common.util.UnstableApi;
|
||||||
import androidx.media3.common.util.Util;
|
import androidx.media3.common.util.Util;
|
||||||
import androidx.media3.extractor.ExtractorOutput;
|
import androidx.media3.extractor.ExtractorOutput;
|
||||||
import androidx.media3.extractor.MpeghUtil;
|
|
||||||
import androidx.media3.extractor.TrackOutput;
|
import androidx.media3.extractor.TrackOutput;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
|
|
@ -164,6 +163,7 @@ public final class MpeghReader implements ElementaryStreamReader {
|
||||||
if (continueRead(data, headerScratchBytes, MpeghUtil.MAX_MHAS_PACKET_HEADER_SIZE)) {
|
if (continueRead(data, headerScratchBytes, MpeghUtil.MAX_MHAS_PACKET_HEADER_SIZE)) {
|
||||||
parseHeader();
|
parseHeader();
|
||||||
// write the packet header to output
|
// write the packet header to output
|
||||||
|
headerScratchBytes.setPosition(0);
|
||||||
output.sampleData(headerScratchBytes, header.headerLength);
|
output.sampleData(headerScratchBytes, header.headerLength);
|
||||||
// MHAS packet header finished -> obtain the packet payload
|
// MHAS packet header finished -> obtain the packet payload
|
||||||
state = STATE_READING_PACKET_PAYLOAD;
|
state = STATE_READING_PACKET_PAYLOAD;
|
||||||
|
|
@ -177,7 +177,6 @@ public final class MpeghReader implements ElementaryStreamReader {
|
||||||
}
|
}
|
||||||
writeSampleData(data);
|
writeSampleData(data);
|
||||||
if (payloadBytesRead == header.packetLength) {
|
if (payloadBytesRead == header.packetLength) {
|
||||||
dataScratchBytes.setPosition(0);
|
|
||||||
ParsableBitArray bitArray = new ParsableBitArray(dataScratchBytes.getData());
|
ParsableBitArray bitArray = new ParsableBitArray(dataScratchBytes.getData());
|
||||||
if (header.packetType == MpeghUtil.MhasPacketHeader.PACTYP_MPEGH3DACFG) {
|
if (header.packetType == MpeghUtil.MhasPacketHeader.PACTYP_MPEGH3DACFG) {
|
||||||
parseConfig(bitArray);
|
parseConfig(bitArray);
|
||||||
|
|
@ -254,7 +253,6 @@ public final class MpeghReader implements ElementaryStreamReader {
|
||||||
* @throws ParserException if a valid {@link MpeghUtil.Mpegh3daConfig} cannot be parsed.
|
* @throws ParserException if a valid {@link MpeghUtil.Mpegh3daConfig} cannot be parsed.
|
||||||
*/
|
*/
|
||||||
private void parseHeader() throws ParserException {
|
private void parseHeader() throws ParserException {
|
||||||
headerScratchBytes.setPosition(0);
|
|
||||||
// parse the MHAS packet header
|
// parse the MHAS packet header
|
||||||
header = MpeghUtil.parseMhasPacketHeader(new ParsableBitArray(headerScratchBytes.getData()));
|
header = MpeghUtil.parseMhasPacketHeader(new ParsableBitArray(headerScratchBytes.getData()));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package androidx.media3.extractor;
|
package androidx.media3.extractor.ts;
|
||||||
|
|
||||||
import static java.lang.annotation.ElementType.TYPE_USE;
|
import static java.lang.annotation.ElementType.TYPE_USE;
|
||||||
|
|
||||||
|
|
@ -31,7 +31,7 @@ import java.lang.annotation.Target;
|
||||||
|
|
||||||
/** Utility methods for parsing MPEG-H frames, which are access units in MPEG-H bitstreams. */
|
/** Utility methods for parsing MPEG-H frames, which are access units in MPEG-H bitstreams. */
|
||||||
@UnstableApi
|
@UnstableApi
|
||||||
public final class MpeghUtil {
|
/* package */ final class MpeghUtil {
|
||||||
|
|
||||||
/** See ISO_IEC_23003-8;2022, 14.4.4. */
|
/** See ISO_IEC_23003-8;2022, 14.4.4. */
|
||||||
private static final int MHAS_SYNC_WORD = 0xC001A5;
|
private static final int MHAS_SYNC_WORD = 0xC001A5;
|
||||||
Loading…
Reference in a new issue