Beispiel #1
0
void SampleMap::addSample(MediaSample& sample)
{
    MediaTime presentationTime = sample.presentationTime();

    presentationOrder().m_samples.insert(PresentationOrderSampleMap::MapType::value_type(presentationTime, &sample));

    auto decodeKey = DecodeOrderSampleMap::KeyType(sample.decodeTime(), presentationTime);
    decodeOrder().m_samples.insert(DecodeOrderSampleMap::MapType::value_type(decodeKey, &sample));

    m_totalSize += sample.sizeInBytes();
}
Beispiel #2
0
void SampleMap::removeSample(MediaSample* sample)
{
    ASSERT(sample);
    MediaTime presentationTime = sample->presentationTime();

    presentationOrder().m_samples.erase(presentationTime);

    auto decodeKey = DecodeOrderSampleMap::KeyType(sample->decodeTime(), presentationTime);
    decodeOrder().m_samples.erase(decodeKey);

    m_totalSize -= sample->sizeInBytes();
}
Beispiel #3
0
void SampleMap::addSample(PassRefPtr<MediaSample> prpSample)
{
    RefPtr<MediaSample> sample = prpSample;
    ASSERT(sample);

    MediaTime presentationTime = sample->presentationTime();

    presentationOrder().m_samples.insert(PresentationOrderSampleMap::MapType::value_type(presentationTime, sample));

    auto decodeKey = DecodeOrderSampleMap::KeyType(sample->decodeTime(), presentationTime);
    decodeOrder().m_samples.insert(DecodeOrderSampleMap::MapType::value_type(decodeKey, sample));

    m_totalSize += sample->sizeInBytes();
}
Beispiel #4
0
void SampleMap::clear()
{
    presentationOrder().m_samples.clear();
    decodeOrder().m_samples.clear();
    m_totalSize = 0;
}