summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>2015-07-09 16:27:10 +0100
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>2015-07-10 11:21:31 +0100
commit483d5868c3afb320023fcd314ee4300b9fdbe36d (patch)
tree058255a13e591d67cdac836ed6aecf00c9a767a2
parent064a18d62b773d801bc0d3e8d4e6aae32afaef97 (diff)
downloadclutter-gst-483d5868c3afb320023fcd314ee4300b9fdbe36d.tar.gz
video-sink: force upload of video frames when creating textures
https://bugzilla.gnome.org/show_bug.cgi?id=752098
-rw-r--r--clutter-gst/clutter-gst-video-sink.c37
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;
}