libwebm: refactor BlockEntry class
Change-Id: I68d799d5b928de0ff7be293731ab73750c7cbb86
This commit is contained in:
101
mkvparser.cpp
101
mkvparser.cpp
@@ -5145,41 +5145,17 @@ long Track::GetNext(
|
||||
}
|
||||
|
||||
|
||||
Track::EOSBlock::EOSBlock()
|
||||
Track::EOSBlock::EOSBlock() : BlockEntry(NULL, LONG_MIN)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool Track::EOSBlock::EOS() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
const Cluster* Track::EOSBlock::GetCluster() const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
long Track::EOSBlock::GetIndex() const
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
const Block* Track::EOSBlock::GetBlock() const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
bool Track::EOSBlock::IsBFrame() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
VideoTrack::VideoTrack(
|
||||
Segment* pSegment,
|
||||
const Info& i,
|
||||
@@ -7996,7 +7972,9 @@ const BlockEntry* Cluster::GetMaxKey(const VideoTrack* pTrack) const
|
||||
#endif
|
||||
|
||||
|
||||
BlockEntry::BlockEntry()
|
||||
BlockEntry::BlockEntry(Cluster* p, long idx) :
|
||||
m_pCluster(p),
|
||||
m_index(idx)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -8006,33 +7984,35 @@ BlockEntry::~BlockEntry()
|
||||
}
|
||||
|
||||
|
||||
SimpleBlock::SimpleBlock(
|
||||
Cluster* pCluster,
|
||||
size_t idx,
|
||||
long long start,
|
||||
long long size) :
|
||||
m_pCluster(pCluster),
|
||||
m_index(idx),
|
||||
m_block(start, size, pCluster->m_pSegment->m_pReader)
|
||||
bool BlockEntry::EOS() const
|
||||
{
|
||||
return (m_index == LONG_MIN);
|
||||
}
|
||||
|
||||
|
||||
bool SimpleBlock::EOS() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
const Cluster* SimpleBlock::GetCluster() const
|
||||
const Cluster* BlockEntry::GetCluster() const
|
||||
{
|
||||
return m_pCluster;
|
||||
}
|
||||
|
||||
|
||||
long SimpleBlock::GetIndex() const
|
||||
long BlockEntry::GetIndex() const
|
||||
{
|
||||
if (m_index == LONG_MIN) //EOS
|
||||
return -1;
|
||||
|
||||
return labs(m_index);
|
||||
}
|
||||
|
||||
|
||||
SimpleBlock::SimpleBlock(
|
||||
Cluster* pCluster,
|
||||
long idx,
|
||||
long long start,
|
||||
long long size) :
|
||||
BlockEntry(pCluster, idx),
|
||||
m_block(start, size, pCluster->m_pSegment->m_pReader)
|
||||
{
|
||||
return m_index;
|
||||
}
|
||||
|
||||
|
||||
@@ -8042,19 +8022,12 @@ const Block* SimpleBlock::GetBlock() const
|
||||
}
|
||||
|
||||
|
||||
//bool SimpleBlock::IsBFrame() const
|
||||
//{
|
||||
// return false;
|
||||
//}
|
||||
|
||||
|
||||
BlockGroup::BlockGroup(
|
||||
Cluster* pCluster,
|
||||
size_t idx,
|
||||
long idx,
|
||||
long long start,
|
||||
long long size_) :
|
||||
m_pCluster(pCluster),
|
||||
m_index(idx),
|
||||
BlockEntry(pCluster, idx),
|
||||
m_prevTimeCode(0),
|
||||
m_nextTimeCode(0),
|
||||
m_pBlock(NULL) //TODO: accept multiple blocks within a block group
|
||||
@@ -8145,24 +8118,6 @@ void BlockGroup::ParseBlock(long long start, long long size)
|
||||
}
|
||||
|
||||
|
||||
bool BlockGroup::EOS() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
const Cluster* BlockGroup::GetCluster() const
|
||||
{
|
||||
return m_pCluster;
|
||||
}
|
||||
|
||||
|
||||
long BlockGroup::GetIndex() const
|
||||
{
|
||||
return m_index;
|
||||
}
|
||||
|
||||
|
||||
const Block* BlockGroup::GetBlock() const
|
||||
{
|
||||
return m_pBlock;
|
||||
@@ -8181,12 +8136,6 @@ short BlockGroup::GetNextTimeCode() const
|
||||
}
|
||||
|
||||
|
||||
//bool BlockGroup::IsBFrame() const
|
||||
//{
|
||||
// return (m_nextTimeCode > 0);
|
||||
//}
|
||||
|
||||
|
||||
Block::Block(long long start, long long size_, IMkvReader* pReader) :
|
||||
m_start(start),
|
||||
m_size(size_)
|
||||
|
||||
Reference in New Issue
Block a user