summaryrefslogtreecommitdiff
path: root/modules/camera/camera_osx.mm
diff options
context:
space:
mode:
Diffstat (limited to 'modules/camera/camera_osx.mm')
-rw-r--r--modules/camera/camera_osx.mm30
1 files changed, 15 insertions, 15 deletions
diff --git a/modules/camera/camera_osx.mm b/modules/camera/camera_osx.mm
index 3d2053ad23..6bc56add20 100644
--- a/modules/camera/camera_osx.mm
+++ b/modules/camera/camera_osx.mm
@@ -106,15 +106,15 @@
if (input) {
[self removeInput:input];
// don't release this
- input = NULL;
+ input = nullptr;
}
// free up our output
if (output) {
[self removeOutput:output];
- [output setSampleBufferDelegate:nil queue:NULL];
+ [output setSampleBufferDelegate:nil queue:nullptr];
[output release];
- output = NULL;
+ output = nullptr;
}
[self commitConfiguration];
@@ -141,9 +141,9 @@
// get our buffers
unsigned char *dataY = (unsigned char *)CVPixelBufferGetBaseAddressOfPlane(pixelBuffer, 0);
unsigned char *dataCbCr = (unsigned char *)CVPixelBufferGetBaseAddressOfPlane(pixelBuffer, 1);
- if (dataY == NULL) {
+ if (dataY == nullptr) {
print_line("Couldn't access Y pixel buffer data");
- } else if (dataCbCr == NULL) {
+ } else if (dataCbCr == nullptr) {
print_line("Couldn't access CbCr pixel buffer data");
} else {
Ref<Image> img[2];
@@ -162,7 +162,7 @@
uint8_t *w = img_data[0].ptrw();
memcpy(w, dataY, new_width * new_height);
- img[0].instance();
+ img[0].instantiate();
img[0]->create(new_width, new_height, 0, Image::FORMAT_R8, img_data[0]);
}
@@ -181,7 +181,7 @@
memcpy(w, dataCbCr, 2 * new_width * new_height);
///TODO GLES2 doesn't support FORMAT_RG8, need to do some form of conversion
- img[1].instance();
+ img[1].instantiate();
img[1]->create(new_width, new_height, 0, Image::FORMAT_RG8, img_data[1]);
}
@@ -220,8 +220,8 @@ AVCaptureDevice *CameraFeedOSX::get_device() const {
};
CameraFeedOSX::CameraFeedOSX() {
- device = NULL;
- capture_session = NULL;
+ device = nullptr;
+ capture_session = nullptr;
};
void CameraFeedOSX::set_device(AVCaptureDevice *p_device) {
@@ -240,14 +240,14 @@ void CameraFeedOSX::set_device(AVCaptureDevice *p_device) {
};
CameraFeedOSX::~CameraFeedOSX() {
- if (capture_session != NULL) {
+ if (capture_session != nullptr) {
[capture_session release];
- capture_session = NULL;
+ capture_session = nullptr;
};
- if (device != NULL) {
+ if (device != nullptr) {
[device release];
- device = NULL;
+ device = nullptr;
};
};
@@ -267,7 +267,7 @@ void CameraFeedOSX::deactivate_feed() {
if (capture_session) {
[capture_session cleanup];
[capture_session release];
- capture_session = NULL;
+ capture_session = nullptr;
};
};
@@ -341,7 +341,7 @@ void CameraOSX::update_feeds() {
if (!found) {
Ref<CameraFeedOSX> newfeed;
- newfeed.instance();
+ newfeed.instantiate();
newfeed->set_device(device);
// assume display camera so inverse