Add support for WebVTT cue identifier line

Modified the mkvmuxer to write the ChapterStringUID
sub-element of the Chapter Atom element.

Modified the mkvparser to read the ChapterStringUID
sub-element of the chapter atom.

Modified the vttdemux app to write the Cue Identifier
line of the WebVTT cue.

Change-Id: I06fe386f44897ada3fe10cbf89096df104dcf779
This commit is contained in:
Matthew Heaney
2012-11-13 12:44:06 -08:00
parent 0fcf5e5a40
commit 28222b4927
5 changed files with 58 additions and 5 deletions

View File

@@ -4514,6 +4514,18 @@ Chapters::Atom::~Atom()
}
unsigned long long Chapters::Atom::GetUID() const
{
return m_uid;
}
const char* Chapters::Atom::GetStringUID() const
{
return m_string_uid;
}
long long Chapters::Atom::GetStartTimecode() const
{
return m_start_timecode;
@@ -4558,6 +4570,7 @@ const Chapters::Display* Chapters::Atom::GetDisplay(int index) const
void Chapters::Atom::Init()
{
m_string_uid = NULL;
m_uid = 0;
m_start_timecode = -1;
m_stop_timecode = -1;
@@ -4570,6 +4583,7 @@ void Chapters::Atom::Init()
void Chapters::Atom::ShallowCopy(Atom& rhs) const
{
rhs.m_string_uid = m_string_uid;
rhs.m_uid = m_uid;
rhs.m_start_timecode = m_start_timecode;
rhs.m_stop_timecode = m_stop_timecode;
@@ -4582,6 +4596,9 @@ void Chapters::Atom::ShallowCopy(Atom& rhs) const
void Chapters::Atom::Clear()
{
delete[] m_string_uid;
m_string_uid = NULL;
while (m_displays_count > 0)
{
Display& d = m_displays[--m_displays_count];
@@ -4626,6 +4643,13 @@ long Chapters::Atom::Parse(
if (status < 0) // error
return status;
}
else if (id == 0x1654) // StringUID ID
{
status = UnserializeString(pReader, pos, size, m_string_uid);
if (status < 0) // error
return status;
}
else if (id == 0x33C4) // UID ID
{
const long long val = UnserializeUInt(pReader, pos, size);