# Glass SDK capture / recording / AI

## Purpose

Demonstrate first-party APIs for still capture, MP4 pipelines, microphones, pinch-to-zoom knobs, plus AI-chat session wiring.

## Entry points

Glass home:

- `HomeActivity` → `SdkMediaActivity`

Sample Activity:

- `com.rokid.glass.SdkMediaActivity`

## Platform

- Glass

## Main file

- [SdkMediaActivity.kt](https://gitee.com/as_pixar/glass3sdkdemo/blob/main/glassdemo/app/src/main/java/com/rokid/glass/SdkMediaActivity.kt)

## Capability surface

- Resolution matrix for photography  
- MP4 authoring + stop hooks  
- H264 feeder / teardown  
- Optical zoom intents  
- Microphone AAC capture  
- Start / route / teardown AI-chat sessions  

## Representative calls

- `takePhoto(...)`  
- `startRecord(...)` / `stopRecord()`  
- `sendVideoStreamDataV2(...)` / `stopVideoStreamData()`  
- `zoomCamera(...)`  
- `startAudioRecord(...)` / `stopAudioRecord(...)`  
- `startAiChat(...)` · `toAiChat(...)` · `endAiChat()`

## FAQ

### When to crib from this Activity

Treat it both as capability smoke screen and knob explorer for validating SDK regressions quickly.

### Why multiple profiles exist

Comments document orientation quirks—for example HD landscape vs portrait trade-offs for specific modes.

## Caveats

- Recordings persist under shared gallery paths.  
- Segment length currently hard-coded to one minute shards.  
- Mic capture produces AAC artefacts.
