mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
osxvideosink: fix support in VM's without hardware acceleration
This commit is contained in:
parent
745be945ce
commit
025f226e60
2 changed files with 8 additions and 4 deletions
|
@ -379,7 +379,6 @@ const gchar* gst_keycode_to_keyname(gint16 keycode)
|
||||||
- (id) initWithFrame:(NSRect) frame {
|
- (id) initWithFrame:(NSRect) frame {
|
||||||
NSOpenGLPixelFormat *fmt;
|
NSOpenGLPixelFormat *fmt;
|
||||||
NSOpenGLPixelFormatAttribute attribs[] = {
|
NSOpenGLPixelFormatAttribute attribs[] = {
|
||||||
NSOpenGLPFAAccelerated,
|
|
||||||
NSOpenGLPFANoRecovery,
|
NSOpenGLPFANoRecovery,
|
||||||
NSOpenGLPFADoubleBuffer,
|
NSOpenGLPFADoubleBuffer,
|
||||||
NSOpenGLPFAColorSize, 24,
|
NSOpenGLPFAColorSize, 24,
|
||||||
|
|
|
@ -867,9 +867,14 @@ gst_osx_video_sink_get_type (void)
|
||||||
gst_buffer_map (buf, &info, GST_MAP_READ);
|
gst_buffer_map (buf, &info, GST_MAP_READ);
|
||||||
viewdata = (guint8 *) [osxvideosink->osxwindow->gstview getTextureBuffer];
|
viewdata = (guint8 *) [osxvideosink->osxwindow->gstview getTextureBuffer];
|
||||||
|
|
||||||
memcpy (viewdata, info.data, info.size);
|
if (G_UNLIKELY (viewdata == NULL)) {
|
||||||
[osxvideosink->osxwindow->gstview displayTexture];
|
GST_ELEMENT_ERROR (osxvideosink, RESOURCE, WRITE,
|
||||||
gst_buffer_unmap (buf, &info);
|
("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];
|
[object release];
|
||||||
|
|
Loading…
Reference in a new issue