Shaka Packager SDK
decoding_time_iterator.h
1 // Copyright 2014 Google LLC. 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 PACKAGER_MEDIA_FORMATS_MP4_DECODING_TIME_ITERATOR_H_
8 #define PACKAGER_MEDIA_FORMATS_MP4_DECODING_TIME_ITERATOR_H_
9 
10 #include <cstdint>
11 #include <vector>
12 
13 #include <packager/macros/classes.h>
14 #include <packager/media/formats/mp4/box_definitions.h>
15 
16 namespace shaka {
17 namespace media {
18 namespace mp4 {
19 
24  public:
26  explicit DecodingTimeIterator(
27  const DecodingTimeToSample& decoding_time_to_sample);
29 
32  bool AdvanceSample();
33 
36  bool IsValid() const;
37 
39  uint32_t sample_delta() const { return iterator_->sample_delta; }
40 
42  int64_t Duration(uint32_t start_sample, uint32_t end_sample) const;
43 
45  uint32_t NumSamples() const;
46 
47  private:
48  uint32_t sample_index_;
49  const std::vector<DecodingTime>& decoding_time_table_;
50  std::vector<DecodingTime>::const_iterator iterator_;
51 
52  DISALLOW_COPY_AND_ASSIGN(DecodingTimeIterator);
53 };
54 
55 } // namespace mp4
56 } // namespace media
57 } // namespace shaka
58 
59 #endif // PACKAGER_MEDIA_FORMATS_MP4_DECODING_TIME_ITERATOR_H_
DecodingTimeIterator(const DecodingTimeToSample &decoding_time_to_sample)
Create DecodingTimeIterator from decoding time to sample box.
int64_t Duration(uint32_t start_sample, uint32_t end_sample) const
All the methods that are virtual are virtual for mocking.
Definition: crypto_flags.cc:66