Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / auto / protocol / src / main / proto / gal / media.proto
media.proto101 lines · 3.6 KiBRaw
| 1 | // Google Automotive Link media channels: the shared setup/start/ack sequence used by the |
| 2 | // video sink and the three audio sinks, plus video focus. |
| 3 | // |
| 4 | // GAL 11/12 GAP (Phase 4, MA Auto sender): the media-playback-status (service 11, |
| 5 | // `xkn`) and media-browser (service 12, `xki`) channel messages are unmapped, so they |
| 6 | // are deliberately absent below. Now-playing is served from the on-device media session |
| 7 | // and rendered into the ch2 video stream instead; inbound 11/12 traffic is |
| 8 | // NOT_SUPPORTED (observed, never answered -- see `isMediaBrowserChannel`). |
| 9 | // If the teardown ever recovers those IDs, their messages go at the end of this file. |
| 10 | // |
| 11 | // Field numbers recovered from the APK's protobuf-lite descriptors and exact; names follow |
| 12 | // aasdk/openauto. See gal/control.proto for the provenance note. |
| 13 | |
| 14 | syntax = "proto2"; |
| 15 | |
| 16 | package gal; |
| 17 | |
| 18 | option java_package = "com.vayunmathur.auto.protocol.gal"; |
| 19 | option java_multiple_files = true; |
| 20 | |
| 21 | enum VideoFocusMode { |
| 22 | VIDEO_FOCUS_PROJECTED = 1; |
| 23 | VIDEO_FOCUS_NATIVE = 2; |
| 24 | VIDEO_FOCUS_NATIVE_TRANSIENT = 3; |
| 25 | VIDEO_FOCUS_PROJECTED_NO_INPUT_FOCUS = 4; |
| 26 | } |
| 27 | |
| 28 | enum VideoFocusReason { |
| 29 | UNKNOWN = 0; |
| 30 | PHONE_SCREEN_OFF = 1; |
| 31 | PHONE_SCREEN_ON = 2; |
| 32 | LAUNCH_NATIVE = 3; |
| 33 | } |
| 34 | |
| 35 | // 0x8000. Claims the channel for a media type before anything is streamed. |
| 36 | message MediaSetupRequest { |
| 37 | required int32 media_type = 1; |
| 38 | } |
| 39 | |
| 40 | // 0x8003, from the head unit. `configuration_indices` selects which of the configurations |
| 41 | // advertised in discovery the head unit will actually accept. |
| 42 | message MediaSetupResponse { |
| 43 | required int32 media_status = 1; |
| 44 | optional uint32 max_unacked = 2; |
| 45 | repeated uint32 configuration_indices = 3; |
| 46 | } |
| 47 | |
| 48 | // 0x8001. `configuration_index` indexes the config list from the discovery response. |
| 49 | message MediaStartRequest { |
| 50 | required int32 session_id = 1; |
| 51 | required uint32 configuration_index = 2; |
| 52 | optional int32 field3 = 3; |
| 53 | optional bytes field4 = 4; |
| 54 | } |
| 55 | |
| 56 | // 0x8002. Genuinely empty. |
| 57 | message MediaStopRequest {} |
| 58 | |
| 59 | // 0x8004, from the head unit: it has consumed frames and we may send more. |
| 60 | message MediaAck { |
| 61 | required int32 session_id = 1; |
| 62 | optional uint32 ack = 2; |
| 63 | repeated uint64 field3 = 3; |
| 64 | } |
| 65 | |
| 66 | // 0x8007. Note this starts at field 2 -- there is no field 1. |
| 67 | message VideoFocusRequest { |
| 68 | optional VideoFocusMode mode = 2; |
| 69 | optional VideoFocusReason reason = 3; |
| 70 | } |
| 71 | |
| 72 | // 0x8008, from the head unit. |
| 73 | message VideoFocusIndication { |
| 74 | optional VideoFocusMode mode = 1; |
| 75 | optional bool unsolicited = 2; |
| 76 | } |
| 77 | |
| 78 | // 0x8006, from the head unit: microphone request (`xkt`), from the teardown |
| 79 | // (proto2, required int32 field 1, optional int32 field 2). Field NAMES are |
| 80 | // not in the APK -- `fieldN` until the teardown names them -- but numbers, |
| 81 | // wire types and cardinality are exact. The car owns the microphone, so the |
| 82 | // phone receives this and answers bulk audio with 0x8004 acks. |
| 83 | message MicrophoneRequest { |
| 84 | required int32 field1 = 1; |
| 85 | optional int32 field2 = 2; |
| 86 | } |
| 87 | |
| 88 | // 0x800A, phone -> HU: UI-config update (`xow`), from the teardown: a single |
| 89 | // optional message field 1 carrying `xop` (proto2, 8 fields: 3 singular |
| 90 | // messages, 1 enum, 1 repeated enum, 2 repeated messages, 1 message). |
| 91 | // |
| 92 | // The `xop` interior is NOT recovered -- its nested message/enum classes are |
| 93 | // unidentified in the dump (`xou`/`xku` resolve to enum values, `xha`/`xiz` |
| 94 | // to partial shapes, the rest to bare field names) -- so this is a typed |
| 95 | // envelope stub: field 1's number and length-delimited wire type are exact, |
| 96 | // the interior stays opaque bytes. NEVER fill the interior with invented |
| 97 | // fields; an empty envelope (zero bytes on the wire) is the honest send |
| 98 | // until the teardown recovers `xop`. |
| 99 | message UpdateUiConfigRequest { |
| 100 | optional bytes config = 1; |
| 101 | } |