3#define TS_PACKET_SIZE 188
5#ifndef MTS_WRITE_BUFFER_SIZE
6#define MTS_WRITE_BUFFER_SIZE 2000
130 const char *
mime() {
return "video/MP2T"; }
141 LOGI(
"MTSDecoder::write: Buffer full");
145 LOGI(
"MTSDecoder::write: %d", (
int)len);
218 if (pid == 0)
return;
220 if (
pids[
j] == pid)
return;
222 LOGI(
"-> PMT PID: 0x%04X(%d)", pid, pid);
231 LOGI(
"demux: step #%d with PES #%d", ++count, (
int)
pes_count);
233 LOGI(
"Number of demux calls: %d", count);
240 for (
int j = 0;
j < len;
j++) {
251 if (pos < 0)
return false;
253 LOGW(
"Sync byte not found at position 0. Skipping %d bytes", pos);
258 int pid = ((packet[1] & 0x1F) << 8) | (packet[2] & 0xFF);
259 LOGI(
"PID: 0x%04X(%d)", pid, pid);
293 LOGE(
"-> Packet ignored for PID 0x%x", pid);
314 if (packet[1] & 0x40) {
315 if (!
isPES) offset += packet[offset] + 1;
341 int pid = ((
pat[i + 2] & 0x1F) << 8) | (
pat[i + 3] & 0xFF);
345 if (
pmt_pid == 0xFFFF && pid >= 0x0020 && pid <= 0x1FFE) {
366 LOGI(
"-- Stream Type: 0x%02X(%d) [%s] for Elementary PID: 0x%04X(%d)",
383 LOGI(
"parsePES: %d", pid);
401 LOGE(
"PES header not aligned correctly");
406 (
static_cast<int>(
pes[4]) << 8) |
static_cast<int>(
pes[5]);
411 if ((
pes[6] & 0xC0) != 0) {
455 if (
pes[0] != 0)
return false;
456 if (
pes[1] != 0)
return false;
457 if (
pes[2] != 0x1)
return false;
467 return "AUDIO_MP3_LOW_BITRATE";
471 return "AUDIO_AAC_LATM";
480 for (
int i = 0; i <
nBytes - 1; i++) {
#define LOGW(...)
Definition AudioLoggerIDF.h:29
#define TRACEI()
Definition AudioLoggerIDF.h:32
#define TRACED()
Definition AudioLoggerIDF.h:31
#define LOGI(...)
Definition AudioLoggerIDF.h:28
#define TRACEE()
Definition AudioLoggerIDF.h:34
#define LOGE(...)
Definition AudioLoggerIDF.h:30
#define MTS_WRITE_BUFFER_SIZE
Definition CodecMTS.h:6
#define TS_PACKET_SIZE
Definition CodecMTS.h:3
#define assert(T)
Definition avr.h:10
MTSStreamType
PMT Program Element Stream Types.
Definition CodecMTS.h:20
@ ATSC_USER_PRIV_PROG_ELEMENTS
@ ATSC_DATA_SERVICE_TABLE