[clutter-gst] video-sink: force upload of video frames when creating textures
- From: Lionel Landwerlin <llandwerlin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter-gst] video-sink: force upload of video frames when creating textures
- Date: Fri, 10 Jul 2015 10:21:42 +0000 (UTC)
commit 483d5868c3afb320023fcd314ee4300b9fdbe36d
Author: Lionel Landwerlin <lionel g landwerlin intel com>
Date: Thu Jul 9 16:27:10 2015 +0100
video-sink: force upload of video frames when creating textures
https://bugzilla.gnome.org/show_bug.cgi?id=752098
clutter-gst/clutter-gst-video-sink.c | 37 +++++----------------------------
1 files changed, 6 insertions(+), 31 deletions(-)
---
diff --git a/clutter-gst/clutter-gst-video-sink.c b/clutter-gst/clutter-gst-video-sink.c
index 9037b94..688b485 100644
--- a/clutter-gst/clutter-gst-video-sink.c
+++ b/clutter-gst/clutter-gst-video-sink.c
@@ -1052,40 +1052,15 @@ video_texture_new_from_data (CoglContext *ctx,
int rowstride,
const uint8_t *data)
{
- CoglBitmap *bitmap;
CoglTexture *tex;
CoglError *internal_error = NULL;
- bitmap = cogl_bitmap_new_for_data (ctx,
- width, height,
- format,
- rowstride,
- (uint8_t *) data);
-
- if ((is_pot (cogl_bitmap_get_width (bitmap)) &&
- is_pot (cogl_bitmap_get_height (bitmap))) ||
- cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_BASIC))
- {
- tex = cogl_texture_2d_new_from_bitmap (bitmap);
- if (!tex)
- {
- cogl_error_free (internal_error);
- internal_error = NULL;
- }
- }
- else
- tex = NULL;
-
- if (!tex)
- {
- /* Otherwise create a sliced texture */
- tex = cogl_texture_2d_sliced_new_from_bitmap (bitmap,
- -1); /* no maximum waste */
- }
-
- cogl_object_unref (bitmap);
-
- cogl_texture_set_premultiplied (tex, FALSE);
+ tex = cogl_texture_2d_new_from_data (ctx, width, height, format,
+ rowstride, data, &internal_error);
+ if (tex == NULL) {
+ GST_WARNING ("Cannot allocate Cogl texture : %s", internal_error->message);
+ return NULL;
+ }
return tex;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]