Index: media/formats/webm/webm_tracks_parser.h |
diff --git a/media/formats/webm/webm_tracks_parser.h b/media/formats/webm/webm_tracks_parser.h |
index 3569907274c6475dfb64b024f780c6c97d5e764e..6286b2303e0fa02280e246393fbf6bbc997f2c1c 100644 |
--- a/media/formats/webm/webm_tracks_parser.h |
+++ b/media/formats/webm/webm_tracks_parser.h |
@@ -18,6 +18,7 @@ |
#include "base/time/time.h" |
#include "media/base/audio_decoder_config.h" |
#include "media/base/media_log.h" |
+#include "media/base/media_tracks.h" |
#include "media/base/text_track_config.h" |
#include "media/base/video_decoder_config.h" |
#include "media/formats/webm/webm_audio_client.h" |
@@ -77,6 +78,15 @@ class MEDIA_EXPORT WebMTracksParser : public WebMParserClient { |
return text_tracks_; |
} |
+ // Note: Calling media_tracks() method passes the ownership of the MediaTracks |
+ // object from WebMTracksParser to the caller (which is typically |
+ // WebMStreamParser object). So this method must be called only once, after |
+ // track parsing has been completed. |
+ scoped_ptr<MediaTracks> media_tracks() { |
+ CHECK(media_tracks_.get()); |
+ return std::move(media_tracks_); |
+ } |
+ |
private: |
// WebMParserClient implementation. |
WebMParserClient* OnListStart(int id) override; |
@@ -114,6 +124,8 @@ class MEDIA_EXPORT WebMTracksParser : public WebMParserClient { |
WebMVideoClient video_client_; |
VideoDecoderConfig video_decoder_config_; |
+ scoped_ptr<MediaTracks> media_tracks_; |
+ |
DISALLOW_COPY_AND_ASSIGN(WebMTracksParser); |
}; |