// Copyright (c) 2016 The WebM project authors. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the LICENSE file in the root of the source // tree. An additional intellectual property rights grant can be found // in the file PATENTS. All contributing project authors may // be found in the AUTHORS file in the root of the source tree. #ifndef SRC_TRACK_ENTRY_PARSER_H_ #define SRC_TRACK_ENTRY_PARSER_H_ #include "src/audio_parser.h" #include "src/bool_parser.h" #include "src/byte_parser.h" #include "src/content_encodings_parser.h" #include "src/int_parser.h" #include "src/master_value_parser.h" #include "src/video_parser.h" #include "webm/dom_types.h" #include "webm/id.h" namespace webm { // Spec reference: // http://matroska.org/technical/specs/index.html#TrackEntry // http://www.webmproject.org/docs/container/#TrackEntry class TrackEntryParser : public MasterValueParser { public: TrackEntryParser() : MasterValueParser( MakeChild(Id::kTrackNumber, &TrackEntry::track_number), MakeChild(Id::kTrackUid, &TrackEntry::track_uid), MakeChild>(Id::kTrackType, &TrackEntry::track_type), MakeChild(Id::kFlagEnabled, &TrackEntry::is_enabled), MakeChild(Id::kFlagDefault, &TrackEntry::is_default), MakeChild(Id::kFlagForced, &TrackEntry::is_forced), MakeChild(Id::kFlagLacing, &TrackEntry::uses_lacing), MakeChild(Id::kDefaultDuration, &TrackEntry::default_duration), MakeChild(Id::kName, &TrackEntry::name), MakeChild(Id::kLanguage, &TrackEntry::language), MakeChild(Id::kCodecId, &TrackEntry::codec_id), MakeChild(Id::kCodecPrivate, &TrackEntry::codec_private), MakeChild(Id::kCodecName, &TrackEntry::codec_name), MakeChild(Id::kCodecDelay, &TrackEntry::codec_delay), MakeChild(Id::kSeekPreRoll, &TrackEntry::seek_pre_roll), MakeChild(Id::kVideo, &TrackEntry::video), MakeChild(Id::kAudio, &TrackEntry::audio), MakeChild( Id::kContentEncodings, &TrackEntry::content_encodings)) {} protected: Status OnParseCompleted(Callback* callback) override { return callback->OnTrackEntry(metadata(Id::kTrackEntry), value()); } }; } // namespace webm #endif // SRC_TRACK_ENTRY_PARSER_H_