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(); }
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(); }
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(); }
bool SampleMap::empty() const { return presentationOrder().m_samples.empty(); }
void SampleMap::clear() { presentationOrder().m_samples.clear(); decodeOrder().m_samples.clear(); m_totalSize = 0; }