Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: media/filters/frame_processor.h

Issue 2460763002: Fixed track id remapping in MSE FrameProcessor (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/filters/frame_processor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/frame_processor.h
diff --git a/media/filters/frame_processor.h b/media/filters/frame_processor.h
index 69a313efaff36dc144cf03f4b11eb5623fdc8163..dd28bad83d0d4a5cc156154e7a6f146132a56175 100644
--- a/media/filters/frame_processor.h
+++ b/media/filters/frame_processor.h
@@ -58,12 +58,15 @@ class MEDIA_EXPORT FrameProcessor {
// frames for the track |id| to |stream|.
bool AddTrack(StreamParser::TrackId id, ChunkDemuxerStream* stream);
- // Updates the internal mapping of TrackId to track buffer for the track
- // buffer formerly associated with |old_id| to be associated with |new_id|.
- // Returns false to indicate failure due to either no existing track buffer
- // for |old_id| or collision with previous track buffer already mapped to
- // |new_id|. Otherwise returns true.
- bool UpdateTrack(StreamParser::TrackId old_id, StreamParser::TrackId new_id);
+ // A map that describes how track ids changed between init segment. Maps the
+ // old track id for a new track id for the same track.
+ using TrackIdChanges = std::map<StreamParser::TrackId, StreamParser::TrackId>;
+
+ // Updates the internal mapping of TrackIds to track buffers. The input
+ // parameter |track_id_changes| maps old track ids to new ones. The track ids
+ // not present in the map must be assumed unchanged. Returns false if
+ // remapping failed.
+ bool UpdateTrackIds(const TrackIdChanges& track_id_changes);
// Sets the need random access point flag on all track buffers to true.
void SetAllTrackBuffersNeedRandomAccessPoint();
@@ -123,8 +126,9 @@ class MEDIA_EXPORT FrameProcessor {
base::TimeDelta* timestamp_offset);
// TrackId-indexed map of each track's stream.
- std::map<StreamParser::TrackId, std::unique_ptr<MseTrackBuffer>>
- track_buffers_;
+ using TrackBuffersMap =
+ std::map<StreamParser::TrackId, std::unique_ptr<MseTrackBuffer>>;
+ TrackBuffersMap track_buffers_;
// The last audio buffer seen by the frame processor that was removed because
// it was entirely before the start of the append window.
« no previous file with comments | « no previous file | media/filters/frame_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698