(_stream: MediaStream, agentId?: string, streamType?: 'camera' | 'screen')
| 19 | * @returns OCR result with text, confidence, and success status |
| 20 | */ |
| 21 | export async function captureFrameAndOCR(_stream: MediaStream, agentId?: string, streamType?: 'camera' | 'screen'): Promise<OCRResult> { |
| 22 | const type = streamType || 'screen'; |
| 23 | const imageData = await StreamManager.captureFrame(type, agentId); |
| 24 | |
| 25 | if (!imageData) { |
| 26 | return { error: 'Failed to capture frame: video not ready' }; |
| 27 | } |
| 28 | |
| 29 | return performOCR(imageData); |
| 30 | } |
| 31 | |
| 32 | export async function performOCROnBase64(imageData: string): Promise<OCRResult> { |
| 33 | return performOCR(imageData); |
no test coverage detected