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

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

Issue 1826583003: MSE: Record counts of detected MSE audio, video and text tracks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 const VideoDecoderConfig& video_decoder_config() { 71 const VideoDecoderConfig& video_decoder_config() {
72 return video_decoder_config_; 72 return video_decoder_config_;
73 } 73 }
74 74
75 typedef std::map<int, TextTrackConfig> TextTracks; 75 typedef std::map<int, TextTrackConfig> TextTracks;
76 76
77 const TextTracks& text_tracks() const { 77 const TextTracks& text_tracks() const {
78 return text_tracks_; 78 return text_tracks_;
79 } 79 }
80 80
81 int detected_audio_track_count() const { return detected_audio_track_count_; }
82
83 int detected_video_track_count() const { return detected_video_track_count_; }
84
85 int detected_text_track_count() const { return detected_text_track_count_; }
86
81 // Note: Calling media_tracks() method passes the ownership of the MediaTracks 87 // Note: Calling media_tracks() method passes the ownership of the MediaTracks
82 // object from WebMTracksParser to the caller (which is typically 88 // object from WebMTracksParser to the caller (which is typically
83 // WebMStreamParser object). So this method must be called only once, after 89 // WebMStreamParser object). So this method must be called only once, after
84 // track parsing has been completed. 90 // track parsing has been completed.
85 scoped_ptr<MediaTracks> media_tracks() { 91 scoped_ptr<MediaTracks> media_tracks() {
86 CHECK(media_tracks_.get()); 92 CHECK(media_tracks_.get());
87 return std::move(media_tracks_); 93 return std::move(media_tracks_);
88 } 94 }
89 95
90 private: 96 private:
91 // WebMParserClient implementation. 97 // WebMParserClient implementation.
92 WebMParserClient* OnListStart(int id) override; 98 WebMParserClient* OnListStart(int id) override;
93 bool OnListEnd(int id) override; 99 bool OnListEnd(int id) override;
94 bool OnUInt(int id, int64_t val) override; 100 bool OnUInt(int id, int64_t val) override;
95 bool OnFloat(int id, double val) override; 101 bool OnFloat(int id, double val) override;
96 bool OnBinary(int id, const uint8_t* data, int size) override; 102 bool OnBinary(int id, const uint8_t* data, int size) override;
97 bool OnString(int id, const std::string& str) override; 103 bool OnString(int id, const std::string& str) override;
98 104
99 int64_t track_type_; 105 int64_t track_type_ = -1;
100 int64_t track_num_; 106 int64_t track_num_ = -1;
101 std::string track_name_; 107 std::string track_name_;
102 std::string track_language_; 108 std::string track_language_;
103 std::string codec_id_; 109 std::string codec_id_;
104 std::vector<uint8_t> codec_private_; 110 std::vector<uint8_t> codec_private_;
105 int64_t seek_preroll_; 111 int64_t seek_preroll_ = -1;
106 int64_t codec_delay_; 112 int64_t codec_delay_ = -1;
107 int64_t default_duration_; 113 int64_t default_duration_ = -1;
108 scoped_ptr<WebMContentEncodingsClient> track_content_encodings_client_; 114 scoped_ptr<WebMContentEncodingsClient> track_content_encodings_client_;
109 115
110 int64_t audio_track_num_; 116 int64_t audio_track_num_ = -1;
111 int64_t audio_default_duration_; 117 int64_t audio_default_duration_ = -1;
112 int64_t video_track_num_; 118 int64_t video_track_num_ = -1;
113 int64_t video_default_duration_; 119 int64_t video_default_duration_ = -1;
114 bool ignore_text_tracks_; 120 bool ignore_text_tracks_;
115 TextTracks text_tracks_; 121 TextTracks text_tracks_;
116 std::set<int64_t> ignored_tracks_; 122 std::set<int64_t> ignored_tracks_;
117 std::string audio_encryption_key_id_; 123 std::string audio_encryption_key_id_;
118 std::string video_encryption_key_id_; 124 std::string video_encryption_key_id_;
119 scoped_refptr<MediaLog> media_log_; 125 scoped_refptr<MediaLog> media_log_;
120 126
121 WebMAudioClient audio_client_; 127 WebMAudioClient audio_client_;
122 AudioDecoderConfig audio_decoder_config_; 128 AudioDecoderConfig audio_decoder_config_;
123 129
124 WebMVideoClient video_client_; 130 WebMVideoClient video_client_;
125 VideoDecoderConfig video_decoder_config_; 131 VideoDecoderConfig video_decoder_config_;
126 132
133 int detected_audio_track_count_ = 0;
134 int detected_video_track_count_ = 0;
135 int detected_text_track_count_ = 0;
127 scoped_ptr<MediaTracks> media_tracks_; 136 scoped_ptr<MediaTracks> media_tracks_;
128 137
129 DISALLOW_COPY_AND_ASSIGN(WebMTracksParser); 138 DISALLOW_COPY_AND_ASSIGN(WebMTracksParser);
130 }; 139 };
131 140
132 } // namespace media 141 } // namespace media
133 142
134 #endif // MEDIA_FORMATS_WEBM_WEBM_TRACKS_PARSER_H_ 143 #endif // MEDIA_FORMATS_WEBM_WEBM_TRACKS_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698