| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 AudioDecoderConfig current_audio_config_; | 145 AudioDecoderConfig current_audio_config_; |
| 146 base::TimeDelta sample_duration_; | 146 base::TimeDelta sample_duration_; |
| 147 | 147 |
| 148 // The AppendMode of the associated SourceBuffer. | 148 // The AppendMode of the associated SourceBuffer. |
| 149 // See SetSequenceMode() for interpretation of |sequence_mode_|. | 149 // See SetSequenceMode() for interpretation of |sequence_mode_|. |
| 150 // Per http://www.w3.org/TR/media-source/#widl-SourceBuffer-mode: | 150 // Per http://www.w3.org/TR/media-source/#widl-SourceBuffer-mode: |
| 151 // Controls how a sequence of media segments are handled. This is initially | 151 // Controls how a sequence of media segments are handled. This is initially |
| 152 // set to false ("segments"). | 152 // set to false ("segments"). |
| 153 bool sequence_mode_ = false; | 153 bool sequence_mode_ = false; |
| 154 | 154 |
| 155 // Flag to track whether or not the next processed frame is a continuation of | 155 // Tracks whether or not the next processed frame is a continuation of a coded |
| 156 // a coded frame group. This flag resets to false upon detection of | 156 // frame group (see https://w3c.github.io/media-source/#coded-frame-group). |
| 157 // discontinuity, and becomes true once a processed coded frame for the | 157 // Resets to kNoDecodeTimestamp() upon detection of 'segments' mode |
| 158 // current coded frame group is sent to its track buffer. | 158 // discontinuity, parser reset during 'segments' mode, or switching from |
| 159 bool in_coded_frame_group_ = false; | 159 // 'sequence' to 'segments' mode. |
| 160 // Once a processed coded frame is emitted for the current coded frame group, |
| 161 // tracks the decode timestamp of the last frame emitted. |
| 162 // Explicit setting of timestampOffset will trigger subsequent notification of |
| 163 // a new coded frame start to the tracks' streams, even in 'sequence' mode, if |
| 164 // the resulting frame has a DTS less than this. |
| 165 DecodeTimestamp coded_frame_group_last_dts_ = kNoDecodeTimestamp(); |
| 160 | 166 |
| 161 // Tracks the MSE coded frame processing variable of same name. | 167 // Tracks the MSE coded frame processing variable of same name. |
| 162 // Initially kNoTimestamp(), meaning "unset". | 168 // Initially kNoTimestamp(), meaning "unset". |
| 163 base::TimeDelta group_start_timestamp_; | 169 base::TimeDelta group_start_timestamp_; |
| 164 | 170 |
| 165 // Tracks the MSE coded frame processing variable of same name. It stores the | 171 // Tracks the MSE coded frame processing variable of same name. It stores the |
| 166 // highest coded frame end timestamp across all coded frames in the current | 172 // highest coded frame end timestamp across all coded frames in the current |
| 167 // coded frame group. It is set to 0 when the SourceBuffer object is created | 173 // coded frame group. It is set to 0 when the SourceBuffer object is created |
| 168 // and gets updated by ProcessFrames(). | 174 // and gets updated by ProcessFrames(). |
| 169 base::TimeDelta group_end_timestamp_; | 175 base::TimeDelta group_end_timestamp_; |
| 170 | 176 |
| 171 UpdateDurationCB update_duration_cb_; | 177 UpdateDurationCB update_duration_cb_; |
| 172 | 178 |
| 173 // MediaLog for reporting messages and properties to debug content and engine. | 179 // MediaLog for reporting messages and properties to debug content and engine. |
| 174 scoped_refptr<MediaLog> media_log_; | 180 scoped_refptr<MediaLog> media_log_; |
| 175 | 181 |
| 176 // Counters that limit spam to |media_log_| for frame processor warnings. | 182 // Counters that limit spam to |media_log_| for frame processor warnings. |
| 177 int num_dropped_preroll_warnings_ = 0; | 183 int num_dropped_preroll_warnings_ = 0; |
| 178 int num_dts_beyond_pts_warnings_ = 0; | 184 int num_dts_beyond_pts_warnings_ = 0; |
| 179 | 185 |
| 180 DISALLOW_COPY_AND_ASSIGN(FrameProcessor); | 186 DISALLOW_COPY_AND_ASSIGN(FrameProcessor); |
| 181 }; | 187 }; |
| 182 | 188 |
| 183 } // namespace media | 189 } // namespace media |
| 184 | 190 |
| 185 #endif // MEDIA_FILTERS_FRAME_PROCESSOR_H_ | 191 #endif // MEDIA_FILTERS_FRAME_PROCESSOR_H_ |
| OLD | NEW |