Shaka Packager SDK
event_info.h
1 // Copyright 2018 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 // Defines EventInfo structure used internally by muxer listeners for VOD.
8 
9 #ifndef PACKAGER_MEDIA_EVENT_EVENT_INFO_H_
10 #define PACKAGER_MEDIA_EVENT_EVENT_INFO_H_
11 
12 #include <cstdint>
13 
14 namespace shaka {
15 namespace media {
16 
17 // This stores data passed into OnNewSegment() for VOD.
19  int64_t start_time;
20  // The below two fields are only useful for Segment.
21  int64_t duration;
22  uint64_t segment_file_size;
23 };
24 
25 struct KeyFrameEvent {
26  int64_t timestamp;
27  // In segment for multi-segment, in subsegment for single-segment.
28  uint64_t start_offset_in_segment;
29  uint64_t size;
30 };
31 
32 // This stores data passed into OnCueEvent() for VOD.
33 struct CueEventInfo {
34  int64_t timestamp;
35 };
36 
37 enum class EventInfoType {
38  kSegment,
39  kKeyFrame,
40  kCue,
41 };
42 
43 // This stores data for lazy event callback for VOD.
44 struct EventInfo {
45  EventInfoType type;
46  union {
47  SegmentEventInfo segment_info;
48  KeyFrameEvent key_frame;
49  CueEventInfo cue_event_info;
50  };
51 };
52 
53 } // namespace media
54 } // namespace shaka
55 
56 #endif // PACKAGER_MEDIA_EVENT_EVENT_INFO_H_
All the methods that are virtual are virtual for mocking.