Shaka Packager SDK
event_info.h
1 // Copyright 2018 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 // 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  int64_t segment_number;
24 };
25 
26 struct KeyFrameEvent {
27  int64_t timestamp;
28  // In segment for multi-segment, in subsegment for single-segment.
29  uint64_t start_offset_in_segment;
30  uint64_t size;
31 };
32 
33 // This stores data passed into OnCueEvent() for VOD.
34 struct CueEventInfo {
35  int64_t timestamp;
36 };
37 
38 enum class EventInfoType {
39  kSegment,
40  kKeyFrame,
41  kCue,
42 };
43 
44 // This stores data for lazy event callback for VOD.
45 struct EventInfo {
46  EventInfoType type;
47  union {
48  SegmentEventInfo segment_info;
49  KeyFrameEvent key_frame;
50  CueEventInfo cue_event_info;
51  };
52 };
53 
54 } // namespace media
55 } // namespace shaka
56 
57 #endif // PACKAGER_MEDIA_EVENT_EVENT_INFO_H_
All the methods that are virtual are virtual for mocking.
Definition: crypto_flags.cc:66