#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/filters/source_buffer_range.h"
#include <algorithm>
#include <sstream>
#include <string>
#include "base/logging.h"
#include "base/not_fatal_until.h"
#include "media/base/stream_parser_buffer.h"
#include "media/base/timestamp_constants.h"
namespace media {
SourceBufferRange::SourceBufferRange(
GapPolicy gap_policy,
const BufferQueue& new_buffers,
base::TimeDelta range_start_pts,
InterbufferDistanceCB interbuffer_distance_cb)
: … { … }
SourceBufferRange::~SourceBufferRange() = default;
void SourceBufferRange::DeleteAll(BufferQueue* deleted_buffers) { … }
void SourceBufferRange::SeekToStart() { … }
bool SourceBufferRange::GetNextBuffer(
scoped_refptr<StreamParserBuffer>* out_buffer) { … }
bool SourceBufferRange::HasNextBuffer() const { … }
int SourceBufferRange::GetNextConfigId() const { … }
bool SourceBufferRange::HasNextBufferPosition() const { … }
void SourceBufferRange::ResetNextBufferPosition() { … }
void SourceBufferRange::AppendRangeToEnd(const SourceBufferRange& range,
bool transfer_current_position) { … }
bool SourceBufferRange::CanAppendRangeToEnd(
const SourceBufferRange& range) const { … }
void SourceBufferRange::AppendBuffersToEnd(
const BufferQueue& new_buffers,
base::TimeDelta new_buffers_group_start_pts) { … }
bool SourceBufferRange::AllowableAppendAfterEstimatedDuration(
const BufferQueue& buffers,
base::TimeDelta new_buffers_group_start_pts) const { … }
bool SourceBufferRange::CanAppendBuffersToEnd(
const BufferQueue& buffers,
base::TimeDelta new_buffers_group_start_pts) const { … }
void SourceBufferRange::Seek(base::TimeDelta timestamp) { … }
bool SourceBufferRange::CanSeekTo(base::TimeDelta timestamp) const { … }
int SourceBufferRange::GetConfigIdAtTime(base::TimeDelta timestamp) const { … }
bool SourceBufferRange::SameConfigThruRange(base::TimeDelta start,
base::TimeDelta end) const { … }
std::unique_ptr<SourceBufferRange> SourceBufferRange::SplitRange(
base::TimeDelta timestamp) { … }
bool SourceBufferRange::TruncateAt(base::TimeDelta timestamp,
BufferQueue* deleted_buffers,
bool is_exclusive) { … }
size_t SourceBufferRange::DeleteGOPFromFront(BufferQueue* deleted_buffers) { … }
size_t SourceBufferRange::DeleteGOPFromBack(BufferQueue* deleted_buffers) { … }
size_t SourceBufferRange::GetRemovalGOP(
base::TimeDelta start_timestamp,
base::TimeDelta end_timestamp,
size_t total_bytes_to_free,
base::TimeDelta* removal_end_timestamp) const { … }
bool SourceBufferRange::FirstGOPEarlierThanMediaTime(
base::TimeDelta media_time) const { … }
bool SourceBufferRange::FirstGOPContainsNextBufferPosition() const { … }
bool SourceBufferRange::LastGOPContainsNextBufferPosition() const { … }
base::TimeDelta SourceBufferRange::GetNextTimestamp() const { … }
base::TimeDelta SourceBufferRange::GetStartTimestamp() const { … }
base::TimeDelta SourceBufferRange::GetEndTimestamp() const { … }
base::TimeDelta SourceBufferRange::GetBufferedEndTimestamp() const { … }
bool SourceBufferRange::BelongsToRange(base::TimeDelta timestamp) const { … }
base::TimeDelta SourceBufferRange::FindHighestBufferedTimestampAtOrBefore(
base::TimeDelta timestamp) const { … }
base::TimeDelta SourceBufferRange::NextKeyframeTimestamp(
base::TimeDelta timestamp) const { … }
base::TimeDelta SourceBufferRange::KeyframeBeforeTimestamp(
base::TimeDelta timestamp) const { … }
bool SourceBufferRange::GetBuffersInRange(base::TimeDelta start,
base::TimeDelta end,
BufferQueue* buffers) const { … }
void SourceBufferRange::AdjustEstimatedDurationForNewAppend(
const BufferQueue& new_buffers) { … }
void SourceBufferRange::FreeBufferRange(
const BufferQueue::const_iterator& starting_point,
const BufferQueue::const_iterator& ending_point) { … }
base::TimeDelta SourceBufferRange::GetFudgeRoom() const { … }
base::TimeDelta SourceBufferRange::GetApproximateDuration() const { … }
void SourceBufferRange::UpdateEndTime(
scoped_refptr<StreamParserBuffer> new_buffer) { … }
bool SourceBufferRange::IsNextInPresentationSequence(
base::TimeDelta timestamp) const { … }
bool SourceBufferRange::IsNextInDecodeSequence(
DecodeTimestamp decode_timestamp) const { … }
base::TimeDelta SourceBufferRange::NextRangeStartTimeForAppendRangeToEnd(
const SourceBufferRange& range) const { … }
size_t SourceBufferRange::GetBufferIndexAt(base::TimeDelta timestamp,
bool skip_given_timestamp) const { … }
SourceBufferRange::BufferQueue::const_iterator
SourceBufferRange::GetBufferItrAt(base::TimeDelta timestamp,
bool skip_given_timestamp) const { … }
SourceBufferRange::KeyframeMap::const_iterator
SourceBufferRange::GetFirstKeyframeAt(base::TimeDelta timestamp,
bool skip_given_timestamp) const { … }
SourceBufferRange::KeyframeMap::const_iterator
SourceBufferRange::GetFirstKeyframeAtOrBefore(base::TimeDelta timestamp) const { … }
bool SourceBufferRange::TruncateAt(const size_t starting_point,
BufferQueue* deleted_buffers) { … }
void SourceBufferRange::UpdateEndTimeUsingLastGOP() { … }
std::string SourceBufferRange::ToStringForDebugging() const { … }
}