Changeset 5370
- Timestamp:
- Jun 30, 2016 3:18:47 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-videodev/darwin_dev.m
r5348 r5370 78 78 static darwin_supported_size darwin_sizes[] = 79 79 { 80 #if TARGET_OS_IPHONE 80 #if !TARGET_OS_IPHONE 81 { 320, 240, NULL }, 82 #endif 81 83 { 352, 288, NULL }, 82 84 { 640, 480, NULL }, 83 { 1280, 720, NULL },84 { 1920, 1080, NULL }85 #else86 85 { 1280, 720, NULL } 86 #if TARGET_OS_IPHONE 87 ,{ 1920, 1080, NULL } 87 88 #endif 88 89 }; … … 216 217 static void set_preset_str() 217 218 { 218 #if TARGET_OS_IPHONE 219 darwin_sizes[0].preset_str = AVCaptureSessionPreset352x288; 220 darwin_sizes[1].preset_str = AVCaptureSessionPreset640x480; 221 darwin_sizes[2].preset_str = AVCaptureSessionPreset1280x720; 222 darwin_sizes[3].preset_str = AVCaptureSessionPreset1920x1080; 223 #else 224 darwin_sizes[0].preset_str = AVCaptureSessionPreset1280x720; 219 int idx = 0; 220 #if !TARGET_OS_IPHONE 221 darwin_sizes[idx++].preset_str = AVCaptureSessionPreset320x240; 222 #endif 223 darwin_sizes[idx++].preset_str = AVCaptureSessionPreset352x288; 224 darwin_sizes[idx++].preset_str = AVCaptureSessionPreset640x480; 225 darwin_sizes[idx++].preset_str = AVCaptureSessionPreset1280x720; 226 #if TARGET_OS_IPHONE 227 darwin_sizes[idx++].preset_str = AVCaptureSessionPreset1920x1080; 225 228 #endif 226 229 } … … 504 507 [stream->frame_lock lock]; 505 508 506 // TODO: on Mac, nearly all frames, regardless of video format,507 // have extra padding. So we may need to create a util function to508 // remove the stride.509 510 509 if (stream->is_planar && stream->capture_buf) { 511 510 if (stream->param.fmt.id == PJMEDIA_FORMAT_I420) { … … 795 794 strm->video_output.videoSettings = 796 795 [NSDictionary dictionaryWithObjectsAndKeys: 796 #if !TARGET_OS_IPHONE 797 /* On Mac, we need to set the buffer's dimension 798 * to avoid extra padding. 799 */ 800 [NSNumber numberWithDouble: 801 darwin_sizes[i].supported_size_w], 802 (id)kCVPixelBufferWidthKey, 803 [NSNumber numberWithDouble: 804 darwin_sizes[i].supported_size_h], 805 (id)kCVPixelBufferHeightKey, 806 #endif 797 807 [NSNumber numberWithInt:ifi->darwin_format], 798 808 kCVPixelBufferPixelFormatTypeKey, nil];
Note: See TracChangeset
for help on using the changeset viewer.