OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_FILTERS_FRAME_PROCESSOR_H_ | 5 #ifndef MEDIA_FILTERS_FRAME_PROCESSOR_H_ |
6 #define MEDIA_FILTERS_FRAME_PROCESSOR_H_ | 6 #define MEDIA_FILTERS_FRAME_PROCESSOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 FrameProcessor(const UpdateDurationCB& update_duration_cb, | 37 FrameProcessor(const UpdateDurationCB& update_duration_cb, |
38 const scoped_refptr<MediaLog>& media_log); | 38 const scoped_refptr<MediaLog>& media_log); |
39 ~FrameProcessor(); | 39 ~FrameProcessor(); |
40 | 40 |
41 // Get/set the current append mode, which if true means "sequence" and if | 41 // Get/set the current append mode, which if true means "sequence" and if |
42 // false means "segments". | 42 // false means "segments". |
43 // See http://www.w3.org/TR/media-source/#widl-SourceBuffer-mode. | 43 // See http://www.w3.org/TR/media-source/#widl-SourceBuffer-mode. |
44 bool sequence_mode() { return sequence_mode_; } | 44 bool sequence_mode() { return sequence_mode_; } |
45 void SetSequenceMode(bool sequence_mode); | 45 void SetSequenceMode(bool sequence_mode); |
46 | 46 |
47 // Processes buffers in |audio_buffers|, |video_buffers|, and |text_map|. | 47 // Processes buffers in |buffer_queue_map|. |
48 // Returns true on success or false on failure which indicates decode error. | 48 // Returns true on success or false on failure which indicates decode error. |
49 // |append_window_start| and |append_window_end| correspond to the MSE spec's | 49 // |append_window_start| and |append_window_end| correspond to the MSE spec's |
50 // similarly named source buffer attributes that are used in coded frame | 50 // similarly named source buffer attributes that are used in coded frame |
51 // processing. | 51 // processing. |
52 // Uses |*timestamp_offset| according to the coded frame processing algorithm, | 52 // Uses |*timestamp_offset| according to the coded frame processing algorithm, |
53 // including updating it as required in 'sequence' mode frame processing. | 53 // including updating it as required in 'sequence' mode frame processing. |
54 bool ProcessFrames(const StreamParser::BufferQueue& audio_buffers, | 54 bool ProcessFrames(const StreamParser::BufferQueueMap& buffer_queue_map, |
55 const StreamParser::BufferQueue& video_buffers, | |
56 const StreamParser::TextBufferQueueMap& text_map, | |
57 base::TimeDelta append_window_start, | 55 base::TimeDelta append_window_start, |
58 base::TimeDelta append_window_end, | 56 base::TimeDelta append_window_end, |
59 base::TimeDelta* timestamp_offset); | 57 base::TimeDelta* timestamp_offset); |
60 | 58 |
61 // Signals the frame processor to update its group start timestamp to be | 59 // Signals the frame processor to update its group start timestamp to be |
62 // |timestamp_offset| if it is in sequence append mode. | 60 // |timestamp_offset| if it is in sequence append mode. |
63 void SetGroupStartTimestampIfInSequenceMode(base::TimeDelta timestamp_offset); | 61 void SetGroupStartTimestampIfInSequenceMode(base::TimeDelta timestamp_offset); |
64 | 62 |
65 // Adds a new track with unique track ID |id|. | 63 // Adds a new track with unique track ID |id|. |
66 // If |id| has previously been added, returns false to indicate error. | 64 // If |id| has previously been added, returns false to indicate error. |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // Counters that limit spam to |media_log_| for frame processor warnings. | 180 // Counters that limit spam to |media_log_| for frame processor warnings. |
183 int num_dropped_preroll_warnings_ = 0; | 181 int num_dropped_preroll_warnings_ = 0; |
184 int num_dts_beyond_pts_warnings_ = 0; | 182 int num_dts_beyond_pts_warnings_ = 0; |
185 | 183 |
186 DISALLOW_COPY_AND_ASSIGN(FrameProcessor); | 184 DISALLOW_COPY_AND_ASSIGN(FrameProcessor); |
187 }; | 185 }; |
188 | 186 |
189 } // namespace media | 187 } // namespace media |
190 | 188 |
191 #endif // MEDIA_FILTERS_FRAME_PROCESSOR_H_ | 189 #endif // MEDIA_FILTERS_FRAME_PROCESSOR_H_ |
OLD | NEW |