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

Side by Side Diff: media/formats/webm/webm_tracks_parser.h

Issue 1842503002: MSE: Cleanup WebM tracks parser initialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Future-proof with conditional re-Reset() Created 4 years, 8 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 | « no previous file | media/formats/webm/webm_tracks_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_WEBM_WEBM_TRACKS_PARSER_H_ 5 #ifndef MEDIA_FORMATS_WEBM_WEBM_TRACKS_PARSER_H_
6 #define MEDIA_FORMATS_WEBM_WEBM_TRACKS_PARSER_H_ 6 #define MEDIA_FORMATS_WEBM_WEBM_TRACKS_PARSER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // Note: Calling media_tracks() method passes the ownership of the MediaTracks 81 // Note: Calling media_tracks() method passes the ownership of the MediaTracks
82 // object from WebMTracksParser to the caller (which is typically 82 // object from WebMTracksParser to the caller (which is typically
83 // WebMStreamParser object). So this method must be called only once, after 83 // WebMStreamParser object). So this method must be called only once, after
84 // track parsing has been completed. 84 // track parsing has been completed.
85 scoped_ptr<MediaTracks> media_tracks() { 85 scoped_ptr<MediaTracks> media_tracks() {
86 CHECK(media_tracks_.get()); 86 CHECK(media_tracks_.get());
87 return std::move(media_tracks_); 87 return std::move(media_tracks_);
88 } 88 }
89 89
90 private: 90 private:
91 void Reset();
92 void ResetTrackEntry();
93
91 // WebMParserClient implementation. 94 // WebMParserClient implementation.
92 WebMParserClient* OnListStart(int id) override; 95 WebMParserClient* OnListStart(int id) override;
93 bool OnListEnd(int id) override; 96 bool OnListEnd(int id) override;
94 bool OnUInt(int id, int64_t val) override; 97 bool OnUInt(int id, int64_t val) override;
95 bool OnFloat(int id, double val) override; 98 bool OnFloat(int id, double val) override;
96 bool OnBinary(int id, const uint8_t* data, int size) override; 99 bool OnBinary(int id, const uint8_t* data, int size) override;
97 bool OnString(int id, const std::string& str) override; 100 bool OnString(int id, const std::string& str) override;
98 101
102 bool reset_on_next_parse_;
99 int64_t track_type_; 103 int64_t track_type_;
100 int64_t track_num_; 104 int64_t track_num_;
101 std::string track_name_; 105 std::string track_name_;
102 std::string track_language_; 106 std::string track_language_;
103 std::string codec_id_; 107 std::string codec_id_;
104 std::vector<uint8_t> codec_private_; 108 std::vector<uint8_t> codec_private_;
105 int64_t seek_preroll_; 109 int64_t seek_preroll_;
106 int64_t codec_delay_; 110 int64_t codec_delay_;
107 int64_t default_duration_; 111 int64_t default_duration_;
108 scoped_ptr<WebMContentEncodingsClient> track_content_encodings_client_; 112 scoped_ptr<WebMContentEncodingsClient> track_content_encodings_client_;
(...skipping 16 matching lines...) Expand all
125 VideoDecoderConfig video_decoder_config_; 129 VideoDecoderConfig video_decoder_config_;
126 130
127 scoped_ptr<MediaTracks> media_tracks_; 131 scoped_ptr<MediaTracks> media_tracks_;
128 132
129 DISALLOW_COPY_AND_ASSIGN(WebMTracksParser); 133 DISALLOW_COPY_AND_ASSIGN(WebMTracksParser);
130 }; 134 };
131 135
132 } // namespace media 136 } // namespace media
133 137
134 #endif // MEDIA_FORMATS_WEBM_WEBM_TRACKS_PARSER_H_ 138 #endif // MEDIA_FORMATS_WEBM_WEBM_TRACKS_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | media/formats/webm/webm_tracks_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698