Cleanup ProgramMapTableWriter
Change-Id: I08093a0fc35dc15a20f6e72166ed46d3ab94b334
This commit is contained in:
parent
2a2493ec2e
commit
79a54d7748
|
@ -255,20 +255,20 @@ void WritePmtWithParameters(uint8_t stream_type,
|
||||||
ProgramMapTableWriter::ProgramMapTableWriter(Codec codec) : codec_(codec) {}
|
ProgramMapTableWriter::ProgramMapTableWriter(Codec codec) : codec_(codec) {}
|
||||||
|
|
||||||
bool ProgramMapTableWriter::EncryptedSegmentPmt(BufferWriter* writer) {
|
bool ProgramMapTableWriter::EncryptedSegmentPmt(BufferWriter* writer) {
|
||||||
uint8_t stream_type;
|
|
||||||
switch (codec_) {
|
|
||||||
case kCodecH264:
|
|
||||||
stream_type = kStreamTypeEncryptedH264;
|
|
||||||
break;
|
|
||||||
case kCodecAAC:
|
|
||||||
stream_type = kStreamTypeEncryptedAdtsAac;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
LOG(ERROR) << "Codec " << codec_ << " is not supported in TS yet.";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (encrypted_pmt_.Size() == 0) {
|
if (encrypted_pmt_.Size() == 0) {
|
||||||
|
uint8_t stream_type;
|
||||||
|
switch (codec_) {
|
||||||
|
case kCodecH264:
|
||||||
|
stream_type = kStreamTypeEncryptedH264;
|
||||||
|
break;
|
||||||
|
case kCodecAAC:
|
||||||
|
stream_type = kStreamTypeEncryptedAdtsAac;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
LOG(ERROR) << "Codec " << codec_ << " is not supported in TS yet.";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
BufferWriter descriptors;
|
BufferWriter descriptors;
|
||||||
if (!WriteDescriptors(&descriptors))
|
if (!WriteDescriptors(&descriptors))
|
||||||
return false;
|
return false;
|
||||||
|
@ -285,20 +285,20 @@ bool ProgramMapTableWriter::EncryptedSegmentPmt(BufferWriter* writer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProgramMapTableWriter::ClearSegmentPmt(BufferWriter* writer) {
|
bool ProgramMapTableWriter::ClearSegmentPmt(BufferWriter* writer) {
|
||||||
uint8_t stream_type;
|
|
||||||
switch (codec_) {
|
|
||||||
case kCodecH264:
|
|
||||||
stream_type = kStreamTypeH264;
|
|
||||||
break;
|
|
||||||
case kCodecAAC:
|
|
||||||
stream_type = kStreamTypeAdtsAac;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
LOG(ERROR) << "Codec " << codec_ << " is not supported in TS yet.";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clear_pmt_.Size() == 0) {
|
if (clear_pmt_.Size() == 0) {
|
||||||
|
uint8_t stream_type;
|
||||||
|
switch (codec_) {
|
||||||
|
case kCodecH264:
|
||||||
|
stream_type = kStreamTypeH264;
|
||||||
|
break;
|
||||||
|
case kCodecAAC:
|
||||||
|
stream_type = kStreamTypeAdtsAac;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
LOG(ERROR) << "Codec " << codec_ << " is not supported in TS yet.";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
WritePmtWithParameters(stream_type, kVersion0, kCurrent, nullptr, 0,
|
WritePmtWithParameters(stream_type, kVersion0, kCurrent, nullptr, 0,
|
||||||
&clear_pmt_);
|
&clear_pmt_);
|
||||||
DCHECK_NE(clear_pmt_.Size(), 0u);
|
DCHECK_NE(clear_pmt_.Size(), 0u);
|
||||||
|
|
Loading…
Reference in New Issue