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

Side by Side Diff: media/formats/mp4/mp4_stream_parser.h

Issue 1235793005: Deprecate LogCB in favor of using MediaLog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments and attempt to fix Android compilation Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « media/formats/mp4/box_reader_unittest.cc ('k') | media/formats/mp4/mp4_stream_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_FORMATS_MP4_MP4_STREAM_PARSER_H_ 5 #ifndef MEDIA_FORMATS_MP4_MP4_STREAM_PARSER_H_
6 #define MEDIA_FORMATS_MP4_MP4_STREAM_PARSER_H_ 6 #define MEDIA_FORMATS_MP4_MP4_STREAM_PARSER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 10 matching lines...) Expand all
21 namespace mp4 { 21 namespace mp4 {
22 22
23 struct Movie; 23 struct Movie;
24 class BoxReader; 24 class BoxReader;
25 25
26 class MEDIA_EXPORT MP4StreamParser : public StreamParser { 26 class MEDIA_EXPORT MP4StreamParser : public StreamParser {
27 public: 27 public:
28 MP4StreamParser(const std::set<int>& audio_object_types, bool has_sbr); 28 MP4StreamParser(const std::set<int>& audio_object_types, bool has_sbr);
29 ~MP4StreamParser() override; 29 ~MP4StreamParser() override;
30 30
31 void Init( 31 void Init(const InitCB& init_cb,
32 const InitCB& init_cb, 32 const NewConfigCB& config_cb,
33 const NewConfigCB& config_cb, 33 const NewBuffersCB& new_buffers_cb,
34 const NewBuffersCB& new_buffers_cb, 34 bool ignore_text_tracks,
35 bool ignore_text_tracks, 35 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb,
36 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, 36 const NewMediaSegmentCB& new_segment_cb,
37 const NewMediaSegmentCB& new_segment_cb, 37 const base::Closure& end_of_segment_cb,
38 const base::Closure& end_of_segment_cb, 38 const scoped_refptr<MediaLog>& media_log) override;
39 const LogCB& log_cb) override;
40 void Flush() override; 39 void Flush() override;
41 bool Parse(const uint8* buf, int size) override; 40 bool Parse(const uint8* buf, int size) override;
42 41
43 private: 42 private:
44 enum State { 43 enum State {
45 kWaitingForInit, 44 kWaitingForInit,
46 kParsingBoxes, 45 kParsingBoxes,
47 kWaitingForSampleData, 46 kWaitingForSampleData,
48 kEmittingSamples, 47 kEmittingSamples,
49 kError 48 kError
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // computed. 91 // computed.
93 bool ComputeHighestEndOffset(const MovieFragment& moof); 92 bool ComputeHighestEndOffset(const MovieFragment& moof);
94 93
95 State state_; 94 State state_;
96 InitCB init_cb_; 95 InitCB init_cb_;
97 NewConfigCB config_cb_; 96 NewConfigCB config_cb_;
98 NewBuffersCB new_buffers_cb_; 97 NewBuffersCB new_buffers_cb_;
99 EncryptedMediaInitDataCB encrypted_media_init_data_cb_; 98 EncryptedMediaInitDataCB encrypted_media_init_data_cb_;
100 NewMediaSegmentCB new_segment_cb_; 99 NewMediaSegmentCB new_segment_cb_;
101 base::Closure end_of_segment_cb_; 100 base::Closure end_of_segment_cb_;
102 LogCB log_cb_; 101 scoped_refptr<MediaLog> media_log_;
103 102
104 OffsetByteQueue queue_; 103 OffsetByteQueue queue_;
105 104
106 // These two parameters are only valid in the |kEmittingSegments| state. 105 // These two parameters are only valid in the |kEmittingSegments| state.
107 // 106 //
108 // |moof_head_| is the offset of the start of the most recently parsed moof 107 // |moof_head_| is the offset of the start of the most recently parsed moof
109 // block. All byte offsets in sample information are relative to this offset, 108 // block. All byte offsets in sample information are relative to this offset,
110 // as mandated by the Media Source spec. 109 // as mandated by the Media Source spec.
111 int64 moof_head_; 110 int64 moof_head_;
112 // |mdat_tail_| is the stream offset of the end of the current 'mdat' box. 111 // |mdat_tail_| is the stream offset of the end of the current 'mdat' box.
(...skipping 22 matching lines...) Expand all
135 // prevent log spam. 134 // prevent log spam.
136 int num_top_level_box_skipped_; 135 int num_top_level_box_skipped_;
137 136
138 DISALLOW_COPY_AND_ASSIGN(MP4StreamParser); 137 DISALLOW_COPY_AND_ASSIGN(MP4StreamParser);
139 }; 138 };
140 139
141 } // namespace mp4 140 } // namespace mp4
142 } // namespace media 141 } // namespace media
143 142
144 #endif // MEDIA_FORMATS_MP4_MP4_STREAM_PARSER_H_ 143 #endif // MEDIA_FORMATS_MP4_MP4_STREAM_PARSER_H_
OLDNEW
« no previous file with comments | « media/formats/mp4/box_reader_unittest.cc ('k') | media/formats/mp4/mp4_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698