DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
seek_head.h
1 // Copyright 2015 Google Inc. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file or at
5 // https://developers.google.com/open-source/licenses/bsd
6 
7 #ifndef MEDIA_FORMATS_WEBM_SEEK_HEAD_H_
8 #define MEDIA_FORMATS_WEBM_SEEK_HEAD_H_
9 
10 #include <stdint.h>
11 #include <vector>
12 
13 #include "base/macros.h"
14 #include "packager/third_party/libwebm/src/mkvmuxer.hpp"
15 
16 namespace edash_packager {
17 namespace media {
18 
21 class SeekHead {
22  public:
23  SeekHead();
24  ~SeekHead();
25 
28  bool Write(mkvmuxer::IMkvWriter* writer);
30  bool WriteVoid(mkvmuxer::IMkvWriter* writer);
31 
32  void set_cluster_pos(uint64_t pos) { cluster_pos_ = pos; }
33  void set_cues_pos(uint64_t pos) { cues_pos_ = pos; }
34  void set_info_pos(uint64_t pos) { info_pos_ = pos; }
35  void set_tracks_pos(uint64_t pos) { tracks_pos_ = pos; }
36 
37  private:
38  uint64_t GetPayloadSize(std::vector<uint64_t>* data);
39 
40  int64_t cluster_pos_;
41  int64_t cues_pos_;
42  int64_t info_pos_;
43  int64_t tracks_pos_;
44  bool wrote_void_;
45 
46  DISALLOW_COPY_AND_ASSIGN(SeekHead);
47 };
48 
49 } // namespace media
50 } // namespace edash_packager
51 
52 #endif // MEDIA_FORMATS_WEBM_SEEK_HEAD_H_
bool Write(mkvmuxer::IMkvWriter *writer)
Definition: seek_head.cc:47
bool WriteVoid(mkvmuxer::IMkvWriter *writer)
Writes a void element large enough to fit the SeekHead.
Definition: seek_head.cc:88