| 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 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "media/base/media_export.h" | 14 #include "media/base/media_export.h" |
| 15 #include "media/base/media_log.h" | 15 #include "media/base/media_log.h" |
| 16 #include "media/base/stream_parser.h" | 16 #include "media/base/stream_parser.h" |
| 17 #include "media/filters/chunk_demuxer.h" | 17 #include "media/filters/chunk_demuxer.h" |
| 18 | 18 |
| 19 namespace media { | 19 namespace media { |
| 20 | 20 |
| 21 class MseTrackBuffer; | 21 class MseTrackBuffer; |
| 22 | 22 |
| 23 // Helper class that implements Media Source Extension's coded frame processing | 23 // Helper class that implements Media Source Extension's coded frame processing |
| 24 // algorithm. | 24 // algorithm. |
| 25 class MEDIA_EXPORT FrameProcessor { | 25 class MEDIA_EXPORT FrameProcessor { |
| 26 public: | 26 public: |
| 27 typedef base::Callback<void(base::TimeDelta)> UpdateDurationCB; | 27 typedef base::Callback<void(base::TimeDelta)> UpdateDurationCB; |
| 28 | 28 |
| 29 FrameProcessor(const UpdateDurationCB& update_duration_cb, | 29 FrameProcessor(const UpdateDurationCB& update_duration_cb, |
| 30 const scoped_refptr<MediaLog>& media_log); | 30 MediaLog* media_log); |
| 31 ~FrameProcessor(); | 31 ~FrameProcessor(); |
| 32 | 32 |
| 33 // Get/set the current append mode, which if true means "sequence" and if | 33 // Get/set the current append mode, which if true means "sequence" and if |
| 34 // false means "segments". | 34 // false means "segments". |
| 35 // See http://www.w3.org/TR/media-source/#widl-SourceBuffer-mode. | 35 // See http://www.w3.org/TR/media-source/#widl-SourceBuffer-mode. |
| 36 bool sequence_mode() { return sequence_mode_; } | 36 bool sequence_mode() { return sequence_mode_; } |
| 37 void SetSequenceMode(bool sequence_mode); | 37 void SetSequenceMode(bool sequence_mode); |
| 38 | 38 |
| 39 // Processes buffers in |buffer_queue_map|. | 39 // Processes buffers in |buffer_queue_map|. |
| 40 // Returns true on success or false on failure which indicates decode error. | 40 // Returns true on success or false on failure which indicates decode error. |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 163 |
| 164 // Tracks the MSE coded frame processing variable of same name. It stores the | 164 // Tracks the MSE coded frame processing variable of same name. It stores the |
| 165 // highest coded frame end timestamp across all coded frames in the current | 165 // highest coded frame end timestamp across all coded frames in the current |
| 166 // coded frame group. It is set to 0 when the SourceBuffer object is created | 166 // coded frame group. It is set to 0 when the SourceBuffer object is created |
| 167 // and gets updated by ProcessFrames(). | 167 // and gets updated by ProcessFrames(). |
| 168 base::TimeDelta group_end_timestamp_; | 168 base::TimeDelta group_end_timestamp_; |
| 169 | 169 |
| 170 UpdateDurationCB update_duration_cb_; | 170 UpdateDurationCB update_duration_cb_; |
| 171 | 171 |
| 172 // MediaLog for reporting messages and properties to debug content and engine. | 172 // MediaLog for reporting messages and properties to debug content and engine. |
| 173 scoped_refptr<MediaLog> media_log_; | 173 MediaLog* media_log_; |
| 174 | 174 |
| 175 // Counters that limit spam to |media_log_| for frame processor warnings. | 175 // Counters that limit spam to |media_log_| for frame processor warnings. |
| 176 int num_dropped_preroll_warnings_ = 0; | 176 int num_dropped_preroll_warnings_ = 0; |
| 177 int num_dts_beyond_pts_warnings_ = 0; | 177 int num_dts_beyond_pts_warnings_ = 0; |
| 178 | 178 |
| 179 DISALLOW_COPY_AND_ASSIGN(FrameProcessor); | 179 DISALLOW_COPY_AND_ASSIGN(FrameProcessor); |
| 180 }; | 180 }; |
| 181 | 181 |
| 182 } // namespace media | 182 } // namespace media |
| 183 | 183 |
| 184 #endif // MEDIA_FILTERS_FRAME_PROCESSOR_H_ | 184 #endif // MEDIA_FILTERS_FRAME_PROCESSOR_H_ |
| OLD | NEW |