Skip to content

Commit

Permalink
[nemo-qtmultimedia-plugins] obtain buffer crop info from GstVideoCrop…
Browse files Browse the repository at this point in the history
…Meta
  • Loading branch information
Mohammed Hassan committed Mar 6, 2015
1 parent 8353cdb commit 9d29103
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/videotexturebackend/videotexturebackend.cpp
Expand Up @@ -50,6 +50,7 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <gst/interfaces/nemovideotexture.h>
#include <gst/video/gstvideometa.h>

#include <QThread>

Expand Down Expand Up @@ -199,13 +200,13 @@ bool GStreamerVideoTexture::updateTexture()
int top = 0;
int right = 0;
int bottom = 0;
static const GQuark cropQuark = g_quark_from_string("GstDroidCamSrcCropData");
if (const GstStructure *crop = nemo_gst_video_texture_get_frame_qdata(
sink, cropQuark)) {
gst_structure_get_int(crop, "left", &left);
gst_structure_get_int(crop, "top", &top);
gst_structure_get_int(crop, "right", &right);
gst_structure_get_int(crop, "bottom", &bottom);
if (GstMeta *meta = nemo_gst_video_texture_get_frame_meta (sink,
GST_VIDEO_CROP_META_API_TYPE)) {
GstVideoCropMeta *crop = (GstVideoCropMeta *) meta;
left = crop->x;
top = crop->y;
right = crop->width + left;
bottom = crop->height + top;
}

if (left != right && top != bottom) {
Expand Down

0 comments on commit 9d29103

Please sign in to comment.