mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-23 03:33:18 +01:00
Work on mcc
This commit is contained in:
parent
36ff0bc959
commit
97e5a93d2d
@ -41,12 +41,12 @@ namespace Nikse.SubtitleEdit.Core.Cea708
|
||||
}
|
||||
}
|
||||
|
||||
public CcDataSection(int ccDataCount, byte[] bytes)
|
||||
public CcDataSection(int ccDataCount, byte[] bytes, int sequenceCount)
|
||||
{
|
||||
DataSection = 0x72;
|
||||
ProcessEmData = true;
|
||||
ProcessEmData = true;
|
||||
ProcessEmData = true;
|
||||
ProcessCcData = true;
|
||||
AdditionalData = true;
|
||||
|
||||
if (bytes.Length / 2 > 16)
|
||||
{
|
||||
@ -80,11 +80,14 @@ namespace Nikse.SubtitleEdit.Core.Cea708
|
||||
}
|
||||
else if (i == 2)
|
||||
{
|
||||
var rollingSequence = sequenceCount % 4; // rolling sequence 0-3
|
||||
var ccContentLength = bytes.Length / 2 + 2;
|
||||
var x = (byte)((rollingSequence << 6) + ccContentLength);
|
||||
CcData[i] = new CcData
|
||||
{
|
||||
Valid = true,
|
||||
Type = 3,
|
||||
Data1 = 0x0b,
|
||||
Data1 = (byte)x,
|
||||
Data2 = 0x33,
|
||||
};
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ namespace Nikse.SubtitleEdit.Core.Cea708
|
||||
CaptionDistributionPacketHeaderSequenceCounter = sequenceCount;
|
||||
CaptionDistributionPacketHeaderSequenceCounter2 = sequenceCount;
|
||||
|
||||
CcDataSectionCcData = new CcDataSection(ccDataCount, bytes);
|
||||
CcDataSectionCcData = new CcDataSection(ccDataCount, bytes, sequenceCount);
|
||||
CcServiceInfoSection = new CcServiceInfoSection();
|
||||
}
|
||||
|
||||
|
@ -32,10 +32,6 @@ namespace Nikse.SubtitleEdit.Core.Cea708
|
||||
{
|
||||
var bytes = new List<byte>();
|
||||
var smpte291M = new Smpte291M(counter, 20, bytes.ToArray());
|
||||
smpte291M.CcDataSectionCcData.CcData[2].Valid = false;
|
||||
smpte291M.CcDataSectionCcData.CcData[2].Type = 2;
|
||||
smpte291M.CcDataSectionCcData.CcData[2].Data1 = 0;
|
||||
smpte291M.CcDataSectionCcData.CcData[2].Data2 = 0;
|
||||
var resultBytes = smpte291M.GetBytes();
|
||||
var hex = ByteArrayToHexString(resultBytes);
|
||||
return hex;
|
||||
|
Loading…
Reference in New Issue
Block a user