syntax = "proto3";

package sabr.misc;

option java_multiple_files = true;
option java_package = "com.google.android.exoplayer2.source.sabr.protos.misc";
option optimize_for = LITE_RUNTIME;

message HttpHeader {
  optional string name = 1;
  optional string value = 2;
}

message FormatId {
  optional int32 itag = 1;
  optional uint64 last_modified = 2;
  optional string xtags = 3;
}

message Range {
  optional int32 legacy_start = 1;
  optional int32 legacy_end = 2;
  optional int32 start = 3;
  optional int32 end = 4;
}

enum CompressionType {
  UNKNOWN = 0;
  GZIP = 1;
  BROTLI = 2;
}

message IdentifierToken {
  optional int32 request_number = 1;
  optional int32 field5 = 5;
}

message KeyValuePair {
  optional string key = 1;
  optional string value = 2;
}

enum AudioQuality {
  AUDIO_QUALITY_UNKNOWN = 0;
  AUDIO_QUALITY_ULTRALOW = 5;
  AUDIO_QUALITY_LOW = 10;
  AUDIO_QUALITY_MEDIUM = 20;
  AUDIO_QUALITY_HIGH = 30;
}

enum VideoQualitySetting {
  VIDEO_QUALITY_SETTING_UNKNOWN = 0;
  VIDEO_QUALITY_SETTING_HIGHER_QUALITY = 1;
  VIDEO_QUALITY_SETTING_DATA_SAVER = 2;
  VIDEO_QUALITY_SETTING_ADVANCED_MENU = 3;
}

enum PlaybackAudioRouteOutputType {
  PLAYBACK_AUDIO_ROUTE_OUTPUT_TYPE_UNKNOWN = 0;
  PLAYBACK_AUDIO_ROUTE_OUTPUT_TYPE_LINE_OUT = 1;
  PLAYBACK_AUDIO_ROUTE_OUTPUT_TYPE_HEADPHONES = 2;
  PLAYBACK_AUDIO_ROUTE_OUTPUT_TYPE_BLUETOOTH_A2DP = 3;
  PLAYBACK_AUDIO_ROUTE_OUTPUT_TYPE_BUILT_IN_RECEIVER = 4;
  PLAYBACK_AUDIO_ROUTE_OUTPUT_TYPE_BUILT_IN_SPEAKER = 5;
  PLAYBACK_AUDIO_ROUTE_OUTPUT_TYPE_HDMI = 6;
  PLAYBACK_AUDIO_ROUTE_OUTPUT_TYPE_AIR_PLAY = 7;
  PLAYBACK_AUDIO_ROUTE_OUTPUT_TYPE_BLUETOOTH_LE = 8;
  PLAYBACK_AUDIO_ROUTE_OUTPUT_TYPE_BLUETOOTH_HFP = 9;
  PLAYBACK_AUDIO_ROUTE_OUTPUT_TYPE_USB_AUDIO = 10;
  PLAYBACK_AUDIO_ROUTE_OUTPUT_TYPE_CAR_PLAY = 11;
  PLAYBACK_AUDIO_ROUTE_OUTPUT_TYPE_ANDROID_AUDIO = 12;
}

enum NetworkMeteredState {
  NETWORK_METERED_STATE_UNKNOWN = 0;
  NETWORK_METERED_STATE_UNMETERED = 1;
  NETWORK_METERED_STATE_METERED = 2;
}

enum SeekSource {
  SEEK_SOURCE_UNKNOWN = 0;
  SEEK_SOURCE_TIMESTAMP_IN_COMMENTS = 1;
  SEEK_SOURCE_TIMESTAMP_IN_DESCRIPTION = 2;
  SEEK_SOURCE_MACRO_MARKER_LIST_ITEM = 3;
  SEEK_SOURCE_DOUBLE_TAP_TO_SEEK = 4;
  SEEK_SOURCE_DOUBLE_TAP_TO_SKIP_CHAPTER = 5;
  SEEK_SOURCE_PICK_UP_PLAY_HEAD = 6;
  SEEK_SOURCE_SLIDE_ON_SCRUBBER_BAR = 7;
  SEEK_SOURCE_SLIDE_ON_PLAYER = 8;
  SEEK_SOURCE_SABR_PARTIAL_CHUNK = 9;
  SEEK_SOURCE_SABR_SEEK_TO_HEAD = 10;
  SEEK_SOURCE_SABR_LIVE_DVR_USER_SEEK = 11;
  SEEK_SOURCE_SABR_SEEK_TO_DVR_LOWER_BOUND = 12;
  SEEK_SOURCE_SABR_SEEK_TO_DVR_UPPER_BOUND = 13;
  SEEK_SOURCE_SSDAI_INTERNAL = 14;
  SEEK_SOURCE_START_PLAYBACK = 15;
  SEEK_SOURCE_SABR_ACCURATE_SEEK = 17;
  SEEK_SOURCE_START_PLAYBACK_SEEK_TO_END = 18;
  SEEK_SOURCE_IOS_PLAYER_REMOVED_SEGMENTS = 19;
  SEEK_SOURCE_IOS_PLAYER_SEGMENT_LIST = 20;
  SEEK_SOURCE_IOS_PLAYER_ITEM_SEEK = 21;
  SEEK_SOURCE_IOS_PLAYER_ITEM_SEEK_TO_END = 22;
  SEEK_SOURCE_IOS_PLAYER_SEEK_TO_END_TO_RESYNC = 23;
  SEEK_SOURCE_IOS_SEEK_ACCESSIBILITY_BUTTON = 24;
  SEEK_SOURCE_FINE_SCRUBBER_SLIDE_ON_FILMSTRIP = 25;
  SEEK_SOURCE_FINE_SCRUBBER_TAP_ON_FILMSTRIP = 26;
  SEEK_SOURCE_FINE_SCRUBBER_SLIDE_ON_SCRUBBER_BAR = 27;
  SEEK_SOURCE_SEEK_BUTTON_ON_PLAYER_CONTROL = 28;
  SEEK_SOURCE_SABR_INGESTION_WALL_TIME_SEEK = 29;
  SEEK_SOURCE_PLAYER_VIEW_REPARENT_INTERNAL = 30;
  SEEK_SOURCE_PRESS_REWIND_PLAY_BACK_CONTROL = 31;
  SEEK_SOURCE_PRESS_FAST_FORWARD_PLAY_BACK_CONTROL = 32;
  SEEK_SOURCE_PRESS_LIVE_SYNC_ICON = 33;
  SEEK_SOURCE_PEG_TO_LIVE = 34;
  SEEK_SOURCE_ANDROID_MEDIA_SESSION = 35;
  SEEK_SOURCE_TAP_ON_REPLAY_ACTION = 36;
  SEEK_SOURCE_AUTOMATIC_REPLAY_ACTION = 37;
  SEEK_SOURCE_NON_USER_SEEK_TO_PREVIOUS = 38;
  SEEK_SOURCE_NON_USER_SEEK_TO_NEXT = 39;
  SEEK_SOURCE_HIGHLIGHTS_TAP_PREVIOUS_PLAY = 66;
  SEEK_SOURCE_HIGHLIGHTS_TAP_NEXT_PLAY = 40;
  SEEK_SOURCE_HIGHLIGHTS_TAP_HIDDEN_NEXT_PLAY = 41;
  SEEK_SOURCE_HIGHLIGHTS_TAP_LIST_ITEM = 42;
  SEEK_SOURCE_HIGHLIGHTS_AUTOMATIC_NEXT_PLAY = 43;
  SEEK_SOURCE_HIGHLIGHTS_SEEK_TO_FIRST_PLAY = 44;
  SEEK_SOURCE_HIGHLIGHTS_SEEK_TO_END = 45;
  SEEK_SOURCE_SEGMENTS_TAP_LIST_ITEM = 46;
  SEEK_SOURCE_PIP_FAST_FORWARD_BUTTON = 47;
  SEEK_SOURCE_PIP_REWIND_BUTTON = 48;
  SEEK_SOURCE_PIP_RESUME_ON_HEAD = 49;
  SEEK_SOURCE_MOVING_CLIP_FRAME = 50;
  SEEK_SOURCE_RESUME_CLIP_PREVIOUS_POSITION = 51;
  SEEK_SOURCE_SEEK_TO_NEXT_CHAPTER = 52;
  SEEK_SOURCE_SEEK_TO_PREVIOUS_CHAPTER = 53;
  SEEK_SOURCE_IOS_SHAREPLAY_PAUSE = 54;
  SEEK_SOURCE_IOS_SHAREPLAY_SEEK = 55;
  SEEK_SOURCE_IOS_SHAREPLAY_SYNC_RESPONSE = 56;
  SEEK_SOURCE_SEEK_TO_HEAD_IMMERSIVE_LIVE_VIDEO = 57;
  SEEK_SOURCE_SEEK_TO_START_OF_LOOPING_RANGE_OF_SHORTS = 58;
  SEEK_SOURCE_SABR_SEEK_TO_CLOSEST_KEYFRAME = 59;
  SEEK_SOURCE_SEEK_TO_END_OF_LOOPING_RANGE_OF_SHORTS = 60;
  SEEK_SOURCE_CLIP_SLIDE_ON_FLIMSTRIP = 61;
  SEEK_SOURCE_PICK_UP_CLIP_SLIDER = 62;
  SEEK_SOURCE_FINE_SCRUBBER_CANCELLED = 63;
  SEEK_SOURCE_INLINE_PLAYER_SEEK_CHAPTER = 64;
  SEEK_SOURCE_INLINE_PLAYER_SEEK_SECONDS = 65;
  SEEK_SOURCE_HIGHLIGHTS_PLAYER_EXIT_FULLSCREEN = 67;
  SEEK_SOURCE_LARGE_CONTROLS_FORWARD_BUTTON = 68;
  SEEK_SOURCE_LARGE_CONTROLS_REWIND_BUTTON = 69;
  SEEK_SOURCE_LARGE_CONTROLS_SCRUBBER_BAR = 70;
  SEEK_SOURCE_SEEK_BACKWARD_5S = 71;
  SEEK_SOURCE_SEEK_FORWARD_5S = 72;
  SEEK_SOURCE_SEEK_BACKWARD_10S = 73;
  SEEK_SOURCE_SEEK_FORWARD_10S = 74;
  SEEK_SOURCE_SEEK_FORWARD_60S = 75;
  SEEK_SOURCE_SEEK_BACKWARD_60S = 76;
  SEEK_SOURCE_SEEK_TO_NEXT_FRAME = 77;
  SEEK_SOURCE_SEEK_TO_PREV_FRAME = 78;
  SEEK_SOURCE_KEYBOARD_SEEK_TO_BEGINNING = 79;
  SEEK_SOURCE_KEYBOARD_SEEK_TO_END = 80;
  SEEK_SOURCE_SEEK_PERCENT_OF_VIDEO = 81;
  SEEK_SOURCE_HIDDEN_FAST_FORWARD_BUTTON = 82;
  SEEK_SOURCE_HIDDEN_REWIND_BUTTON = 83;
  SEEK_SOURCE_TIMESTAMP = 84;
  SEEK_SOURCE_LR_MEDIA_SESSION_SEEK = 87;
  SEEK_SOURCE_MIDROLLS_WITH_TIME_RANGE = 88;
  SEEK_SOURCE_SKIP_AD = 89;
  SEEK_SOURCE_SEEK_TO_PREVIOUS = 90;
  SEEK_SOURCE_SEEK_TO_NEXT = 91;
  SEEK_SOURCE_LR_QUICK_SEEK = 92;
  SEEK_SOURCE_ONESIE_LIVE = 93;
  SEEK_SOURCE_LR_PLAYER_CONTROL_ACTION = 94;
  SEEK_SOURCE_UNPLUGGED_LENS_START_CLIP = 95;
  SEEK_SOURCE_LR_KEY_PLAYS = 96;
  SEEK_SOURCE_SSAP_AD_FMT_FATAL = 97;
  SEEK_SOURCE_TVHTML5_INPUT_SOURCE_KEY_EVENT = 98;
  SEEK_SOURCE_TVHTML5_INPUT_SOURCE_CONTROLS = 99;
  SEEK_SOURCE_TVHTML5_INPUT_SOURCE_TOUCH = 100;
  SEEK_SOURCE_TVHTML5_INPUT_SOURCE_TOUCHPAD = 101;
  SEEK_SOURCE_SEEK_TO_HEAD = 102;
  SEEK_SOURCE_AUTOMATIC_PREVIEW_REPLAY_ACTION = 103;
  SEEK_SOURCE_H5_MEDIA_ELEMENT_EVENT = 104;
  SEEK_SOURCE_H5_WORKAROUND_SEEK = 105;
  SEEK_SOURCE_MINIPLAYER_REWIND_BUTTON = 106;
  SEEK_SOURCE_MINIPLAYER_FAST_FORWARD_BUTTON = 107;
  SEEK_SOURCE_SABR_RELOAD_PLAYER_RESPONSE_TOKEN_SEEK = 108;
  SEEK_SOURCE_SLIDE_ON_SCRUBBER_BAR_CHAPTER = 109;
  SEEK_SOURCE_ANDROID_CLEAR_BUFFER = 110;
}

enum OnesieRequestTarget {
  ONESIE_REQUEST_TARGET_UNKNOWN = 0;
  ONESIE_REQUEST_TARGET_ENCRYPTED_PLAYER_SERVICE = 1;
  ONESIE_REQUEST_TARGET_ENCRYPTED_WATCH_SERVICE_DEPRECATED = 2;
  ONESIE_REQUEST_TARGET_ENCRYPTED_WATCH_SERVICE = 3;
  ONESIE_REQUEST_TARGET_INNERTUBE_ENCRYPTED_SERVICE = 4;
}

message AuthorizedFormat {
  optional int32 track_type = 1;
  optional bool is_hdr = 2;
}

message PlaybackAuthorization {
  repeated AuthorizedFormat authorized_formats = 1;
  optional bytes sabr_license_constraint = 2;
}