2018-01-12 00:55:43 +00:00
|
|
|
// Copyright 2018 Google Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file or at
|
|
|
|
// https://developers.google.com/open-source/licenses/bsd
|
|
|
|
//
|
|
|
|
// Defines EventInfo structure used internally by muxer listeners for VOD.
|
|
|
|
|
|
|
|
#ifndef PACKAGER_MEDIA_EVENT_EVENT_INFO_H_
|
|
|
|
#define PACKAGER_MEDIA_EVENT_EVENT_INFO_H_
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
namespace shaka {
|
|
|
|
namespace media {
|
|
|
|
|
|
|
|
// This stores data passed into OnNewSegment() for VOD.
|
|
|
|
struct SegmentEventInfo {
|
2018-06-22 01:14:34 +00:00
|
|
|
int64_t start_time;
|
2018-01-12 00:55:43 +00:00
|
|
|
// The below two fields are only useful for Segment.
|
2018-06-22 01:14:34 +00:00
|
|
|
int64_t duration;
|
2018-01-12 00:55:43 +00:00
|
|
|
uint64_t segment_file_size;
|
|
|
|
};
|
|
|
|
|
2018-01-31 02:30:19 +00:00
|
|
|
struct KeyFrameEvent {
|
2018-06-22 01:14:34 +00:00
|
|
|
int64_t timestamp;
|
2018-02-01 20:25:07 +00:00
|
|
|
// In segment for multi-segment, in subsegment for single-segment.
|
|
|
|
uint64_t start_offset_in_segment;
|
2018-01-31 02:30:19 +00:00
|
|
|
uint64_t size;
|
|
|
|
};
|
|
|
|
|
2018-01-12 00:55:43 +00:00
|
|
|
// This stores data passed into OnCueEvent() for VOD.
|
|
|
|
struct CueEventInfo {
|
2018-06-22 01:14:34 +00:00
|
|
|
int64_t timestamp;
|
2018-01-12 00:55:43 +00:00
|
|
|
};
|
|
|
|
|
2018-01-31 02:30:19 +00:00
|
|
|
enum class EventInfoType {
|
|
|
|
kSegment,
|
|
|
|
kKeyFrame,
|
|
|
|
kCue,
|
|
|
|
};
|
|
|
|
|
2018-01-12 00:55:43 +00:00
|
|
|
// This stores data for lazy event callback for VOD.
|
|
|
|
struct EventInfo {
|
2018-01-31 02:30:19 +00:00
|
|
|
EventInfoType type;
|
2018-01-12 00:55:43 +00:00
|
|
|
union {
|
|
|
|
SegmentEventInfo segment_info;
|
2018-01-31 02:30:19 +00:00
|
|
|
KeyFrameEvent key_frame;
|
2018-01-12 00:55:43 +00:00
|
|
|
CueEventInfo cue_event_info;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace media
|
|
|
|
} // namespace shaka
|
|
|
|
|
|
|
|
#endif // PACKAGER_MEDIA_EVENT_EVENT_INFO_H_
|