mirror of
				https://github.com/pion/mediadevices.git
				synced 2025-10-31 11:56:28 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			13 lines
		
	
	
		
			219 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			219 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package frame
 | |
| 
 | |
| import (
 | |
| 	"bytes"
 | |
| 	"image"
 | |
| 	"image/jpeg"
 | |
| )
 | |
| 
 | |
| func decodeMJPEG(frame []byte, width, height int) (image.Image, func(), error) {
 | |
| 	img, err := jpeg.Decode(bytes.NewReader(frame))
 | |
| 	return img, func() {}, err
 | |
| }
 | 
