}
device = [devices objectAtIndex:deviceIndex];
}
+ [device retain];
GST_INFO ("Opening '%s'", [[device localizedDisplayName] UTF8String]);
GST_ELEMENT_ERROR (element, RESOURCE, NOT_FOUND,
("Failed to open device '%s'",
[[device localizedDisplayName] UTF8String]), (NULL));
+ [device release];
+ device = nil;
return NO;
}
[output release];
output = nil;
+ [device release];
device = nil;
}
[session stopRunning];
[output setDelegate:nil];
- for (id frame in queue)
- CVBufferRelease ((CVImageBufferRef) frame);
[queueLock release];
queueLock = nil;
[queue release];
return;
}
- if ([queue count] == FRAME_QUEUE_SIZE) {
- CVBufferRelease ((CVImageBufferRef) [queue lastObject]);
+ if ([queue count] == FRAME_QUEUE_SIZE)
[queue removeLastObject];
- }
- CVBufferRetain (videoFrame);
[queue insertObject:(id)videoFrame
atIndex:0];
}
frame = (CVPixelBufferRef) [queue lastObject];
+ CVBufferRetain (frame);
[queue removeLastObject];
[queueLock unlockWithCondition:
([queue count] == 0) ? NO_FRAMES : HAS_FRAME_OR_STOP_REQUEST];
return ret;
}
-