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" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
14 #include "media/base/media_log.h" | 14 #include "media/base/media_log.h" |
15 #include "media/base/stream_parser.h" | 15 #include "media/base/stream_parser.h" |
16 #include "media/filters/chunk_demuxer.h" | 16 #include "media/filters/chunk_demuxer.h" |
17 | 17 |
18 namespace media { | 18 namespace media { |
19 | 19 |
20 class MseTrackBuffer; | 20 class MseTrackBuffer; |
21 | 21 |
22 // Helper class that implements Media Source Extension's coded frame processing | 22 // Helper class that implements Media Source Extension's coded frame processing |
23 // algorithm. | 23 // algorithm. |
24 class MEDIA_EXPORT FrameProcessor { | 24 class MEDIA_EXPORT FrameProcessor { |
25 public: | 25 public: |
26 typedef base::Callback<void(base::TimeDelta)> UpdateDurationCB; | 26 typedef base::Callback<void(base::TimeDelta)> UpdateDurationCB; |
27 | 27 |
28 // TODO(wolenetz/acolwell): Ensure that all TrackIds are coherent and unique | |
29 // for each track buffer. For now, special track identifiers are used for each | |
30 // of audio and video here, and text TrackIds are assumed to be non-negative. | |
31 // See http://crbug.com/341581. | |
32 enum { | |
33 kAudioTrackId = -2, | |
34 kVideoTrackId = -3 | |
35 }; | |
36 | |
37 FrameProcessor(const UpdateDurationCB& update_duration_cb, | 28 FrameProcessor(const UpdateDurationCB& update_duration_cb, |
38 const scoped_refptr<MediaLog>& media_log); | 29 const scoped_refptr<MediaLog>& media_log); |
39 ~FrameProcessor(); | 30 ~FrameProcessor(); |
40 | 31 |
41 // Get/set the current append mode, which if true means "sequence" and if | 32 // Get/set the current append mode, which if true means "sequence" and if |
42 // false means "segments". | 33 // false means "segments". |
43 // See http://www.w3.org/TR/media-source/#widl-SourceBuffer-mode. | 34 // See http://www.w3.org/TR/media-source/#widl-SourceBuffer-mode. |
44 bool sequence_mode() { return sequence_mode_; } | 35 bool sequence_mode() { return sequence_mode_; } |
45 void SetSequenceMode(bool sequence_mode); | 36 void SetSequenceMode(bool sequence_mode); |
46 | 37 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // Counters that limit spam to |media_log_| for frame processor warnings. | 171 // Counters that limit spam to |media_log_| for frame processor warnings. |
181 int num_dropped_preroll_warnings_ = 0; | 172 int num_dropped_preroll_warnings_ = 0; |
182 int num_dts_beyond_pts_warnings_ = 0; | 173 int num_dts_beyond_pts_warnings_ = 0; |
183 | 174 |
184 DISALLOW_COPY_AND_ASSIGN(FrameProcessor); | 175 DISALLOW_COPY_AND_ASSIGN(FrameProcessor); |
185 }; | 176 }; |
186 | 177 |
187 } // namespace media | 178 } // namespace media |
188 | 179 |
189 #endif // MEDIA_FILTERS_FRAME_PROCESSOR_H_ | 180 #endif // MEDIA_FILTERS_FRAME_PROCESSOR_H_ |
OLD | NEW |