class FFmpegURLProtocol;
class SourceState;
-class ChunkDemuxerStream : public DemuxerStream {
+class MEDIA_EXPORT ChunkDemuxerStream : public DemuxerStream {
public:
typedef std::deque<scoped_refptr<StreamParserBuffer> > BufferQueue;
// Signal to the stream that buffers handed in through subsequent calls to
// Append() belong to a media segment that starts at |start_timestamp|.
- void OnNewMediaSegment(base::TimeDelta start_timestamp);
+ void OnNewMediaSegment(DecodeTimestamp start_timestamp);
// Called when midstream config updates occur.
// Returns true if the new config is accepted.
virtual AudioDecoderConfig audio_decoder_config() OVERRIDE;
virtual VideoDecoderConfig video_decoder_config() OVERRIDE;
virtual bool SupportsConfigChanges() OVERRIDE;
+ virtual VideoRotation video_rotation() OVERRIDE;
// Returns the text track configuration. It is an error to call this method
// if type() != TEXT.
stream_->set_memory_limit_for_testing(memory_limit);
}
+ bool supports_partial_append_window_trimming() const {
+ return partial_append_window_trimming_enabled_;
+ }
+
private:
enum State {
UNINITIALIZED,
mutable base::Lock lock_;
State state_;
ReadCB read_cb_;
- const bool splice_frames_enabled_;
+ bool splice_frames_enabled_;
+ bool partial_append_window_trimming_enabled_;
DISALLOW_IMPLICIT_CONSTRUCTORS(ChunkDemuxerStream);
};
bool enable_text_tracks) OVERRIDE;
virtual void Stop(const base::Closure& callback) OVERRIDE;
virtual void Seek(base::TimeDelta time, const PipelineStatusCB& cb) OVERRIDE;
- virtual void OnAudioRendererDisabled() OVERRIDE;
virtual DemuxerStream* GetStream(DemuxerStream::Type type) OVERRIDE;
- virtual base::TimeDelta GetStartTime() const OVERRIDE;
+ virtual base::Time GetTimelineOffset() const OVERRIDE;
+ virtual Liveness GetLiveness() const OVERRIDE;
// Methods used by an external object to control this demuxer.
//
// Aborts parsing the current segment and reset the parser to a state where
// it can accept a new segment.
- void Abort(const std::string& id);
+ // Some pending frames can be emitted during that process. These frames are
+ // applied |timestamp_offset|.
+ void Abort(const std::string& id,
+ base::TimeDelta append_window_start,
+ base::TimeDelta append_window_end,
+ base::TimeDelta* timestamp_offset);
// Remove buffers between |start| and |end| for the source buffer
// associated with |id|.
// mode.
void SetSequenceMode(const std::string& id, bool sequence_mode);
+ // Signals the coded frame processor for the source buffer associated with
+ // |id| to update its group start timestamp to be |timestamp_offset| if it is
+ // in sequence append mode.
+ void SetGroupStartTimestampIfInSequenceMode(const std::string& id,
+ base::TimeDelta timestamp_offset);
+
// Called to signal changes in the "end of stream"
// state. UnmarkEndOfStream() must not be called if a matching
// MarkEndOfStream() has not come before it.
bool CanEndOfStream_Locked() const;
// SourceState callbacks.
- void OnSourceInitDone(bool success, base::TimeDelta duration);
+ void OnSourceInitDone(bool success,
+ const StreamParser::InitParameters& params);
// Creates a DemuxerStream for the specified |type|.
// Returns a new ChunkDemuxerStream instance if a stream of this type
void OnNewTextTrack(ChunkDemuxerStream* text_stream,
const TextTrackConfig& config);
- void OnNewMediaSegment(const std::string& source_id,
- base::TimeDelta start_timestamp);
// Returns true if |source_id| is valid, false otherwise.
bool IsValidId(const std::string& source_id) const;
- // Increases |duration_| if |last_appended_buffer_timestamp| exceeds the
- // current |duration_|. The |duration_| is set to the end buffered timestamp
- // of |stream|.
- void IncreaseDurationIfNecessary(
- base::TimeDelta last_appended_buffer_timestamp,
- ChunkDemuxerStream* stream);
+ // Increases |duration_| to |new_duration|, if |new_duration| is higher.
+ void IncreaseDurationIfNecessary(base::TimeDelta new_duration);
// Decreases |duration_| if the buffered region is less than |duration_| when
// EndOfStream() is called.
scoped_ptr<ChunkDemuxerStream> audio_;
scoped_ptr<ChunkDemuxerStream> video_;
- // Keeps |audio_| alive when audio has been disabled.
- scoped_ptr<ChunkDemuxerStream> disabled_audio_;
-
base::TimeDelta duration_;
// The duration passed to the last SetDuration(). If
// the actual duration instead of a user specified value.
double user_specified_duration_;
+ base::Time timeline_offset_;
+ Liveness liveness_;
+
typedef std::map<std::string, SourceState*> SourceStateMap;
SourceStateMap source_state_map_;