diff options
author | Andoni Morales Alastruey <ylatuya@gmail.com> | 2013-06-05 17:02:49 +0200 |
---|---|---|
committer | Andoni Morales Alastruey <ylatuya@gmail.com> | 2013-06-18 10:41:37 +0200 |
commit | 025f226e60f226884fe843eca98ecc0b5b78f398 (patch) | |
tree | 783698816b279b5481595643ab93bc175ca64639 /sys | |
parent | 745be945cea04ddb08a664dc7ce4fd4e09ba1b8e (diff) |
osxvideosink: fix support in VM's without hardware acceleration
Diffstat (limited to 'sys')
-rw-r--r-- | sys/osxvideo/cocoawindow.m | 1 | ||||
-rw-r--r-- | sys/osxvideo/osxvideosink.m | 11 |
2 files changed, 8 insertions, 4 deletions
diff --git a/sys/osxvideo/cocoawindow.m b/sys/osxvideo/cocoawindow.m index a3b279802..0491ab979 100644 --- a/sys/osxvideo/cocoawindow.m +++ b/sys/osxvideo/cocoawindow.m @@ -379,7 +379,6 @@ const gchar* gst_keycode_to_keyname(gint16 keycode) - (id) initWithFrame:(NSRect) frame { NSOpenGLPixelFormat *fmt; NSOpenGLPixelFormatAttribute attribs[] = { - NSOpenGLPFAAccelerated, NSOpenGLPFANoRecovery, NSOpenGLPFADoubleBuffer, NSOpenGLPFAColorSize, 24, diff --git a/sys/osxvideo/osxvideosink.m b/sys/osxvideo/osxvideosink.m index f235c8b2c..c75c681d9 100644 --- a/sys/osxvideo/osxvideosink.m +++ b/sys/osxvideo/osxvideosink.m @@ -867,9 +867,14 @@ gst_osx_video_sink_get_type (void) gst_buffer_map (buf, &info, GST_MAP_READ); viewdata = (guint8 *) [osxvideosink->osxwindow->gstview getTextureBuffer]; - memcpy (viewdata, info.data, info.size); - [osxvideosink->osxwindow->gstview displayTexture]; - gst_buffer_unmap (buf, &info); + if (G_UNLIKELY (viewdata == NULL)) { + GST_ELEMENT_ERROR (osxvideosink, RESOURCE, WRITE, + ("Could not get a texture buffer"), (NULL)); + } else { + memcpy (viewdata, info.data, info.size); + [osxvideosink->osxwindow->gstview displayTexture]; + gst_buffer_unmap (buf, &info); + } } [object release]; |