diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2012-08-30 12:11:20 +0200 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2012-08-30 12:21:41 +0200 |
commit | 429204a89ea384f05a91518a3f7f54b3199e7c3a (patch) | |
tree | 2fad0f0f926f4cb9988cb621b3d0d23414f7b84f | |
parent | edb5a28973befbea6543dd01212a936e7ab538f4 (diff) | |
download | gstreamer-plugins-bad-429204a89ea384f05a91518a3f7f54b3199e7c3a.tar.gz |
dvbsuboverlay: adjust to modified video overlay composition API
... and supply overlay rectangle data in AYUV as provided by input
data rather than converting to RGB.
-rw-r--r-- | gst/dvbsuboverlay/gstdvbsuboverlay.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/gst/dvbsuboverlay/gstdvbsuboverlay.c b/gst/dvbsuboverlay/gstdvbsuboverlay.c index 70da0ec24..3c904a413 100644 --- a/gst/dvbsuboverlay/gstdvbsuboverlay.c +++ b/gst/dvbsuboverlay/gstdvbsuboverlay.c @@ -725,25 +725,9 @@ gst_dvbsub_overlay_subs_to_comp (GstDVBSubOverlay * overlay, for (k = 0; k < h; k++) { for (l = 0; l < w; l++) { guint32 ayuv; - gint a, y, u, v, r, g, b; - /* convert ayuv to argb */ ayuv = palette[*in_data]; - a = ayuv >> 24; - y = (ayuv >> 16) & 0xff; - u = (ayuv >> 8) & 0xff; - v = (ayuv & 0xff); - - r = (298 * y + 459 * v - 63514) >> 8; - g = (298 * y - 55 * u - 136 * v + 19681) >> 8; - b = (298 * y + 541 * u - 73988) >> 8; - - r = CLAMP (r, 0, 255); - g = CLAMP (g, 0, 255); - b = CLAMP (b, 0, 255); - - *data = ((a << 24) | (r << 16) | (g << 8) | b); - + GST_WRITE_UINT32_BE (data, ayuv); in_data++; data++; } @@ -764,8 +748,8 @@ gst_dvbsub_overlay_subs_to_comp (GstDVBSubOverlay * overlay, rw, rh, rx, ry); gst_buffer_add_video_meta (buf, GST_VIDEO_FRAME_FLAG_NONE, - GST_VIDEO_OVERLAY_COMPOSITION_FORMAT_RGB, w, h); - rect = gst_video_overlay_rectangle_new_argb (buf, rx, ry, rw, rh, 0); + GST_VIDEO_OVERLAY_COMPOSITION_FORMAT_YUV, w, h); + rect = gst_video_overlay_rectangle_new_raw (buf, rx, ry, rw, rh, 0); g_assert (rect); if (comp) { gst_video_overlay_composition_add_rectangle (comp, rect); |