A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
2010-03-08 20:02:19 +00:00
|
|
|
* Copyright (C) <2010> Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
2009-01-28 10:29:42 +00:00
|
|
|
/**
|
|
|
|
* SECTION:element-videobox
|
|
|
|
* @see_also: #GstVideoCrop
|
|
|
|
*
|
|
|
|
* This plugin crops or enlarges the image. It takes 4 values as input, a
|
|
|
|
* top, bottom, left and right offset. Positive values will crop that much
|
|
|
|
* pixels from the respective border of the image, negative values will add
|
|
|
|
* that much pixels. When pixels are added, you can specify their color.
|
|
|
|
* Some predefined colors are usable with an enum property.
|
|
|
|
*
|
|
|
|
* The plugin is alpha channel aware and will try to negotiate with a format
|
|
|
|
* that supports alpha channels first. When alpha channel is active two
|
|
|
|
* other properties, alpha and border_alpha can be used to set the alpha
|
|
|
|
* values of the inner picture and the border respectively. an alpha value of
|
|
|
|
* 0.0 means total transparency, 1.0 is opaque.
|
|
|
|
*
|
|
|
|
* The videobox plugin has many uses such as doing a mosaic of pictures,
|
|
|
|
* letterboxing video, cutting out pieces of video, picture in picture, etc..
|
2009-08-14 11:40:21 +00:00
|
|
|
*
|
|
|
|
* Setting autocrop to true changes the behavior of the plugin so that
|
|
|
|
* caps determine crop properties rather than the other way around: given
|
|
|
|
* input and output dimensions, the crop values are selected so that the
|
|
|
|
* smaller frame is effectively centered in the larger frame. This
|
|
|
|
* involves either cropping or padding.
|
|
|
|
*
|
|
|
|
* If you use autocrop there is little point in setting the other
|
|
|
|
* properties manually because they will be overriden if the caps change,
|
|
|
|
* but nothing stops you from doing so.
|
|
|
|
*
|
|
|
|
* Sample pipeline:
|
|
|
|
* |[
|
|
|
|
* gst-launch videotestsrc ! videobox autocrop=true ! \
|
|
|
|
* "video/x-raw-yuv, width=600, height=400" ! ffmpegcolorspace ! ximagesink
|
|
|
|
* ]|
|
2009-01-28 10:29:42 +00:00
|
|
|
*/
|
2009-08-14 11:15:57 +00:00
|
|
|
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2009-08-14 11:40:21 +00:00
|
|
|
|
|
|
|
#include "gstvideobox.h"
|
|
|
|
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
#include <math.h>
|
2005-10-26 17:23:06 +00:00
|
|
|
#include <liboil/liboil.h>
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2010-03-08 19:20:59 +00:00
|
|
|
#include <gst/controller/gstcontroller.h>
|
|
|
|
|
2006-06-22 19:31:04 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (videobox_debug);
|
2005-10-24 13:22:14 +00:00
|
|
|
#define GST_CAT_DEFAULT videobox_debug
|
|
|
|
|
2010-03-22 15:58:26 +00:00
|
|
|
/* From videotestsrc.c */
|
2010-04-07 14:24:38 +00:00
|
|
|
static const guint8 yuv_sdtv_colors_Y[VIDEO_BOX_FILL_LAST] =
|
|
|
|
{ 16, 145, 41, 81, 210, 235 };
|
|
|
|
static const guint8 yuv_sdtv_colors_U[VIDEO_BOX_FILL_LAST] =
|
|
|
|
{ 128, 54, 240, 90, 16, 128 };
|
|
|
|
static const guint8 yuv_sdtv_colors_V[VIDEO_BOX_FILL_LAST] =
|
|
|
|
{ 128, 34, 110, 240, 146, 128 };
|
|
|
|
|
|
|
|
static const guint8 yuv_hdtv_colors_Y[VIDEO_BOX_FILL_LAST] =
|
|
|
|
{ 16, 173, 32, 63, 219, 235 };
|
|
|
|
static const guint8 yuv_hdtv_colors_U[VIDEO_BOX_FILL_LAST] =
|
|
|
|
{ 128, 42, 240, 102, 16, 128 };
|
|
|
|
static const guint8 yuv_hdtv_colors_V[VIDEO_BOX_FILL_LAST] =
|
|
|
|
{ 128, 26, 118, 240, 138, 128 };
|
|
|
|
|
|
|
|
static const guint8 rgb_colors_R[VIDEO_BOX_FILL_LAST] =
|
|
|
|
{ 0, 0, 0, 255, 255, 255 };
|
|
|
|
static const guint8 rgb_colors_G[VIDEO_BOX_FILL_LAST] =
|
|
|
|
{ 0, 255, 0, 0, 255, 255 };
|
|
|
|
static const guint8 rgb_colors_B[VIDEO_BOX_FILL_LAST] =
|
|
|
|
{ 0, 0, 255, 0, 0, 255 };
|
2010-03-22 15:58:26 +00:00
|
|
|
|
|
|
|
/* Generated by -bad/ext/cog/generate_tables */
|
|
|
|
static const int cog_ycbcr_to_rgb_matrix_8bit_hdtv[] = {
|
|
|
|
298, 0, 459, -63514,
|
|
|
|
298, -55, -136, 19681,
|
|
|
|
298, 541, 0, -73988,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const int cog_ycbcr_to_rgb_matrix_8bit_sdtv[] = {
|
|
|
|
298, 0, 409, -57068,
|
|
|
|
298, -100, -208, 34707,
|
|
|
|
298, 516, 0, -70870,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const gint cog_rgb_to_ycbcr_matrix_8bit_hdtv[] = {
|
|
|
|
47, 157, 16, 4096,
|
|
|
|
-26, -87, 112, 32768,
|
|
|
|
112, -102, -10, 32768,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const gint cog_rgb_to_ycbcr_matrix_8bit_sdtv[] = {
|
|
|
|
66, 129, 25, 4096,
|
|
|
|
-38, -74, 112, 32768,
|
|
|
|
112, -94, -18, 32768,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const gint cog_ycbcr_sdtv_to_ycbcr_hdtv_matrix_8bit[] = {
|
|
|
|
256, -30, -53, 10600,
|
|
|
|
0, 261, 29, -4367,
|
|
|
|
0, 19, 262, -3289,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const gint cog_ycbcr_hdtv_to_ycbcr_sdtv_matrix_8bit[] = {
|
|
|
|
256, 25, 49, -9536,
|
|
|
|
0, 253, -28, 3958,
|
|
|
|
0, -19, 252, 2918,
|
|
|
|
};
|
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
static const gint cog_identity_matrix_8bit[] = {
|
|
|
|
256, 0, 0, 0,
|
|
|
|
0, 256, 0, 0,
|
|
|
|
0, 0, 256, 0,
|
|
|
|
};
|
|
|
|
|
2010-03-22 15:58:26 +00:00
|
|
|
#define APPLY_MATRIX(m,o,v1,v2,v3) ((m[o*4] * v1 + m[o*4+1] * v2 + m[o*4+2] * v3 + m[o*4+3]) >> 8)
|
|
|
|
|
|
|
|
static void
|
2010-04-05 13:51:13 +00:00
|
|
|
fill_ayuv (GstVideoBoxFill fill_type, guint b_alpha, GstVideoFormat format,
|
|
|
|
guint8 * dest, gboolean sdtv, gint width, gint height)
|
2010-03-22 15:58:26 +00:00
|
|
|
{
|
|
|
|
guint32 empty_pixel;
|
|
|
|
|
2010-04-12 09:25:59 +00:00
|
|
|
b_alpha = CLAMP (b_alpha, 0, 255);
|
|
|
|
|
2010-03-22 15:58:26 +00:00
|
|
|
if (sdtv)
|
|
|
|
empty_pixel = GUINT32_FROM_BE ((b_alpha << 24) |
|
|
|
|
(yuv_sdtv_colors_Y[fill_type] << 16) |
|
|
|
|
(yuv_sdtv_colors_U[fill_type] << 8) | yuv_sdtv_colors_V[fill_type]);
|
|
|
|
else
|
|
|
|
empty_pixel = GUINT32_FROM_BE ((b_alpha << 24) |
|
|
|
|
(yuv_hdtv_colors_Y[fill_type] << 16) |
|
|
|
|
(yuv_hdtv_colors_U[fill_type] << 8) | yuv_hdtv_colors_V[fill_type]);
|
|
|
|
|
2010-03-26 09:31:22 +00:00
|
|
|
oil_splat_u32_ns ((guint32 *) dest, &empty_pixel, width * height);
|
2010-03-22 15:58:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-04-05 13:51:13 +00:00
|
|
|
copy_ayuv_ayuv (guint i_alpha, GstVideoFormat dest_format, guint8 * dest,
|
|
|
|
gboolean dest_sdtv, gint dest_width, gint dest_height, gint dest_x,
|
|
|
|
gint dest_y, GstVideoFormat src_format, const guint8 * src,
|
|
|
|
gboolean src_sdtv, gint src_width, gint src_height, gint src_x, gint src_y,
|
|
|
|
gint w, gint h)
|
2010-03-22 15:58:26 +00:00
|
|
|
{
|
|
|
|
gint i, j;
|
|
|
|
gint src_stride = 4 * src_width;
|
|
|
|
gint dest_stride = 4 * dest_width;
|
|
|
|
|
|
|
|
dest = dest + dest_y * dest_width * 4 + dest_x * 4;
|
|
|
|
src = src + src_y * src_width * 4 + src_x * 4;
|
|
|
|
|
|
|
|
w *= 4;
|
|
|
|
|
|
|
|
if (dest_sdtv != src_sdtv) {
|
|
|
|
gint matrix[12];
|
|
|
|
gint y, u, v;
|
|
|
|
|
|
|
|
memcpy (matrix,
|
|
|
|
dest_sdtv ? cog_ycbcr_hdtv_to_ycbcr_sdtv_matrix_8bit :
|
|
|
|
cog_ycbcr_sdtv_to_ycbcr_hdtv_matrix_8bit, 12 * sizeof (gint));
|
|
|
|
|
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
for (j = 0; j < w; j += 4) {
|
|
|
|
dest[j] = (src[j] * i_alpha) >> 8;
|
|
|
|
y = src[j + 1];
|
|
|
|
u = src[j + 2];
|
|
|
|
v = src[j + 3];
|
|
|
|
dest[j + 1] = APPLY_MATRIX (matrix, 0, y, u, v);
|
|
|
|
dest[j + 2] = APPLY_MATRIX (matrix, 1, y, u, v);
|
|
|
|
dest[j + 3] = APPLY_MATRIX (matrix, 2, y, u, v);
|
|
|
|
}
|
|
|
|
dest += dest_stride;
|
|
|
|
src += src_stride;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
for (j = 0; j < w; j += 4) {
|
|
|
|
dest[j] = (src[j] * i_alpha) >> 8;
|
|
|
|
dest[j + 1] = src[j + 1];
|
|
|
|
dest[j + 2] = src[j + 2];
|
|
|
|
dest[j + 3] = src[j + 3];
|
|
|
|
}
|
|
|
|
dest += dest_stride;
|
|
|
|
src += src_stride;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-04-05 13:51:13 +00:00
|
|
|
copy_ayuv_i420 (guint i_alpha, GstVideoFormat dest_format, guint8 * dest,
|
|
|
|
gboolean dest_sdtv, gint dest_width, gint dest_height, gint dest_x,
|
|
|
|
gint dest_y, GstVideoFormat src_format, const guint8 * src,
|
|
|
|
gboolean src_sdtv, gint src_width, gint src_height, gint src_x, gint src_y,
|
|
|
|
gint w, gint h)
|
2010-03-22 15:58:26 +00:00
|
|
|
{
|
|
|
|
gint i, j;
|
2010-04-13 16:15:50 +00:00
|
|
|
guint8 *destY, *destY2, *destU, *destV;
|
2010-03-22 15:58:26 +00:00
|
|
|
gint dest_strideY, dest_strideUV;
|
2010-04-13 16:15:50 +00:00
|
|
|
const guint8 *src2;
|
|
|
|
gint src_stride;
|
|
|
|
gint y_idx, uv_idx;
|
|
|
|
gint y1, y2, y3, y4;
|
|
|
|
gint u1, u2, u3, u4;
|
|
|
|
gint v1, v2, v3, v4;
|
|
|
|
gint matrix[12];
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-07 15:43:56 +00:00
|
|
|
dest_strideY = gst_video_format_get_row_stride (dest_format, 0, dest_width);
|
|
|
|
dest_strideUV = gst_video_format_get_row_stride (dest_format, 1, dest_width);
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
src_stride = 4 * src_width;
|
|
|
|
|
2010-03-22 15:58:26 +00:00
|
|
|
destY =
|
2010-04-07 15:43:56 +00:00
|
|
|
dest + gst_video_format_get_component_offset (dest_format, 0,
|
2010-03-22 15:58:26 +00:00
|
|
|
dest_width, dest_height);
|
|
|
|
destU =
|
2010-04-07 15:43:56 +00:00
|
|
|
dest + gst_video_format_get_component_offset (dest_format, 1,
|
2010-03-22 15:58:26 +00:00
|
|
|
dest_width, dest_height);
|
|
|
|
destV =
|
2010-04-07 15:43:56 +00:00
|
|
|
dest + gst_video_format_get_component_offset (dest_format, 2,
|
2010-03-22 15:58:26 +00:00
|
|
|
dest_width, dest_height);
|
|
|
|
|
|
|
|
destY = destY + dest_y * dest_strideY + dest_x;
|
2010-04-13 16:15:50 +00:00
|
|
|
destY2 = (dest_y < dest_height) ? destY + dest_strideY : destY;
|
2010-03-22 15:58:26 +00:00
|
|
|
destU = destU + (dest_y / 2) * dest_strideUV + dest_x / 2;
|
|
|
|
destV = destV + (dest_y / 2) * dest_strideUV + dest_x / 2;
|
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
src = src + src_y * src_stride + src_x * 4;
|
|
|
|
src2 = (src_y < src_height) ? src + src_stride : src;
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
h = dest_y + h;
|
|
|
|
w = dest_x + w;
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
if (src_sdtv != dest_sdtv)
|
2010-03-22 15:58:26 +00:00
|
|
|
memcpy (matrix,
|
|
|
|
dest_sdtv ? cog_ycbcr_hdtv_to_ycbcr_sdtv_matrix_8bit :
|
|
|
|
cog_ycbcr_sdtv_to_ycbcr_hdtv_matrix_8bit, 12 * sizeof (gint));
|
2010-04-13 16:15:50 +00:00
|
|
|
else
|
|
|
|
memcpy (matrix, cog_identity_matrix_8bit, 12 * sizeof (gint));
|
|
|
|
|
|
|
|
/* 1. Handle the first destination scanline specially if it
|
|
|
|
* doesn't start at the macro pixel boundary, i.e. blend
|
|
|
|
* with the background! */
|
|
|
|
if (dest_y % 2 == 1) {
|
|
|
|
/* 1.1. Handle the first destination pixel if it doesn't
|
|
|
|
* start at the macro pixel boundary, i.e. blend with
|
|
|
|
* the background! */
|
|
|
|
if (dest_x % 2 == 1) {
|
|
|
|
y1 = src[4 * 0 + 1];
|
|
|
|
u1 = src[4 * 0 + 2];
|
|
|
|
v1 = src[4 * 0 + 3];
|
|
|
|
|
|
|
|
destY[0] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[0] =
|
|
|
|
CLAMP ((3 * destU[0] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 4, 0,
|
|
|
|
255);
|
|
|
|
destV[0] =
|
|
|
|
CLAMP ((3 * destV[0] + APPLY_MATRIX (matrix, 2, y1, u1, v1)) / 4, 0,
|
|
|
|
255);
|
|
|
|
|
|
|
|
j = dest_x + 1;
|
|
|
|
y_idx = uv_idx = 1;
|
|
|
|
} else {
|
|
|
|
j = dest_x;
|
|
|
|
y_idx = uv_idx = 0;
|
|
|
|
}
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
/* 1.2. Copy all macro pixels from the source to the destination
|
|
|
|
* but blend with the background because we're only filling
|
|
|
|
* the lower part of the macro pixels. */
|
|
|
|
for (; j < w - 1; j += 2) {
|
|
|
|
y1 = src[4 * y_idx + 1];
|
|
|
|
y2 = src[4 * y_idx + 4 + 1];
|
|
|
|
|
|
|
|
u1 = src[4 * y_idx + 2];
|
|
|
|
u2 = src[4 * y_idx + 4 + 2];
|
|
|
|
|
|
|
|
v1 = src[4 * y_idx + 3];
|
|
|
|
v2 = src[4 * y_idx + 4 + 3];
|
|
|
|
|
|
|
|
destY[y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destY[y_idx + 1] = CLAMP (APPLY_MATRIX (matrix, 0, y2, u2, v2), 0, 255);
|
|
|
|
destU[uv_idx] = CLAMP (
|
|
|
|
(2 * destU[uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 1, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
destV[uv_idx] = CLAMP (
|
|
|
|
(2 * destV[uv_idx] + APPLY_MATRIX (matrix, 2, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 2, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
|
|
|
|
y_idx += 2;
|
|
|
|
uv_idx++;
|
|
|
|
}
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
/* 1.3. Now copy the last pixel if one exists and blend it
|
|
|
|
* with the background because we only fill part of
|
|
|
|
* the macro pixel. In case this is the last pixel of
|
|
|
|
* the destination we will a larger part. */
|
|
|
|
if (j == w - 1 && j == dest_width - 1) {
|
|
|
|
y1 = src[4 * y_idx + 1];
|
|
|
|
u1 = src[4 * y_idx + 2];
|
|
|
|
v1 = src[4 * y_idx + 3];
|
|
|
|
|
|
|
|
destY[y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[uv_idx] = CLAMP (
|
|
|
|
(destU[uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 2, 0, 255);
|
|
|
|
destV[uv_idx] = CLAMP (
|
|
|
|
(destV[uv_idx] + APPLY_MATRIX (matrix, 2, y1, u1, v1)) / 2, 0, 255);
|
|
|
|
} else if (j == w - 1) {
|
|
|
|
y1 = src[4 * y_idx + 1];
|
|
|
|
u1 = src[4 * y_idx + 2];
|
|
|
|
v1 = src[4 * y_idx + 3];
|
|
|
|
|
|
|
|
destY[y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[uv_idx] = CLAMP (
|
|
|
|
(3 * destU[uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 4, 0,
|
|
|
|
255);
|
|
|
|
destV[uv_idx] =
|
|
|
|
CLAMP ((3 * destV[uv_idx] + APPLY_MATRIX (matrix, 2, y1, u1, v1)) / 4,
|
|
|
|
0, 255);
|
|
|
|
}
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
destY += dest_strideY;
|
|
|
|
destY2 += dest_strideY;
|
|
|
|
destU += dest_strideUV;
|
|
|
|
destV += dest_strideUV;
|
|
|
|
src += src_stride;
|
|
|
|
src2 += src_stride;
|
|
|
|
i = dest_y + 1;
|
|
|
|
} else {
|
|
|
|
i = dest_y;
|
|
|
|
}
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
/* 2. Copy all macro pixel scanlines, the destination scanline
|
|
|
|
* now starts at macro pixel boundary. */
|
|
|
|
for (; i < h - 1; i += 2) {
|
|
|
|
/* 2.1. Handle the first destination pixel if it doesn't
|
|
|
|
* start at the macro pixel boundary, i.e. blend with
|
|
|
|
* the background! */
|
|
|
|
if (dest_x % 2 == 1) {
|
|
|
|
y1 = src[4 * 0 + 1];
|
|
|
|
y2 = src2[4 * 0 + 1];
|
|
|
|
u1 = src[4 * 0 + 2];
|
|
|
|
u2 = src2[4 * 0 + 2];
|
|
|
|
v1 = src[4 * 0 + 3];
|
|
|
|
v2 = src2[4 * 0 + 3];
|
|
|
|
|
|
|
|
destY[0] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destY2[0] = CLAMP (APPLY_MATRIX (matrix, 0, y2, u2, v2), 0, 255);
|
|
|
|
destU[0] = CLAMP (
|
|
|
|
(2 * destU[0] + APPLY_MATRIX (matrix, 1, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 1, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
destV[0] = CLAMP (
|
|
|
|
(2 * destV[0] + APPLY_MATRIX (matrix, 2, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 2, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
j = dest_x + 1;
|
|
|
|
y_idx = uv_idx = 1;
|
|
|
|
} else {
|
|
|
|
j = dest_x;
|
|
|
|
y_idx = uv_idx = 0;
|
|
|
|
}
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
/* 2.2. Copy all macro pixels from the source to the destination.
|
|
|
|
* All pixels now start at macro pixel boundary, i.e. no
|
|
|
|
* blending with the background is necessary. */
|
|
|
|
for (; j < w - 1; j += 2) {
|
|
|
|
y1 = src[4 * y_idx + 1];
|
|
|
|
y2 = src[4 * y_idx + 4 + 1];
|
|
|
|
y3 = src2[4 * y_idx + 1];
|
|
|
|
y4 = src2[4 * y_idx + 4 + 1];
|
|
|
|
|
|
|
|
u1 = src[4 * y_idx + 2];
|
|
|
|
u2 = src[4 * y_idx + 4 + 2];
|
|
|
|
u3 = src2[4 * y_idx + 2];
|
|
|
|
u4 = src2[4 * y_idx + 4 + 2];
|
|
|
|
|
|
|
|
v1 = src[4 * y_idx + 3];
|
|
|
|
v2 = src[4 * y_idx + 4 + 3];
|
|
|
|
v3 = src2[4 * y_idx + 3];
|
|
|
|
v4 = src2[4 * y_idx + 4 + 3];
|
|
|
|
|
|
|
|
destY[y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destY[y_idx + 1] = CLAMP (APPLY_MATRIX (matrix, 0, y2, u2, v2), 0, 255);
|
|
|
|
destY2[y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y3, u3, v3), 0, 255);
|
|
|
|
destY2[y_idx + 1] = CLAMP (APPLY_MATRIX (matrix, 0, y4, u4, v4), 0, 255);
|
|
|
|
|
|
|
|
destU[uv_idx] = CLAMP (
|
|
|
|
(APPLY_MATRIX (matrix, 1, y1, u1, v1) + APPLY_MATRIX (matrix, 1, y2,
|
|
|
|
u2, v2) + APPLY_MATRIX (matrix, 1, y3, u3,
|
|
|
|
v3) + APPLY_MATRIX (matrix, 1, y4, u4, v4)) / 4, 0, 255);
|
|
|
|
destV[uv_idx] = CLAMP (
|
|
|
|
(APPLY_MATRIX (matrix, 2, y1, u1, v1) + APPLY_MATRIX (matrix, 2, y2,
|
|
|
|
u2, v2) + APPLY_MATRIX (matrix, 2, y3, u3,
|
|
|
|
v3) + APPLY_MATRIX (matrix, 2, y4, u4, v4)) / 4, 0, 255);
|
|
|
|
|
|
|
|
y_idx += 2;
|
|
|
|
uv_idx++;
|
|
|
|
}
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
/* 2.3. Now copy the last pixel if one exists and blend it
|
|
|
|
* with the background because we only fill part of
|
|
|
|
* the macro pixel. In case this is the last pixel of
|
|
|
|
* the destination we will a larger part. */
|
|
|
|
if (j == w - 1 && j == dest_width - 1) {
|
|
|
|
y1 = src[4 * y_idx + 1];
|
|
|
|
y2 = src2[4 * y_idx + 1];
|
|
|
|
|
|
|
|
u1 = src[4 * y_idx + 2];
|
|
|
|
u2 = src2[4 * y_idx + 2];
|
|
|
|
|
|
|
|
v1 = src[4 * y_idx + 3];
|
|
|
|
v2 = src2[4 * y_idx + 3];
|
|
|
|
|
|
|
|
destY[y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destY2[y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y2, u2, v2), 0, 255);
|
|
|
|
destU[uv_idx] = CLAMP (
|
|
|
|
(APPLY_MATRIX (matrix, 1, y1, u1, v1) + APPLY_MATRIX (matrix, 2, y2,
|
|
|
|
u2, v2)) / 2, 0, 255);
|
|
|
|
destV[uv_idx] = CLAMP (
|
|
|
|
(APPLY_MATRIX (matrix, 1, y1, u1, v1) + APPLY_MATRIX (matrix, 2, y2,
|
|
|
|
u2, v2)) / 2, 0, 255);
|
|
|
|
} else if (j == w - 1) {
|
|
|
|
y1 = src[4 * y_idx + 1];
|
|
|
|
y2 = src2[4 * y_idx + 1];
|
|
|
|
|
|
|
|
u1 = src[4 * y_idx + 2];
|
|
|
|
u2 = src2[4 * y_idx + 2];
|
|
|
|
|
|
|
|
v1 = src[4 * y_idx + 3];
|
|
|
|
v2 = src2[4 * y_idx + 3];
|
|
|
|
|
|
|
|
destY[y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destY2[y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y2, u2, v2), 0, 255);
|
|
|
|
destU[uv_idx] = CLAMP (
|
|
|
|
(2 * destU[uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 2, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
destV[uv_idx] = CLAMP (
|
|
|
|
(2 * destV[uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 2, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
}
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
destY += 2 * dest_strideY;
|
|
|
|
destY2 += 2 * dest_strideY;
|
|
|
|
destU += dest_strideUV;
|
|
|
|
destV += dest_strideUV;
|
|
|
|
src += 2 * src_stride;
|
|
|
|
src2 += 2 * src_stride;
|
|
|
|
}
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
/* 3. Handle the last scanline if one exists. This again
|
|
|
|
* doesn't start at macro pixel boundary but should
|
|
|
|
* only fill the upper part of the macro pixels. */
|
|
|
|
if (i == h - 1 && i == dest_height - 1) {
|
|
|
|
/* 3.1. Handle the first destination pixel if it doesn't
|
|
|
|
* start at the macro pixel boundary, i.e. blend with
|
|
|
|
* the background! */
|
|
|
|
if (dest_x % 2 == 1) {
|
|
|
|
y1 = src[4 * 0 + 1];
|
|
|
|
u1 = src[4 * 0 + 2];
|
|
|
|
v1 = src[4 * 0 + 3];
|
|
|
|
|
|
|
|
destY[0] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[0] =
|
|
|
|
CLAMP ((destU[0] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 2, 0, 255);
|
|
|
|
destV[0] =
|
|
|
|
CLAMP ((destV[0] + APPLY_MATRIX (matrix, 2, y1, u1, v1)) / 2, 0, 255);
|
|
|
|
|
|
|
|
j = dest_x + 1;
|
|
|
|
y_idx = uv_idx = 1;
|
|
|
|
} else {
|
|
|
|
j = dest_x;
|
|
|
|
y_idx = uv_idx = 0;
|
2010-03-22 15:58:26 +00:00
|
|
|
}
|
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
/* 3.2. Copy all macro pixels from the source to the destination
|
|
|
|
* but blend with the background because we're only filling
|
|
|
|
* the upper part of the macro pixels. */
|
|
|
|
for (; j < w - 1; j += 2) {
|
|
|
|
y1 = src[4 * y_idx + 1];
|
|
|
|
y2 = src[4 * y_idx + 4 + 1];
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
u1 = src[4 * y_idx + 2];
|
|
|
|
u2 = src[4 * y_idx + 4 + 2];
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
v1 = src[4 * y_idx + 3];
|
|
|
|
v2 = src[4 * y_idx + 4 + 3];
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
destY[y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destY[y_idx + 1] = CLAMP (APPLY_MATRIX (matrix, 0, y2, u2, v2), 0, 255);
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
destU[uv_idx] = CLAMP (
|
|
|
|
(2 * destU[uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 1, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
destV[uv_idx] = CLAMP (
|
|
|
|
(2 * destV[uv_idx] + APPLY_MATRIX (matrix, 2, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 2, y2, u2, v2)) / 4, 0, 255);
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-13 16:15:50 +00:00
|
|
|
y_idx += 2;
|
|
|
|
uv_idx++;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 3.3. Now copy the last pixel if one exists and blend it
|
|
|
|
* with the background because we only fill part of
|
|
|
|
* the macro pixel. In case this is the last pixel of
|
|
|
|
* the destination we will a larger part. */
|
|
|
|
if (j == w - 1 && j == dest_width - 1) {
|
|
|
|
y1 = src[4 * y_idx + 1];
|
|
|
|
u1 = src[4 * y_idx + 2];
|
|
|
|
v1 = src[4 * y_idx + 3];
|
|
|
|
|
|
|
|
destY[y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[uv_idx] = CLAMP (
|
|
|
|
(destU[uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 2, 0, 255);
|
|
|
|
destV[uv_idx] = CLAMP (
|
|
|
|
(destV[uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 2, 0, 255);
|
|
|
|
} else if (j == w - 1) {
|
|
|
|
y1 = src[4 * y_idx + 1];
|
|
|
|
u1 = src[4 * y_idx + 2];
|
|
|
|
v1 = src[4 * y_idx + 3];
|
|
|
|
|
|
|
|
destY[y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[uv_idx] = CLAMP (
|
|
|
|
(3 * destU[uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 4, 0,
|
|
|
|
255);
|
|
|
|
destV[uv_idx] =
|
|
|
|
CLAMP ((3 * destV[uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 4,
|
|
|
|
0, 255);
|
|
|
|
}
|
|
|
|
} else if (i == h - 1) {
|
|
|
|
/* 3.1. Handle the first destination pixel if it doesn't
|
|
|
|
* start at the macro pixel boundary, i.e. blend with
|
|
|
|
* the background! */
|
|
|
|
if (dest_x % 2 == 1) {
|
|
|
|
y1 = src[4 * 0 + 1];
|
|
|
|
u1 = src[4 * 0 + 2];
|
|
|
|
v1 = src[4 * 0 + 3];
|
|
|
|
|
|
|
|
destY[0] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[0] =
|
|
|
|
CLAMP ((3 * destU[0] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 4, 0,
|
|
|
|
255);
|
|
|
|
destV[0] =
|
|
|
|
CLAMP ((3 * destV[0] + APPLY_MATRIX (matrix, 2, y1, u1, v1)) / 4, 0,
|
|
|
|
255);
|
|
|
|
|
|
|
|
j = dest_x + 1;
|
|
|
|
y_idx = uv_idx = 1;
|
|
|
|
} else {
|
|
|
|
j = dest_x;
|
|
|
|
y_idx = uv_idx = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 3.2. Copy all macro pixels from the source to the destination
|
|
|
|
* but blend with the background because we're only filling
|
|
|
|
* the upper part of the macro pixels. */
|
|
|
|
for (; j < w - 1; j += 2) {
|
|
|
|
y1 = src[4 * y_idx + 1];
|
|
|
|
y2 = src[4 * y_idx + 4 + 1];
|
|
|
|
|
|
|
|
u1 = src[4 * y_idx + 2];
|
|
|
|
u2 = src[4 * y_idx + 4 + 2];
|
|
|
|
|
|
|
|
v1 = src[4 * y_idx + 3];
|
|
|
|
v2 = src[4 * y_idx + 4 + 3];
|
|
|
|
|
|
|
|
destY[y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destY[y_idx + 1] = CLAMP (APPLY_MATRIX (matrix, 0, y2, u2, v2), 0, 255);
|
|
|
|
|
|
|
|
destU[uv_idx] = CLAMP (
|
|
|
|
(2 * destU[uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 1, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
destV[uv_idx] = CLAMP (
|
|
|
|
(2 * destV[uv_idx] + APPLY_MATRIX (matrix, 2, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 2, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
|
|
|
|
y_idx += 2;
|
|
|
|
uv_idx++;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 3.3. Now copy the last pixel if one exists and blend it
|
|
|
|
* with the background because we only fill part of
|
|
|
|
* the macro pixel. In case this is the last pixel of
|
|
|
|
* the destination we will a larger part. */
|
|
|
|
if (j == w - 1 && j == dest_width - 1) {
|
|
|
|
y1 = src[4 * y_idx + 1];
|
|
|
|
u1 = src[4 * y_idx + 2];
|
|
|
|
v1 = src[4 * y_idx + 3];
|
|
|
|
|
|
|
|
destY[y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[uv_idx] = CLAMP (
|
|
|
|
(destU[uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 2, 0, 255);
|
|
|
|
destV[uv_idx] = CLAMP (
|
|
|
|
(destV[uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 2, 0, 255);
|
|
|
|
} else if (j == w - 1) {
|
|
|
|
y1 = src[4 * y_idx + 1];
|
|
|
|
u1 = src[4 * y_idx + 2];
|
|
|
|
v1 = src[4 * y_idx + 3];
|
|
|
|
|
|
|
|
destY[y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[uv_idx] = CLAMP (
|
|
|
|
(3 * destU[uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 4, 0,
|
|
|
|
255);
|
|
|
|
destV[uv_idx] =
|
|
|
|
CLAMP ((3 * destV[uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 4,
|
|
|
|
0, 255);
|
2010-03-22 15:58:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-04-05 13:51:13 +00:00
|
|
|
fill_i420 (GstVideoBoxFill fill_type, guint b_alpha, GstVideoFormat format,
|
|
|
|
guint8 * dest, gboolean sdtv, gint width, gint height)
|
2010-03-22 15:58:26 +00:00
|
|
|
{
|
|
|
|
guint8 empty_pixel[3];
|
|
|
|
guint8 *destY, *destU, *destV;
|
|
|
|
gint strideY, strideUV;
|
|
|
|
gint heightY, heightUV;
|
|
|
|
|
|
|
|
if (sdtv) {
|
|
|
|
empty_pixel[0] = yuv_sdtv_colors_Y[fill_type];
|
|
|
|
empty_pixel[1] = yuv_sdtv_colors_U[fill_type];
|
|
|
|
empty_pixel[2] = yuv_sdtv_colors_V[fill_type];
|
|
|
|
} else {
|
|
|
|
empty_pixel[0] = yuv_hdtv_colors_Y[fill_type];
|
|
|
|
empty_pixel[1] = yuv_hdtv_colors_U[fill_type];
|
|
|
|
empty_pixel[2] = yuv_hdtv_colors_V[fill_type];
|
|
|
|
}
|
|
|
|
|
|
|
|
strideY = gst_video_format_get_row_stride (GST_VIDEO_FORMAT_I420, 0, width);
|
|
|
|
strideUV = gst_video_format_get_row_stride (GST_VIDEO_FORMAT_I420, 1, width);
|
|
|
|
|
|
|
|
destY =
|
|
|
|
dest + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 0,
|
|
|
|
width, height);
|
|
|
|
destU =
|
2010-04-07 15:43:56 +00:00
|
|
|
dest + gst_video_format_get_component_offset (format, 1, width, height);
|
2010-03-22 15:58:26 +00:00
|
|
|
destV =
|
2010-04-07 15:43:56 +00:00
|
|
|
dest + gst_video_format_get_component_offset (format, 2, width, height);
|
2010-03-22 15:58:26 +00:00
|
|
|
|
|
|
|
heightY =
|
|
|
|
gst_video_format_get_component_height (GST_VIDEO_FORMAT_I420, 0, height);
|
|
|
|
heightUV =
|
|
|
|
gst_video_format_get_component_height (GST_VIDEO_FORMAT_I420, 1, height);
|
|
|
|
|
2010-03-26 09:31:22 +00:00
|
|
|
oil_splat_u8_ns (destY, &empty_pixel[0], strideY * heightY);
|
|
|
|
oil_splat_u8_ns (destU, &empty_pixel[1], strideUV * heightUV);
|
|
|
|
oil_splat_u8_ns (destV, &empty_pixel[2], strideUV * heightUV);
|
2010-03-22 15:58:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-04-05 13:51:13 +00:00
|
|
|
copy_i420_i420 (guint i_alpha, GstVideoFormat dest_format, guint8 * dest,
|
|
|
|
gboolean dest_sdtv, gint dest_width, gint dest_height, gint dest_x,
|
|
|
|
gint dest_y, GstVideoFormat src_format, const guint8 * src,
|
|
|
|
gboolean src_sdtv, gint src_width, gint src_height, gint src_x, gint src_y,
|
|
|
|
gint w, gint h)
|
2010-03-22 15:58:26 +00:00
|
|
|
{
|
2010-04-16 13:27:12 +00:00
|
|
|
gint i, j;
|
2010-03-22 15:58:26 +00:00
|
|
|
guint8 *destY, *destU, *destV;
|
|
|
|
const guint8 *srcY, *srcU, *srcV;
|
2010-04-16 13:27:12 +00:00
|
|
|
guint8 *destY2;
|
|
|
|
const guint8 *srcY2, *srcU2, *srcV2;
|
2010-03-22 15:58:26 +00:00
|
|
|
gint dest_strideY, dest_strideUV;
|
|
|
|
gint src_strideY, src_strideUV;
|
2010-04-16 13:27:12 +00:00
|
|
|
gint src_y_idx, src_uv_idx;
|
|
|
|
gint dest_y_idx, dest_uv_idx;
|
|
|
|
gint matrix[12];
|
|
|
|
gint y1, y2, y3, y4;
|
|
|
|
gint u1, u2, u3, u4;
|
|
|
|
gint v1, v2, v3, v4;
|
2010-03-22 15:58:26 +00:00
|
|
|
|
|
|
|
dest_strideY =
|
|
|
|
gst_video_format_get_row_stride (GST_VIDEO_FORMAT_I420, 0, dest_width);
|
|
|
|
dest_strideUV =
|
|
|
|
gst_video_format_get_row_stride (GST_VIDEO_FORMAT_I420, 1, dest_width);
|
|
|
|
src_strideY =
|
|
|
|
gst_video_format_get_row_stride (GST_VIDEO_FORMAT_I420, 0, src_width);
|
|
|
|
src_strideUV =
|
|
|
|
gst_video_format_get_row_stride (GST_VIDEO_FORMAT_I420, 1, src_width);
|
|
|
|
|
|
|
|
destY =
|
|
|
|
dest + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 0,
|
|
|
|
dest_width, dest_height);
|
|
|
|
destU =
|
2010-04-07 15:43:56 +00:00
|
|
|
dest + gst_video_format_get_component_offset (dest_format, 1,
|
2010-03-22 15:58:26 +00:00
|
|
|
dest_width, dest_height);
|
|
|
|
destV =
|
2010-04-07 15:43:56 +00:00
|
|
|
dest + gst_video_format_get_component_offset (dest_format, 2,
|
2010-03-22 15:58:26 +00:00
|
|
|
dest_width, dest_height);
|
|
|
|
|
|
|
|
srcY =
|
|
|
|
src + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 0,
|
|
|
|
src_width, src_height);
|
|
|
|
srcU =
|
2010-04-07 15:43:56 +00:00
|
|
|
src + gst_video_format_get_component_offset (src_format, 1,
|
2010-03-22 15:58:26 +00:00
|
|
|
src_width, src_height);
|
|
|
|
srcV =
|
2010-04-07 15:43:56 +00:00
|
|
|
src + gst_video_format_get_component_offset (src_format, 2,
|
2010-03-22 15:58:26 +00:00
|
|
|
src_width, src_height);
|
|
|
|
|
|
|
|
|
|
|
|
destY = destY + dest_y * dest_strideY + dest_x;
|
|
|
|
destU = destU + (dest_y / 2) * dest_strideUV + dest_x / 2;
|
|
|
|
destV = destV + (dest_y / 2) * dest_strideUV + dest_x / 2;
|
|
|
|
|
|
|
|
srcY = srcY + src_y * src_strideY + src_x;
|
|
|
|
srcU = srcU + (src_y / 2) * src_strideUV + src_x / 2;
|
|
|
|
srcV = srcV + (src_y / 2) * src_strideUV + src_x / 2;
|
|
|
|
|
2010-04-16 13:27:12 +00:00
|
|
|
destY2 = destY + dest_strideY;
|
|
|
|
srcY2 = srcY + src_strideY;
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-16 13:27:12 +00:00
|
|
|
h = dest_y + h;
|
|
|
|
w = dest_x + w;
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-16 13:27:12 +00:00
|
|
|
if (src_sdtv != dest_sdtv)
|
2010-03-22 15:58:26 +00:00
|
|
|
memcpy (matrix,
|
|
|
|
dest_sdtv ? cog_ycbcr_hdtv_to_ycbcr_sdtv_matrix_8bit :
|
|
|
|
cog_ycbcr_sdtv_to_ycbcr_hdtv_matrix_8bit, 12 * sizeof (gint));
|
2010-04-16 13:27:12 +00:00
|
|
|
else
|
|
|
|
memcpy (matrix, cog_identity_matrix_8bit, 12 * sizeof (gint));
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-16 13:27:12 +00:00
|
|
|
/* 1. Handle the first destination scanline specially if it
|
|
|
|
* doesn't start at the macro pixel boundary, i.e. blend
|
|
|
|
* with the background! */
|
|
|
|
if (dest_y % 2 == 1) {
|
|
|
|
/* 1.1. Handle the first destination pixel if it doesn't
|
|
|
|
* start at the macro pixel boundary, i.e. blend with
|
|
|
|
* the background! */
|
|
|
|
if (dest_x % 2 == 1) {
|
|
|
|
y1 = srcY[0];
|
|
|
|
u1 = srcU[0];
|
|
|
|
v1 = srcV[0];
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-16 13:27:12 +00:00
|
|
|
destY[0] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[0] =
|
|
|
|
CLAMP ((3 * destU[0] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 4, 0,
|
|
|
|
255);
|
|
|
|
destV[0] =
|
|
|
|
CLAMP ((3 * destV[0] + APPLY_MATRIX (matrix, 2, y1, u1, v1)) / 4, 0,
|
|
|
|
255);
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-16 13:27:12 +00:00
|
|
|
j = dest_x + 1;
|
|
|
|
src_y_idx = dest_y_idx = dest_uv_idx = 1;
|
|
|
|
src_uv_idx = (src_x % 2) + 1;
|
|
|
|
} else {
|
|
|
|
j = dest_x;
|
|
|
|
src_y_idx = dest_y_idx = dest_uv_idx = 0;
|
|
|
|
src_uv_idx = (src_x % 2);
|
|
|
|
}
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-16 13:27:12 +00:00
|
|
|
/* 1.2. Copy all macro pixels from the source to the destination
|
|
|
|
* but blend with the background because we're only filling
|
|
|
|
* the lower part of the macro pixels. */
|
|
|
|
for (; j < w - 1; j += 2) {
|
|
|
|
y1 = srcY[src_y_idx];
|
|
|
|
y2 = srcY[src_y_idx + 1];
|
|
|
|
|
|
|
|
u1 = srcU[src_uv_idx / 2];
|
|
|
|
v1 = srcV[src_uv_idx / 2];
|
|
|
|
src_uv_idx++;
|
|
|
|
u2 = srcU[src_uv_idx / 2];
|
|
|
|
v2 = srcV[src_uv_idx / 2];
|
|
|
|
src_uv_idx++;
|
|
|
|
|
|
|
|
destY[dest_y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destY[dest_y_idx + 1] =
|
|
|
|
CLAMP (APPLY_MATRIX (matrix, 0, y2, u2, v2), 0, 255);
|
|
|
|
destU[dest_uv_idx] =
|
|
|
|
CLAMP ((2 * destU[dest_uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 1, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
destV[dest_uv_idx] =
|
|
|
|
CLAMP ((2 * destV[dest_uv_idx] + APPLY_MATRIX (matrix, 2, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 2, y2, u2, v2)) / 4, 0, 255);
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-16 13:27:12 +00:00
|
|
|
dest_y_idx += 2;
|
|
|
|
src_y_idx += 2;
|
|
|
|
dest_uv_idx++;
|
|
|
|
}
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-16 13:27:12 +00:00
|
|
|
/* 1.3. Now copy the last pixel if one exists and blend it
|
|
|
|
* with the background because we only fill part of
|
|
|
|
* the macro pixel. In case this is the last pixel of
|
|
|
|
* the destination we will a larger part. */
|
|
|
|
if (j == w - 1 && j == dest_width - 1) {
|
|
|
|
y1 = srcY[src_y_idx];
|
|
|
|
u1 = srcU[src_uv_idx / 2];
|
|
|
|
v1 = srcV[src_uv_idx / 2];
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-16 13:27:12 +00:00
|
|
|
destY[dest_y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[dest_uv_idx] = CLAMP (
|
|
|
|
(destU[dest_uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 2, 0,
|
|
|
|
255);
|
|
|
|
destV[dest_uv_idx] =
|
|
|
|
CLAMP ((destV[dest_uv_idx] + APPLY_MATRIX (matrix, 2, y1, u1,
|
|
|
|
v1)) / 2, 0, 255);
|
|
|
|
} else if (j == w - 1) {
|
|
|
|
y1 = srcY[src_y_idx];
|
|
|
|
u1 = srcU[src_uv_idx / 2];
|
|
|
|
v1 = srcV[src_uv_idx / 2];
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-16 13:27:12 +00:00
|
|
|
destY[dest_y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[dest_uv_idx] = CLAMP (
|
|
|
|
(3 * destU[dest_uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 4,
|
|
|
|
0, 255);
|
|
|
|
destV[dest_uv_idx] =
|
|
|
|
CLAMP ((3 * destV[dest_uv_idx] + APPLY_MATRIX (matrix, 2, y1, u1,
|
|
|
|
v1)) / 4, 0, 255);
|
|
|
|
}
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-16 13:27:12 +00:00
|
|
|
destY += dest_strideY;
|
|
|
|
destY2 += dest_strideY;
|
|
|
|
destU += dest_strideUV;
|
|
|
|
destV += dest_strideUV;
|
|
|
|
srcY += src_strideY;
|
|
|
|
srcY2 += src_strideY;
|
|
|
|
src_y++;
|
|
|
|
if (src_y % 2 == 0) {
|
2010-03-22 15:58:26 +00:00
|
|
|
srcU += src_strideUV;
|
|
|
|
srcV += src_strideUV;
|
|
|
|
}
|
2010-04-16 13:27:12 +00:00
|
|
|
i = dest_y + 1;
|
2010-03-22 15:58:26 +00:00
|
|
|
} else {
|
2010-04-16 13:27:12 +00:00
|
|
|
i = dest_y;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 2. Copy all macro pixel scanlines, the destination scanline
|
|
|
|
* now starts at macro pixel boundary. */
|
|
|
|
for (; i < h - 1; i += 2) {
|
|
|
|
/* 2.1. Handle the first destination pixel if it doesn't
|
|
|
|
* start at the macro pixel boundary, i.e. blend with
|
|
|
|
* the background! */
|
|
|
|
|
|
|
|
srcU2 = srcU;
|
|
|
|
srcV2 = srcV;
|
|
|
|
if (src_y % 2 == 1) {
|
|
|
|
srcU2 += src_strideUV;
|
|
|
|
srcV2 += src_strideUV;
|
2010-03-22 15:58:26 +00:00
|
|
|
}
|
|
|
|
|
2010-04-16 13:27:12 +00:00
|
|
|
if (dest_x % 2 == 1) {
|
|
|
|
y1 = srcY[0];
|
|
|
|
y2 = srcY2[0];
|
|
|
|
u1 = srcU[0];
|
|
|
|
v1 = srcV[0];
|
|
|
|
u2 = srcU2[0];
|
|
|
|
v2 = srcV2[0];
|
|
|
|
|
|
|
|
destY[0] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destY2[0] = CLAMP (APPLY_MATRIX (matrix, 0, y2, u2, v2), 0, 255);
|
|
|
|
destU[0] = CLAMP (
|
|
|
|
(2 * destU[0] + APPLY_MATRIX (matrix, 1, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 1, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
destV[0] = CLAMP (
|
|
|
|
(2 * destV[0] + APPLY_MATRIX (matrix, 2, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 2, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
j = dest_x + 1;
|
|
|
|
src_y_idx = dest_y_idx = dest_uv_idx = 1;
|
|
|
|
src_uv_idx = (src_x % 2) + 1;
|
|
|
|
} else {
|
|
|
|
j = dest_x;
|
|
|
|
src_y_idx = dest_y_idx = dest_uv_idx = 0;
|
|
|
|
src_uv_idx = (src_x % 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 2.2. Copy all macro pixels from the source to the destination.
|
|
|
|
* All pixels now start at macro pixel boundary, i.e. no
|
|
|
|
* blending with the background is necessary. */
|
|
|
|
for (; j < w - 1; j += 2) {
|
|
|
|
y1 = srcY[src_y_idx];
|
|
|
|
y2 = srcY[src_y_idx + 1];
|
|
|
|
y3 = srcY2[src_y_idx];
|
|
|
|
y4 = srcY2[src_y_idx + 1];
|
|
|
|
|
|
|
|
u1 = srcU[src_uv_idx / 2];
|
|
|
|
u3 = srcU2[src_uv_idx / 2];
|
|
|
|
v1 = srcV[src_uv_idx / 2];
|
|
|
|
v3 = srcV2[src_uv_idx / 2];
|
|
|
|
src_uv_idx++;
|
|
|
|
u2 = srcU[src_uv_idx / 2];
|
|
|
|
u4 = srcU2[src_uv_idx / 2];
|
|
|
|
v2 = srcV[src_uv_idx / 2];
|
|
|
|
v4 = srcV2[src_uv_idx / 2];
|
|
|
|
src_uv_idx++;
|
|
|
|
|
|
|
|
destY[dest_y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destY[dest_y_idx + 1] =
|
|
|
|
CLAMP (APPLY_MATRIX (matrix, 0, y2, u2, v2), 0, 255);
|
|
|
|
destY2[dest_y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y3, u3, v3), 0, 255);
|
|
|
|
destY2[dest_y_idx + 1] =
|
|
|
|
CLAMP (APPLY_MATRIX (matrix, 0, y4, u4, v4), 0, 255);
|
|
|
|
|
|
|
|
destU[dest_uv_idx] = CLAMP (
|
|
|
|
(APPLY_MATRIX (matrix, 1, y1, u1, v1) + APPLY_MATRIX (matrix, 1, y2,
|
|
|
|
u2, v2) + APPLY_MATRIX (matrix, 1, y3, u3,
|
|
|
|
v3) + APPLY_MATRIX (matrix, 1, y4, u4, v4)) / 4, 0, 255);
|
|
|
|
destV[dest_uv_idx] = CLAMP (
|
|
|
|
(APPLY_MATRIX (matrix, 2, y1, u1, v1) + APPLY_MATRIX (matrix, 2, y2,
|
|
|
|
u2, v2) + APPLY_MATRIX (matrix, 2, y3, u3,
|
|
|
|
v3) + APPLY_MATRIX (matrix, 2, y4, u4, v4)) / 4, 0, 255);
|
|
|
|
|
|
|
|
dest_y_idx += 2;
|
|
|
|
src_y_idx += 2;
|
|
|
|
dest_uv_idx++;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 2.3. Now copy the last pixel if one exists and blend it
|
|
|
|
* with the background because we only fill part of
|
|
|
|
* the macro pixel. In case this is the last pixel of
|
|
|
|
* the destination we will a larger part. */
|
|
|
|
if (j == w - 1 && j == dest_width - 1) {
|
|
|
|
y1 = srcY[src_y_idx];
|
|
|
|
y2 = srcY2[src_y_idx];
|
|
|
|
|
|
|
|
u1 = srcU[src_uv_idx / 2];
|
|
|
|
u2 = srcU2[src_uv_idx / 2];
|
|
|
|
|
|
|
|
v1 = srcV[src_uv_idx / 2];
|
|
|
|
v2 = srcV2[src_uv_idx / 2];
|
|
|
|
|
|
|
|
destY[dest_y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destY2[dest_y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y2, u2, v2), 0, 255);
|
|
|
|
destU[dest_uv_idx] = CLAMP (
|
|
|
|
(APPLY_MATRIX (matrix, 1, y1, u1, v1) + APPLY_MATRIX (matrix, 2, y2,
|
|
|
|
u2, v2)) / 2, 0, 255);
|
|
|
|
destV[dest_uv_idx] = CLAMP (
|
|
|
|
(APPLY_MATRIX (matrix, 1, y1, u1, v1) + APPLY_MATRIX (matrix, 2, y2,
|
|
|
|
u2, v2)) / 2, 0, 255);
|
|
|
|
} else if (j == w - 1) {
|
|
|
|
y1 = srcY[src_y_idx];
|
|
|
|
y2 = srcY2[src_y_idx];
|
|
|
|
|
|
|
|
u1 = srcU[src_uv_idx / 2];
|
|
|
|
u2 = srcU2[src_uv_idx / 2];
|
|
|
|
|
|
|
|
v1 = srcV[src_uv_idx / 2];
|
|
|
|
v2 = srcV2[src_uv_idx / 2];
|
|
|
|
|
|
|
|
destY[dest_y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destY2[dest_y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y2, u2, v2), 0, 255);
|
|
|
|
destU[dest_uv_idx] = CLAMP (
|
|
|
|
(2 * destU[dest_uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 2, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
destV[dest_uv_idx] = CLAMP (
|
|
|
|
(2 * destV[dest_uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 2, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
}
|
|
|
|
|
|
|
|
destY += 2 * dest_strideY;
|
|
|
|
destY2 += 2 * dest_strideY;
|
|
|
|
destU += dest_strideUV;
|
|
|
|
destV += dest_strideUV;
|
|
|
|
srcY += 2 * src_strideY;
|
|
|
|
srcY2 += 2 * src_strideY;
|
|
|
|
|
|
|
|
src_y += 2;
|
|
|
|
srcU += src_strideUV;
|
|
|
|
srcV += src_strideUV;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 3. Handle the last scanline if one exists. This again
|
|
|
|
* doesn't start at macro pixel boundary but should
|
|
|
|
* only fill the upper part of the macro pixels. */
|
|
|
|
if (i == h - 1 && i == dest_height - 1) {
|
|
|
|
/* 3.1. Handle the first destination pixel if it doesn't
|
|
|
|
* start at the macro pixel boundary, i.e. blend with
|
|
|
|
* the background! */
|
|
|
|
if (dest_x % 2 == 1) {
|
|
|
|
y1 = srcY[0];
|
|
|
|
u1 = srcU[0];
|
|
|
|
v1 = srcV[0];
|
|
|
|
|
|
|
|
destY[0] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[0] =
|
|
|
|
CLAMP ((destU[0] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 2, 0, 255);
|
|
|
|
destV[0] =
|
|
|
|
CLAMP ((destV[0] + APPLY_MATRIX (matrix, 2, y1, u1, v1)) / 2, 0, 255);
|
|
|
|
|
|
|
|
j = dest_x + 1;
|
|
|
|
src_y_idx = dest_y_idx = dest_uv_idx = 1;
|
|
|
|
src_uv_idx = (src_x % 2) + 1;
|
|
|
|
} else {
|
|
|
|
j = dest_x;
|
|
|
|
src_y_idx = dest_y_idx = dest_uv_idx = 0;
|
|
|
|
src_uv_idx = (src_x % 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 3.2. Copy all macro pixels from the source to the destination
|
|
|
|
* but blend with the background because we're only filling
|
|
|
|
* the upper part of the macro pixels. */
|
|
|
|
for (; j < w - 1; j += 2) {
|
|
|
|
y1 = srcY[src_y_idx];
|
|
|
|
y2 = srcY[src_y_idx + 1];
|
|
|
|
|
|
|
|
u1 = srcU[src_uv_idx / 2];
|
|
|
|
v1 = srcV[src_uv_idx / 2];
|
|
|
|
src_uv_idx++;
|
|
|
|
u2 = srcU[src_uv_idx / 2];
|
|
|
|
v2 = srcV[src_uv_idx / 2];
|
|
|
|
src_uv_idx++;
|
|
|
|
|
|
|
|
destY[dest_y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destY[dest_y_idx + 1] =
|
|
|
|
CLAMP (APPLY_MATRIX (matrix, 0, y2, u2, v2), 0, 255);
|
|
|
|
|
|
|
|
destU[dest_uv_idx] = CLAMP (
|
|
|
|
(2 * destU[dest_uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 1, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
destV[dest_uv_idx] = CLAMP (
|
|
|
|
(2 * destV[dest_uv_idx] + APPLY_MATRIX (matrix, 2, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 2, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
|
|
|
|
dest_y_idx += 2;
|
|
|
|
src_y_idx += 2;
|
|
|
|
dest_uv_idx++;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 3.3. Now copy the last pixel if one exists and blend it
|
|
|
|
* with the background because we only fill part of
|
|
|
|
* the macro pixel. In case this is the last pixel of
|
|
|
|
* the destination we will a larger part. */
|
|
|
|
if (j == w - 1 && j == dest_width - 1) {
|
|
|
|
y1 = srcY[src_y_idx];
|
|
|
|
u1 = srcU[src_uv_idx / 2];
|
|
|
|
v1 = srcV[src_uv_idx / 2];
|
|
|
|
|
|
|
|
destY[dest_y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[dest_uv_idx] = CLAMP (
|
|
|
|
(destU[dest_uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 2, 0,
|
|
|
|
255);
|
|
|
|
destV[dest_uv_idx] =
|
|
|
|
CLAMP ((destV[dest_uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1,
|
|
|
|
v1)) / 2, 0, 255);
|
|
|
|
} else if (j == w - 1) {
|
|
|
|
y1 = srcY[src_y_idx];
|
|
|
|
u1 = srcU[src_uv_idx / 2];
|
|
|
|
v1 = srcV[src_uv_idx / 2];
|
|
|
|
|
|
|
|
destY[dest_y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[dest_uv_idx] = CLAMP (
|
|
|
|
(3 * destU[dest_uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 4,
|
|
|
|
0, 255);
|
|
|
|
destV[dest_uv_idx] =
|
|
|
|
CLAMP ((3 * destV[dest_uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1,
|
|
|
|
v1)) / 4, 0, 255);
|
|
|
|
}
|
|
|
|
} else if (i == h - 1) {
|
|
|
|
/* 3.1. Handle the first destination pixel if it doesn't
|
|
|
|
* start at the macro pixel boundary, i.e. blend with
|
|
|
|
* the background! */
|
|
|
|
if (dest_x % 2 == 1) {
|
|
|
|
y1 = srcY[0];
|
|
|
|
u1 = srcU[0];
|
|
|
|
v1 = srcV[0];
|
|
|
|
|
|
|
|
destY[0] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[0] =
|
|
|
|
CLAMP ((3 * destU[0] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 4, 0,
|
|
|
|
255);
|
|
|
|
destV[0] =
|
|
|
|
CLAMP ((3 * destV[0] + APPLY_MATRIX (matrix, 2, y1, u1, v1)) / 4, 0,
|
|
|
|
255);
|
|
|
|
|
|
|
|
j = dest_x + 1;
|
|
|
|
src_y_idx = dest_y_idx = dest_uv_idx = 1;
|
|
|
|
src_uv_idx = (src_x % 2) + 1;
|
|
|
|
} else {
|
|
|
|
j = dest_x;
|
|
|
|
src_y_idx = dest_y_idx = dest_uv_idx = 0;
|
|
|
|
src_uv_idx = (src_x % 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 3.2. Copy all macro pixels from the source to the destination
|
|
|
|
* but blend with the background because we're only filling
|
|
|
|
* the upper part of the macro pixels. */
|
|
|
|
for (; j < w - 1; j += 2) {
|
|
|
|
y1 = srcY[src_y_idx];
|
|
|
|
y2 = srcY[src_y_idx + 1];
|
|
|
|
|
|
|
|
u1 = srcU[src_uv_idx / 2];
|
|
|
|
v1 = srcV[src_uv_idx / 2];
|
|
|
|
src_uv_idx++;
|
|
|
|
u2 = srcU[src_uv_idx / 2];
|
|
|
|
v2 = srcV[src_uv_idx / 2];
|
|
|
|
src_uv_idx++;
|
|
|
|
|
|
|
|
destY[dest_y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destY[dest_y_idx + 1] =
|
|
|
|
CLAMP (APPLY_MATRIX (matrix, 0, y2, u2, v2), 0, 255);
|
|
|
|
|
|
|
|
destU[dest_uv_idx] = CLAMP (
|
|
|
|
(2 * destU[dest_uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 1, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
destV[dest_uv_idx] = CLAMP (
|
|
|
|
(2 * destV[dest_uv_idx] + APPLY_MATRIX (matrix, 2, y1, u1,
|
|
|
|
v1) + APPLY_MATRIX (matrix, 2, y2, u2, v2)) / 4, 0, 255);
|
|
|
|
|
|
|
|
dest_y_idx += 2;
|
|
|
|
src_y_idx += 2;
|
|
|
|
dest_uv_idx++;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 3.3. Now copy the last pixel if one exists and blend it
|
|
|
|
* with the background because we only fill part of
|
|
|
|
* the macro pixel. In case this is the last pixel of
|
|
|
|
* the destination we will a larger part. */
|
|
|
|
if (j == w - 1 && j == dest_width - 1) {
|
|
|
|
y1 = srcY[src_y_idx];
|
|
|
|
u1 = srcU[src_uv_idx / 2];
|
|
|
|
v1 = srcV[src_uv_idx / 2];
|
|
|
|
|
|
|
|
destY[dest_y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[dest_uv_idx] = CLAMP (
|
|
|
|
(destU[dest_uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 2, 0,
|
|
|
|
255);
|
|
|
|
destV[dest_uv_idx] =
|
|
|
|
CLAMP ((destV[dest_uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1,
|
|
|
|
v1)) / 2, 0, 255);
|
|
|
|
} else if (j == w - 1) {
|
|
|
|
y1 = srcY[src_y_idx];
|
|
|
|
u1 = srcU[src_uv_idx / 2];
|
|
|
|
v1 = srcV[src_uv_idx / 2];
|
|
|
|
|
|
|
|
destY[dest_y_idx] = CLAMP (APPLY_MATRIX (matrix, 0, y1, u1, v1), 0, 255);
|
|
|
|
destU[dest_uv_idx] = CLAMP (
|
|
|
|
(3 * destU[dest_uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1, v1)) / 4,
|
|
|
|
0, 255);
|
|
|
|
destV[dest_uv_idx] =
|
|
|
|
CLAMP ((3 * destV[dest_uv_idx] + APPLY_MATRIX (matrix, 1, y1, u1,
|
|
|
|
v1)) / 4, 0, 255);
|
2010-03-22 15:58:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-04-05 13:51:13 +00:00
|
|
|
copy_i420_ayuv (guint i_alpha, GstVideoFormat dest_format, guint8 * dest,
|
|
|
|
gboolean dest_sdtv, gint dest_width, gint dest_height, gint dest_x,
|
|
|
|
gint dest_y, GstVideoFormat src_format, const guint8 * src,
|
|
|
|
gboolean src_sdtv, gint src_width, gint src_height, gint src_x, gint src_y,
|
|
|
|
gint w, gint h)
|
2010-03-22 15:58:26 +00:00
|
|
|
{
|
|
|
|
const guint8 *srcY, *srcU, *srcV;
|
|
|
|
gint src_strideY, src_strideUV;
|
2010-04-12 09:43:49 +00:00
|
|
|
gint dest_stride;
|
2010-03-22 15:58:26 +00:00
|
|
|
|
|
|
|
src_strideY =
|
|
|
|
gst_video_format_get_row_stride (GST_VIDEO_FORMAT_I420, 0, src_width);
|
|
|
|
src_strideUV =
|
|
|
|
gst_video_format_get_row_stride (GST_VIDEO_FORMAT_I420, 1, src_width);
|
|
|
|
|
|
|
|
srcY =
|
|
|
|
src + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 0,
|
|
|
|
src_width, src_height);
|
|
|
|
srcU =
|
2010-04-07 15:43:56 +00:00
|
|
|
src + gst_video_format_get_component_offset (src_format, 1,
|
2010-03-22 15:58:26 +00:00
|
|
|
src_width, src_height);
|
|
|
|
srcV =
|
2010-04-07 15:43:56 +00:00
|
|
|
src + gst_video_format_get_component_offset (src_format, 2,
|
2010-03-22 15:58:26 +00:00
|
|
|
src_width, src_height);
|
|
|
|
|
2010-04-12 09:43:49 +00:00
|
|
|
dest_stride = dest_width * 4;
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-12 09:43:49 +00:00
|
|
|
dest = dest + dest_y * dest_stride + dest_x * 4;
|
2010-03-22 15:58:26 +00:00
|
|
|
|
|
|
|
srcY = srcY + src_y * src_strideY + src_x;
|
|
|
|
srcU = srcU + (src_y / 2) * src_strideUV + src_x / 2;
|
|
|
|
srcV = srcV + (src_y / 2) * src_strideUV + src_x / 2;
|
|
|
|
|
2010-04-12 09:25:59 +00:00
|
|
|
i_alpha = CLAMP (i_alpha, 0, 255);
|
|
|
|
|
2010-03-22 15:58:26 +00:00
|
|
|
if (src_sdtv != dest_sdtv) {
|
2010-04-12 09:43:49 +00:00
|
|
|
gint i, j, uv_idx;
|
|
|
|
gint y, u, v;
|
|
|
|
gint y1, u1, v1;
|
2010-03-22 15:58:26 +00:00
|
|
|
gint matrix[12];
|
|
|
|
|
|
|
|
memcpy (matrix,
|
|
|
|
dest_sdtv ? cog_ycbcr_hdtv_to_ycbcr_sdtv_matrix_8bit :
|
|
|
|
cog_ycbcr_sdtv_to_ycbcr_hdtv_matrix_8bit, 12 * sizeof (gint));
|
|
|
|
|
2010-04-12 09:43:49 +00:00
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
for (j = 0, uv_idx = src_x % 2; j < w; j++, uv_idx++) {
|
|
|
|
y = srcY[j];
|
|
|
|
u = srcU[uv_idx / 2];
|
|
|
|
v = srcV[uv_idx / 2];
|
|
|
|
|
|
|
|
y1 = APPLY_MATRIX (matrix, 0, y, u, v);
|
|
|
|
u1 = APPLY_MATRIX (matrix, 1, y, u, v);
|
|
|
|
v1 = APPLY_MATRIX (matrix, 2, y, u, v);
|
|
|
|
|
|
|
|
dest[4 * j + 0] = i_alpha;
|
|
|
|
dest[4 * j + 1] = y1;
|
|
|
|
dest[4 * j + 2] = u1;
|
|
|
|
dest[4 * j + 3] = v1;
|
2010-03-22 15:58:26 +00:00
|
|
|
}
|
2010-04-12 09:43:49 +00:00
|
|
|
dest += dest_stride;
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-12 09:43:49 +00:00
|
|
|
src_y++;
|
2010-03-22 15:58:26 +00:00
|
|
|
srcY += src_strideY;
|
2010-04-12 09:43:49 +00:00
|
|
|
if (src_y % 2 == 0) {
|
|
|
|
srcU += src_strideUV;
|
|
|
|
srcV += src_strideUV;
|
|
|
|
}
|
2010-03-22 15:58:26 +00:00
|
|
|
}
|
|
|
|
} else {
|
2010-04-12 09:43:49 +00:00
|
|
|
gint i, j, uv_idx;
|
|
|
|
gint y, u, v;
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-12 09:43:49 +00:00
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
for (j = 0, uv_idx = src_x % 2; j < w; j++, uv_idx++) {
|
|
|
|
y = srcY[j];
|
|
|
|
u = srcU[uv_idx / 2];
|
|
|
|
v = srcV[uv_idx / 2];
|
|
|
|
|
|
|
|
dest[4 * j + 0] = i_alpha;
|
|
|
|
dest[4 * j + 1] = y;
|
|
|
|
dest[4 * j + 2] = u;
|
|
|
|
dest[4 * j + 3] = v;
|
2010-03-22 15:58:26 +00:00
|
|
|
}
|
2010-04-12 09:43:49 +00:00
|
|
|
dest += dest_stride;
|
2010-03-22 15:58:26 +00:00
|
|
|
|
2010-04-12 09:43:49 +00:00
|
|
|
src_y++;
|
2010-03-22 15:58:26 +00:00
|
|
|
srcY += src_strideY;
|
2010-04-12 09:43:49 +00:00
|
|
|
if (src_y % 2 == 0) {
|
|
|
|
srcU += src_strideUV;
|
|
|
|
srcV += src_strideUV;
|
|
|
|
}
|
2010-03-22 15:58:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-04-05 13:51:13 +00:00
|
|
|
static void
|
2010-04-05 15:08:15 +00:00
|
|
|
_argb_order (GstVideoFormat format, gint p[4], gboolean * alpha)
|
2010-04-05 13:51:13 +00:00
|
|
|
{
|
2010-04-05 15:08:15 +00:00
|
|
|
*alpha = FALSE;
|
2010-04-05 13:51:13 +00:00
|
|
|
switch (format) {
|
|
|
|
case GST_VIDEO_FORMAT_ARGB:
|
2010-04-05 15:08:15 +00:00
|
|
|
*alpha = TRUE;
|
2010-04-05 13:51:13 +00:00
|
|
|
case GST_VIDEO_FORMAT_xRGB:
|
2010-04-05 15:08:15 +00:00
|
|
|
p[0] = 0;
|
|
|
|
p[1] = 1;
|
|
|
|
p[2] = 2;
|
|
|
|
p[3] = 3;
|
2010-04-05 13:51:13 +00:00
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_ABGR:
|
2010-04-05 15:08:15 +00:00
|
|
|
*alpha = TRUE;
|
2010-04-05 13:51:13 +00:00
|
|
|
case GST_VIDEO_FORMAT_xBGR:
|
2010-04-05 15:08:15 +00:00
|
|
|
p[0] = 0;
|
|
|
|
p[1] = 3;
|
|
|
|
p[2] = 2;
|
|
|
|
p[3] = 1;
|
2010-04-05 13:51:13 +00:00
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_RGBA:
|
2010-04-05 15:08:15 +00:00
|
|
|
*alpha = TRUE;
|
2010-04-05 13:51:13 +00:00
|
|
|
case GST_VIDEO_FORMAT_RGBx:
|
2010-04-05 15:08:15 +00:00
|
|
|
case GST_VIDEO_FORMAT_RGB:
|
|
|
|
p[0] = 3;
|
|
|
|
p[1] = 0;
|
|
|
|
p[2] = 1;
|
|
|
|
p[3] = 2;
|
2010-04-05 13:51:13 +00:00
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_BGRA:
|
2010-04-05 15:08:15 +00:00
|
|
|
*alpha = TRUE;
|
2010-04-05 13:51:13 +00:00
|
|
|
case GST_VIDEO_FORMAT_BGRx:
|
2010-04-05 15:08:15 +00:00
|
|
|
case GST_VIDEO_FORMAT_BGR:
|
|
|
|
p[0] = 3;
|
|
|
|
p[1] = 2;
|
|
|
|
p[2] = 1;
|
|
|
|
p[3] = 0;
|
2010-04-05 13:51:13 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
}
|
2010-04-05 15:08:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
fill_rgb32 (GstVideoBoxFill fill_type, guint b_alpha, GstVideoFormat format,
|
|
|
|
guint8 * dest, gboolean sdtv, gint width, gint height)
|
|
|
|
{
|
|
|
|
guint32 empty_pixel;
|
|
|
|
gint p[4];
|
|
|
|
gboolean alpha;
|
2010-04-05 13:51:13 +00:00
|
|
|
|
2010-04-05 15:08:15 +00:00
|
|
|
_argb_order (format, p, &alpha);
|
|
|
|
|
2010-04-12 09:25:59 +00:00
|
|
|
b_alpha = CLAMP (b_alpha, 0, 255);
|
|
|
|
|
2010-04-05 15:08:15 +00:00
|
|
|
empty_pixel = GUINT32_FROM_BE ((b_alpha << (p[0] * 8)) |
|
|
|
|
(rgb_colors_R[fill_type] << (p[1] * 8)) |
|
|
|
|
(rgb_colors_G[fill_type] << (p[2] * 8)) |
|
|
|
|
(rgb_colors_B[fill_type] << (p[3] * 8)));
|
2010-04-05 13:51:13 +00:00
|
|
|
|
|
|
|
oil_splat_u32_ns ((guint32 *) dest, &empty_pixel, width * height);
|
|
|
|
}
|
|
|
|
|
2010-04-05 15:08:15 +00:00
|
|
|
static void
|
|
|
|
fill_rgb24 (GstVideoBoxFill fill_type, guint b_alpha, GstVideoFormat format,
|
|
|
|
guint8 * dest, gboolean sdtv, gint width, gint height)
|
|
|
|
{
|
|
|
|
gint dest_stride = GST_ROUND_UP_4 (width * 3);
|
|
|
|
gint p[4];
|
|
|
|
gboolean alpha;
|
|
|
|
gint i, j;
|
|
|
|
|
|
|
|
_argb_order (format, p, &alpha);
|
|
|
|
|
|
|
|
for (i = 0; i < height; i++) {
|
|
|
|
for (j = 0; j < width; j++) {
|
2010-04-07 14:11:01 +00:00
|
|
|
dest[3 * j + p[1]] = rgb_colors_R[fill_type];
|
|
|
|
dest[3 * j + p[2]] = rgb_colors_G[fill_type];
|
|
|
|
dest[3 * j + p[3]] = rgb_colors_B[fill_type];
|
2010-04-05 15:08:15 +00:00
|
|
|
}
|
|
|
|
dest += dest_stride;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-04-05 13:51:13 +00:00
|
|
|
static void
|
|
|
|
copy_rgb32 (guint i_alpha, GstVideoFormat dest_format, guint8 * dest,
|
|
|
|
gboolean dest_sdtv, gint dest_width, gint dest_height, gint dest_x,
|
|
|
|
gint dest_y, GstVideoFormat src_format, const guint8 * src,
|
|
|
|
gboolean src_sdtv, gint src_width, gint src_height, gint src_x, gint src_y,
|
|
|
|
gint w, gint h)
|
|
|
|
{
|
|
|
|
gint i, j;
|
2010-04-05 15:08:15 +00:00
|
|
|
gint src_stride, dest_stride;
|
2010-04-05 13:51:13 +00:00
|
|
|
gboolean in_alpha, out_alpha;
|
2010-04-05 15:08:15 +00:00
|
|
|
gint in_bpp, out_bpp;
|
2010-04-05 13:51:13 +00:00
|
|
|
gint p_out[4];
|
|
|
|
gint p_in[4];
|
2010-04-05 15:08:15 +00:00
|
|
|
gboolean packed_out = (dest_format == GST_VIDEO_FORMAT_RGB
|
|
|
|
|| dest_format == GST_VIDEO_FORMAT_BGR);
|
|
|
|
gboolean packed_in = (src_format == GST_VIDEO_FORMAT_RGB
|
|
|
|
|| src_format == GST_VIDEO_FORMAT_BGR);
|
2010-04-05 13:51:13 +00:00
|
|
|
|
2010-04-05 15:08:15 +00:00
|
|
|
src_stride = (packed_in) ? GST_ROUND_UP_4 (3 * src_width) : 4 * src_width;
|
|
|
|
dest_stride = (packed_out) ? GST_ROUND_UP_4 (3 * dest_width) : 4 * dest_width;
|
|
|
|
in_bpp = (packed_in) ? 3 : 4;
|
|
|
|
out_bpp = (packed_out) ? 3 : 4;
|
2010-04-05 13:51:13 +00:00
|
|
|
|
2010-04-05 15:08:15 +00:00
|
|
|
_argb_order (dest_format, p_out, &out_alpha);
|
|
|
|
_argb_order (src_format, p_in, &in_alpha);
|
2010-04-05 13:51:13 +00:00
|
|
|
|
2010-04-05 15:08:15 +00:00
|
|
|
dest = dest + dest_y * dest_stride + dest_x * out_bpp;
|
|
|
|
src = src + src_y * src_stride + src_x * in_bpp;
|
2010-04-05 13:51:13 +00:00
|
|
|
|
|
|
|
if (in_alpha && out_alpha) {
|
2010-04-05 15:08:15 +00:00
|
|
|
w *= 4;
|
2010-04-05 13:51:13 +00:00
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
for (j = 0; j < w; j += 4) {
|
|
|
|
dest[j + p_out[0]] = (src[j + p_in[0]] * i_alpha) >> 8;
|
|
|
|
dest[j + p_out[1]] = src[j + p_in[1]];
|
|
|
|
dest[j + p_out[2]] = src[j + p_in[2]];
|
|
|
|
dest[j + p_out[3]] = src[j + p_in[3]];
|
|
|
|
}
|
|
|
|
dest += dest_stride;
|
|
|
|
src += src_stride;
|
|
|
|
}
|
2010-04-05 15:08:15 +00:00
|
|
|
} else if (out_alpha && !packed_in) {
|
|
|
|
w *= 4;
|
2010-04-12 09:25:59 +00:00
|
|
|
i_alpha = CLAMP (i_alpha, 0, 255);
|
|
|
|
|
2010-04-05 13:51:13 +00:00
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
for (j = 0; j < w; j += 4) {
|
2010-04-12 09:25:59 +00:00
|
|
|
dest[j + p_out[0]] = i_alpha;
|
2010-04-05 13:51:13 +00:00
|
|
|
dest[j + p_out[1]] = src[j + p_in[1]];
|
|
|
|
dest[j + p_out[2]] = src[j + p_in[2]];
|
|
|
|
dest[j + p_out[3]] = src[j + p_in[3]];
|
|
|
|
}
|
|
|
|
dest += dest_stride;
|
|
|
|
src += src_stride;
|
|
|
|
}
|
2010-04-05 15:31:36 +00:00
|
|
|
} else if (out_alpha && packed_in) {
|
2010-04-12 09:25:59 +00:00
|
|
|
i_alpha = CLAMP (i_alpha, 0, 255);
|
|
|
|
|
2010-04-05 15:31:36 +00:00
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
for (j = 0; j < w; j++) {
|
2010-04-12 09:25:59 +00:00
|
|
|
dest[4 * j + p_out[0]] = i_alpha;
|
2010-04-05 15:31:36 +00:00
|
|
|
dest[4 * j + p_out[1]] = src[in_bpp * j + p_in[1]];
|
|
|
|
dest[4 * j + p_out[2]] = src[in_bpp * j + p_in[2]];
|
|
|
|
dest[4 * j + p_out[3]] = src[in_bpp * j + p_in[3]];
|
|
|
|
}
|
|
|
|
dest += dest_stride;
|
|
|
|
src += src_stride;
|
|
|
|
}
|
2010-04-05 15:08:15 +00:00
|
|
|
} else if (!packed_out && !packed_in) {
|
|
|
|
w *= 4;
|
2010-04-05 13:51:13 +00:00
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
for (j = 0; j < w; j += 4) {
|
|
|
|
dest[j + p_out[1]] = src[j + p_in[1]];
|
|
|
|
dest[j + p_out[2]] = src[j + p_in[2]];
|
|
|
|
dest[j + p_out[3]] = src[j + p_in[3]];
|
|
|
|
}
|
|
|
|
dest += dest_stride;
|
|
|
|
src += src_stride;
|
|
|
|
}
|
2010-04-05 15:08:15 +00:00
|
|
|
} else {
|
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
for (j = 0; j < w; j++) {
|
|
|
|
dest[out_bpp * j + p_out[1]] = src[in_bpp * j + p_in[1]];
|
|
|
|
dest[out_bpp * j + p_out[2]] = src[in_bpp * j + p_in[2]];
|
|
|
|
dest[out_bpp * j + p_out[3]] = src[in_bpp * j + p_in[3]];
|
|
|
|
}
|
|
|
|
dest += dest_stride;
|
|
|
|
src += src_stride;
|
|
|
|
}
|
2010-04-05 13:51:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-04-07 14:11:11 +00:00
|
|
|
static void
|
|
|
|
copy_rgb32_ayuv (guint i_alpha, GstVideoFormat dest_format, guint8 * dest,
|
|
|
|
gboolean dest_sdtv, gint dest_width, gint dest_height, gint dest_x,
|
|
|
|
gint dest_y, GstVideoFormat src_format, const guint8 * src,
|
|
|
|
gboolean src_sdtv, gint src_width, gint src_height, gint src_x, gint src_y,
|
|
|
|
gint w, gint h)
|
|
|
|
{
|
|
|
|
gint i, j;
|
|
|
|
gint src_stride, dest_stride;
|
|
|
|
gboolean in_alpha;
|
|
|
|
gint in_bpp;
|
|
|
|
gint p_in[4];
|
|
|
|
gboolean packed_in = (src_format == GST_VIDEO_FORMAT_RGB
|
|
|
|
|| src_format == GST_VIDEO_FORMAT_BGR);
|
|
|
|
gint matrix[12];
|
|
|
|
gint a;
|
|
|
|
gint y, u, v;
|
|
|
|
gint r, g, b;
|
|
|
|
|
|
|
|
src_stride = (packed_in) ? GST_ROUND_UP_4 (3 * src_width) : 4 * src_width;
|
|
|
|
dest_stride = 4 * dest_width;
|
|
|
|
in_bpp = (packed_in) ? 3 : 4;
|
|
|
|
|
|
|
|
_argb_order (src_format, p_in, &in_alpha);
|
|
|
|
|
|
|
|
memcpy (matrix,
|
|
|
|
(dest_sdtv) ? cog_rgb_to_ycbcr_matrix_8bit_sdtv :
|
|
|
|
cog_rgb_to_ycbcr_matrix_8bit_hdtv, 12 * sizeof (gint));
|
|
|
|
|
|
|
|
dest = dest + dest_y * dest_stride + dest_x * 4;
|
|
|
|
src = src + src_y * src_stride + src_x * in_bpp;
|
|
|
|
|
|
|
|
if (in_alpha) {
|
|
|
|
w *= 4;
|
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
for (j = 0; j < w; j += 4) {
|
|
|
|
a = (src[j + p_in[0]] * i_alpha) >> 8;
|
|
|
|
r = src[j + p_in[1]];
|
|
|
|
g = src[j + p_in[2]];
|
|
|
|
b = src[j + p_in[3]];
|
|
|
|
|
|
|
|
y = APPLY_MATRIX (matrix, 0, r, g, b);
|
|
|
|
u = APPLY_MATRIX (matrix, 1, r, g, b);
|
|
|
|
v = APPLY_MATRIX (matrix, 2, r, g, b);
|
|
|
|
|
|
|
|
dest[j + 0] = a;
|
|
|
|
dest[j + 1] = CLAMP (y, 0, 255);
|
|
|
|
dest[j + 2] = CLAMP (u, 0, 255);
|
|
|
|
dest[j + 3] = CLAMP (v, 0, 255);
|
|
|
|
}
|
|
|
|
dest += dest_stride;
|
|
|
|
src += src_stride;
|
|
|
|
}
|
|
|
|
} else if (!packed_in) {
|
|
|
|
w *= 4;
|
2010-04-12 09:25:59 +00:00
|
|
|
i_alpha = CLAMP (i_alpha, 0, 255);
|
|
|
|
|
2010-04-07 14:11:11 +00:00
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
for (j = 0; j < w; j += 4) {
|
2010-04-12 09:25:59 +00:00
|
|
|
a = i_alpha;
|
2010-04-07 14:11:11 +00:00
|
|
|
r = src[j + p_in[1]];
|
|
|
|
g = src[j + p_in[2]];
|
|
|
|
b = src[j + p_in[3]];
|
|
|
|
|
|
|
|
y = APPLY_MATRIX (matrix, 0, r, g, b);
|
|
|
|
u = APPLY_MATRIX (matrix, 1, r, g, b);
|
|
|
|
v = APPLY_MATRIX (matrix, 2, r, g, b);
|
|
|
|
|
|
|
|
dest[j + 0] = a;
|
|
|
|
dest[j + 1] = CLAMP (y, 0, 255);
|
|
|
|
dest[j + 2] = CLAMP (u, 0, 255);
|
|
|
|
dest[j + 3] = CLAMP (v, 0, 255);
|
|
|
|
}
|
|
|
|
dest += dest_stride;
|
|
|
|
src += src_stride;
|
|
|
|
}
|
|
|
|
} else {
|
2010-04-12 09:25:59 +00:00
|
|
|
i_alpha = CLAMP (i_alpha, 0, 255);
|
|
|
|
|
2010-04-07 14:11:11 +00:00
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
for (j = 0; j < w; j++) {
|
2010-04-12 09:25:59 +00:00
|
|
|
a = i_alpha;
|
2010-04-07 14:11:11 +00:00
|
|
|
r = src[in_bpp * j + p_in[1]];
|
|
|
|
g = src[in_bpp * j + p_in[2]];
|
|
|
|
b = src[in_bpp * j + p_in[3]];
|
|
|
|
|
|
|
|
y = APPLY_MATRIX (matrix, 0, r, g, b);
|
|
|
|
u = APPLY_MATRIX (matrix, 1, r, g, b);
|
|
|
|
v = APPLY_MATRIX (matrix, 2, r, g, b);
|
|
|
|
|
|
|
|
dest[4 * j + 0] = a;
|
|
|
|
dest[4 * j + 1] = CLAMP (y, 0, 255);
|
|
|
|
dest[4 * j + 2] = CLAMP (u, 0, 255);
|
|
|
|
dest[4 * j + 3] = CLAMP (v, 0, 255);
|
|
|
|
}
|
|
|
|
dest += dest_stride;
|
|
|
|
src += src_stride;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
copy_ayuv_rgb32 (guint i_alpha, GstVideoFormat dest_format, guint8 * dest,
|
|
|
|
gboolean dest_sdtv, gint dest_width, gint dest_height, gint dest_x,
|
|
|
|
gint dest_y, GstVideoFormat src_format, const guint8 * src,
|
|
|
|
gboolean src_sdtv, gint src_width, gint src_height, gint src_x, gint src_y,
|
|
|
|
gint w, gint h)
|
|
|
|
{
|
|
|
|
gint i, j;
|
|
|
|
gint src_stride, dest_stride;
|
|
|
|
gboolean out_alpha;
|
|
|
|
gint out_bpp;
|
|
|
|
gint p_out[4];
|
|
|
|
gboolean packed_out = (dest_format == GST_VIDEO_FORMAT_RGB
|
|
|
|
|| dest_format == GST_VIDEO_FORMAT_BGR);
|
|
|
|
gint matrix[12];
|
|
|
|
gint a;
|
|
|
|
gint y, u, v;
|
|
|
|
gint r, g, b;
|
|
|
|
|
|
|
|
dest_stride = (packed_out) ? GST_ROUND_UP_4 (3 * dest_width) : 4 * dest_width;
|
|
|
|
src_stride = 4 * src_width;
|
|
|
|
out_bpp = (packed_out) ? 3 : 4;
|
|
|
|
|
|
|
|
_argb_order (dest_format, p_out, &out_alpha);
|
|
|
|
|
|
|
|
memcpy (matrix,
|
|
|
|
(src_sdtv) ? cog_ycbcr_to_rgb_matrix_8bit_sdtv :
|
|
|
|
cog_ycbcr_to_rgb_matrix_8bit_hdtv, 12 * sizeof (gint));
|
|
|
|
|
|
|
|
dest = dest + dest_y * dest_stride + dest_x * out_bpp;
|
|
|
|
src = src + src_y * src_stride + src_x * 4;
|
|
|
|
|
|
|
|
if (out_alpha) {
|
|
|
|
w *= 4;
|
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
for (j = 0; j < w; j += 4) {
|
|
|
|
a = (src[j + 0] * i_alpha) >> 8;
|
|
|
|
y = src[j + 1];
|
|
|
|
u = src[j + 2];
|
|
|
|
v = src[j + 3];
|
|
|
|
|
|
|
|
r = APPLY_MATRIX (matrix, 0, y, u, v);
|
|
|
|
g = APPLY_MATRIX (matrix, 1, y, u, v);
|
|
|
|
b = APPLY_MATRIX (matrix, 2, y, u, v);
|
|
|
|
|
|
|
|
dest[j + p_out[0]] = a;
|
|
|
|
dest[j + p_out[1]] = CLAMP (r, 0, 255);
|
|
|
|
dest[j + p_out[2]] = CLAMP (g, 0, 255);
|
|
|
|
dest[j + p_out[3]] = CLAMP (b, 0, 255);
|
|
|
|
}
|
|
|
|
dest += dest_stride;
|
|
|
|
src += src_stride;
|
|
|
|
}
|
|
|
|
} else if (!packed_out) {
|
|
|
|
w *= 4;
|
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
for (j = 0; j < w; j += 4) {
|
|
|
|
y = src[j + 1];
|
|
|
|
u = src[j + 2];
|
|
|
|
v = src[j + 3];
|
|
|
|
|
|
|
|
r = APPLY_MATRIX (matrix, 0, y, u, v);
|
|
|
|
g = APPLY_MATRIX (matrix, 1, y, u, v);
|
|
|
|
b = APPLY_MATRIX (matrix, 2, y, u, v);
|
|
|
|
|
|
|
|
dest[j + p_out[1]] = CLAMP (r, 0, 255);
|
|
|
|
dest[j + p_out[2]] = CLAMP (g, 0, 255);
|
|
|
|
dest[j + p_out[3]] = CLAMP (b, 0, 255);
|
|
|
|
}
|
|
|
|
dest += dest_stride;
|
|
|
|
src += src_stride;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
for (j = 0; j < w; j++) {
|
|
|
|
y = src[4 * j + 1];
|
|
|
|
u = src[4 * j + 2];
|
|
|
|
v = src[4 * j + 3];
|
|
|
|
|
|
|
|
r = APPLY_MATRIX (matrix, 0, y, u, v);
|
|
|
|
g = APPLY_MATRIX (matrix, 1, y, u, v);
|
|
|
|
b = APPLY_MATRIX (matrix, 2, y, u, v);
|
|
|
|
|
|
|
|
dest[out_bpp * j + p_out[1]] = CLAMP (r, 0, 255);
|
|
|
|
dest[out_bpp * j + p_out[2]] = CLAMP (g, 0, 255);
|
|
|
|
dest[out_bpp * j + p_out[3]] = CLAMP (b, 0, 255);
|
|
|
|
}
|
|
|
|
dest += dest_stride;
|
|
|
|
src += src_stride;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-04-07 15:27:12 +00:00
|
|
|
static void
|
|
|
|
fill_gray (GstVideoBoxFill fill_type, guint b_alpha, GstVideoFormat format,
|
|
|
|
guint8 * dest, gboolean sdtv, gint width, gint height)
|
|
|
|
{
|
|
|
|
gint i, j;
|
|
|
|
gint dest_stride;
|
|
|
|
|
|
|
|
if (format == GST_VIDEO_FORMAT_GRAY8) {
|
|
|
|
guint8 val = yuv_sdtv_colors_Y[fill_type];
|
|
|
|
|
|
|
|
dest_stride = GST_ROUND_UP_4 (width);
|
|
|
|
for (i = 0; i < height; i++) {
|
|
|
|
oil_splat_u8_ns (dest, &val, width);
|
|
|
|
dest += dest_stride;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
guint16 val = yuv_sdtv_colors_Y[fill_type] << 8;
|
|
|
|
|
|
|
|
dest_stride = GST_ROUND_UP_4 (width * 2);
|
|
|
|
if (format == GST_VIDEO_FORMAT_GRAY16_BE) {
|
|
|
|
for (i = 0; i < height; i++) {
|
|
|
|
for (j = 0; j < width; j++) {
|
|
|
|
GST_WRITE_UINT16_BE (dest + 2 * j, val);
|
|
|
|
}
|
|
|
|
dest += dest_stride;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for (i = 0; i < height; i++) {
|
|
|
|
for (j = 0; j < width; j++) {
|
|
|
|
GST_WRITE_UINT16_LE (dest + 2 * j, val);
|
|
|
|
}
|
|
|
|
dest += dest_stride;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
copy_packed_simple (guint i_alpha, GstVideoFormat dest_format, guint8 * dest,
|
|
|
|
gboolean dest_sdtv, gint dest_width, gint dest_height, gint dest_x,
|
|
|
|
gint dest_y, GstVideoFormat src_format, const guint8 * src,
|
|
|
|
gboolean src_sdtv, gint src_width, gint src_height, gint src_x, gint src_y,
|
|
|
|
gint w, gint h)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
gint src_stride, dest_stride;
|
|
|
|
gint pixel_stride, row_size;
|
|
|
|
|
|
|
|
src_stride = gst_video_format_get_row_stride (src_format, 0, src_width);
|
|
|
|
dest_stride = gst_video_format_get_row_stride (dest_format, 0, dest_width);
|
|
|
|
pixel_stride = gst_video_format_get_pixel_stride (dest_format, 0);
|
|
|
|
row_size = w * pixel_stride;
|
|
|
|
|
|
|
|
dest = dest + dest_y * dest_stride + dest_x * pixel_stride;
|
|
|
|
src = src + src_y * src_stride + src_x * pixel_stride;
|
|
|
|
|
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
oil_copy_u8 (dest, src, row_size);
|
|
|
|
dest += dest_stride;
|
|
|
|
src += src_stride;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
#define DEFAULT_LEFT 0
|
|
|
|
#define DEFAULT_RIGHT 0
|
|
|
|
#define DEFAULT_TOP 0
|
|
|
|
#define DEFAULT_BOTTOM 0
|
|
|
|
#define DEFAULT_FILL_TYPE VIDEO_BOX_FILL_BLACK
|
|
|
|
#define DEFAULT_ALPHA 1.0
|
|
|
|
#define DEFAULT_BORDER_ALPHA 1.0
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2005-07-05 10:11:24 +00:00
|
|
|
PROP_0,
|
|
|
|
PROP_LEFT,
|
|
|
|
PROP_RIGHT,
|
|
|
|
PROP_TOP,
|
|
|
|
PROP_BOTTOM,
|
|
|
|
PROP_FILL_TYPE,
|
|
|
|
PROP_ALPHA,
|
2009-08-14 11:15:57 +00:00
|
|
|
PROP_BORDER_ALPHA,
|
|
|
|
PROP_AUTOCROP
|
2006-11-19 16:30:19 +00:00
|
|
|
/* FILL ME */
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static GstStaticPadTemplate gst_video_box_src_template =
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
GST_STATIC_PAD_TEMPLATE ("src",
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("AYUV") ";"
|
2010-04-05 13:51:13 +00:00
|
|
|
GST_VIDEO_CAPS_YUV ("I420") ";"
|
2010-04-07 15:43:56 +00:00
|
|
|
GST_VIDEO_CAPS_YUV ("YV12") ";"
|
2010-04-05 13:51:13 +00:00
|
|
|
GST_VIDEO_CAPS_xRGB ";" GST_VIDEO_CAPS_BGRx ";"
|
|
|
|
GST_VIDEO_CAPS_xBGR ";" GST_VIDEO_CAPS_RGBx ";"
|
|
|
|
GST_VIDEO_CAPS_ARGB ";" GST_VIDEO_CAPS_BGRA ";"
|
2010-04-05 15:08:15 +00:00
|
|
|
GST_VIDEO_CAPS_ABGR ";" GST_VIDEO_CAPS_RGBA ";"
|
2010-04-07 15:27:12 +00:00
|
|
|
GST_VIDEO_CAPS_RGB ";" GST_VIDEO_CAPS_BGR ";"
|
|
|
|
GST_VIDEO_CAPS_GRAY8 ";"
|
|
|
|
GST_VIDEO_CAPS_GRAY16 ("BIG_ENDIAN") ";"
|
|
|
|
GST_VIDEO_CAPS_GRAY16 ("LITTLE_ENDIAN"))
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate gst_video_box_sink_template =
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("AYUV") ";"
|
2010-04-05 13:51:13 +00:00
|
|
|
GST_VIDEO_CAPS_YUV ("I420") ";"
|
2010-04-07 15:43:56 +00:00
|
|
|
GST_VIDEO_CAPS_YUV ("YV12") ";"
|
2010-04-05 13:51:13 +00:00
|
|
|
GST_VIDEO_CAPS_xRGB ";" GST_VIDEO_CAPS_BGRx ";"
|
|
|
|
GST_VIDEO_CAPS_xBGR ";" GST_VIDEO_CAPS_RGBx ";"
|
|
|
|
GST_VIDEO_CAPS_ARGB ";" GST_VIDEO_CAPS_BGRA ";"
|
2010-04-05 15:08:15 +00:00
|
|
|
GST_VIDEO_CAPS_ABGR ";" GST_VIDEO_CAPS_RGBA ";"
|
2010-04-07 15:27:12 +00:00
|
|
|
GST_VIDEO_CAPS_RGB ";" GST_VIDEO_CAPS_BGR ";"
|
|
|
|
GST_VIDEO_CAPS_GRAY8 ";"
|
|
|
|
GST_VIDEO_CAPS_GRAY16 ("BIG_ENDIAN") ";"
|
|
|
|
GST_VIDEO_CAPS_GRAY16 ("LITTLE_ENDIAN"))
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
);
|
|
|
|
|
2005-07-05 10:11:24 +00:00
|
|
|
GST_BOILERPLATE (GstVideoBox, gst_video_box, GstBaseTransform,
|
|
|
|
GST_TYPE_BASE_TRANSFORM);
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
|
|
|
|
static void gst_video_box_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_video_box_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec);
|
|
|
|
|
2010-03-22 15:58:26 +00:00
|
|
|
static gboolean gst_video_box_recalc_transform (GstVideoBox * video_box);
|
2005-07-05 10:11:24 +00:00
|
|
|
static GstCaps *gst_video_box_transform_caps (GstBaseTransform * trans,
|
2005-08-24 13:34:05 +00:00
|
|
|
GstPadDirection direction, GstCaps * from);
|
2005-07-05 10:11:24 +00:00
|
|
|
static gboolean gst_video_box_set_caps (GstBaseTransform * trans,
|
|
|
|
GstCaps * in, GstCaps * out);
|
2005-08-24 13:34:05 +00:00
|
|
|
static gboolean gst_video_box_get_unit_size (GstBaseTransform * trans,
|
|
|
|
GstCaps * caps, guint * size);
|
2005-07-05 10:11:24 +00:00
|
|
|
static GstFlowReturn gst_video_box_transform (GstBaseTransform * trans,
|
2005-07-15 10:42:30 +00:00
|
|
|
GstBuffer * in, GstBuffer * out);
|
2010-03-22 15:58:26 +00:00
|
|
|
static void gst_video_box_fixate_caps (GstBaseTransform * trans,
|
|
|
|
GstPadDirection direction, GstCaps * caps, GstCaps * othercaps);
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
|
|
|
|
#define GST_TYPE_VIDEO_BOX_FILL (gst_video_box_fill_get_type())
|
|
|
|
static GType
|
|
|
|
gst_video_box_fill_get_type (void)
|
|
|
|
{
|
|
|
|
static GType video_box_fill_type = 0;
|
2006-05-10 10:29:54 +00:00
|
|
|
static const GEnumValue video_box_fill[] = {
|
2005-11-22 18:11:58 +00:00
|
|
|
{VIDEO_BOX_FILL_BLACK, "Black", "black"},
|
2010-04-07 14:24:38 +00:00
|
|
|
{VIDEO_BOX_FILL_GREEN, "Green", "green"},
|
|
|
|
{VIDEO_BOX_FILL_BLUE, "Blue", "blue"},
|
|
|
|
{VIDEO_BOX_FILL_RED, "Red", "red"},
|
|
|
|
{VIDEO_BOX_FILL_YELLOW, "Yellow", "yellow"},
|
|
|
|
{VIDEO_BOX_FILL_WHITE, "White", "white"},
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
{0, NULL, NULL},
|
|
|
|
};
|
|
|
|
|
|
|
|
if (!video_box_fill_type) {
|
|
|
|
video_box_fill_type =
|
|
|
|
g_enum_register_static ("GstVideoBoxFill", video_box_fill);
|
|
|
|
}
|
|
|
|
return video_box_fill_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_video_box_base_init (gpointer g_class)
|
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
|
|
|
|
2010-03-08 19:09:01 +00:00
|
|
|
gst_element_class_set_details_simple (element_class, "Video box filter",
|
|
|
|
"Filter/Effect/Video",
|
|
|
|
"Resizes a video by adding borders or cropping",
|
|
|
|
"Wim Taymans <wim@fluendo.com>");
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&gst_video_box_sink_template));
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&gst_video_box_src_template));
|
|
|
|
}
|
2005-07-05 10:11:24 +00:00
|
|
|
|
2009-08-14 11:26:36 +00:00
|
|
|
static void
|
|
|
|
gst_video_box_finalize (GObject * object)
|
|
|
|
{
|
|
|
|
GstVideoBox *video_box = GST_VIDEO_BOX (object);
|
|
|
|
|
|
|
|
if (video_box->mutex) {
|
|
|
|
g_mutex_free (video_box->mutex);
|
|
|
|
video_box->mutex = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
static void
|
|
|
|
gst_video_box_class_init (GstVideoBoxClass * klass)
|
|
|
|
{
|
2010-03-08 19:09:01 +00:00
|
|
|
GObjectClass *gobject_class = (GObjectClass *) klass;
|
|
|
|
GstBaseTransformClass *trans_class = (GstBaseTransformClass *) klass;
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
|
2005-06-02 10:03:23 +00:00
|
|
|
gobject_class->set_property = gst_video_box_set_property;
|
|
|
|
gobject_class->get_property = gst_video_box_get_property;
|
2009-08-14 11:26:36 +00:00
|
|
|
gobject_class->finalize = gst_video_box_finalize;
|
2005-06-02 10:03:23 +00:00
|
|
|
|
2005-07-05 10:11:24 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_FILL_TYPE,
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
g_param_spec_enum ("fill", "Fill", "How to fill the borders",
|
|
|
|
GST_TYPE_VIDEO_BOX_FILL, DEFAULT_FILL_TYPE,
|
2010-03-08 19:20:59 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | GST_PARAM_CONTROLLABLE));
|
2005-07-05 10:11:24 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_LEFT,
|
2004-07-07 16:35:02 +00:00
|
|
|
g_param_spec_int ("left", "Left",
|
|
|
|
"Pixels to box at left (<0 = add a border)", G_MININT, G_MAXINT,
|
2010-03-08 19:20:59 +00:00
|
|
|
DEFAULT_LEFT,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | GST_PARAM_CONTROLLABLE));
|
2005-07-05 10:11:24 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_RIGHT,
|
2004-07-07 16:35:02 +00:00
|
|
|
g_param_spec_int ("right", "Right",
|
|
|
|
"Pixels to box at right (<0 = add a border)", G_MININT, G_MAXINT,
|
2010-03-08 19:20:59 +00:00
|
|
|
DEFAULT_RIGHT,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | GST_PARAM_CONTROLLABLE));
|
2005-07-05 10:11:24 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_TOP,
|
2004-07-07 16:35:02 +00:00
|
|
|
g_param_spec_int ("top", "Top",
|
|
|
|
"Pixels to box at top (<0 = add a border)", G_MININT, G_MAXINT,
|
2010-03-08 19:20:59 +00:00
|
|
|
DEFAULT_TOP,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | GST_PARAM_CONTROLLABLE));
|
2005-07-05 10:11:24 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_BOTTOM,
|
2004-07-07 16:35:02 +00:00
|
|
|
g_param_spec_int ("bottom", "Bottom",
|
|
|
|
"Pixels to box at bottom (<0 = add a border)", G_MININT, G_MAXINT,
|
2010-03-08 19:20:59 +00:00
|
|
|
DEFAULT_BOTTOM,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | GST_PARAM_CONTROLLABLE));
|
2005-07-05 10:11:24 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_ALPHA,
|
2004-07-07 16:35:02 +00:00
|
|
|
g_param_spec_double ("alpha", "Alpha", "Alpha value picture", 0.0, 1.0,
|
2010-03-08 19:20:59 +00:00
|
|
|
DEFAULT_ALPHA,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | GST_PARAM_CONTROLLABLE));
|
2005-07-05 10:11:24 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_BORDER_ALPHA,
|
2010-03-08 19:09:01 +00:00
|
|
|
g_param_spec_double ("border-alpha", "Border Alpha",
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
"Alpha value of the border", 0.0, 1.0, DEFAULT_BORDER_ALPHA,
|
2010-03-08 19:20:59 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | GST_PARAM_CONTROLLABLE));
|
2009-08-14 11:40:21 +00:00
|
|
|
/**
|
|
|
|
* GstVideoBox:autocrop
|
|
|
|
*
|
|
|
|
* If set to %TRUE videobox will automatically crop/pad the input
|
|
|
|
* video to be centered in the output.
|
|
|
|
*
|
|
|
|
* Since: 0.10.16
|
|
|
|
**/
|
2009-08-14 11:15:57 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_AUTOCROP,
|
|
|
|
g_param_spec_boolean ("autocrop", "Auto crop",
|
2010-03-08 19:09:01 +00:00
|
|
|
"Auto crop", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
trans_class->transform = GST_DEBUG_FUNCPTR (gst_video_box_transform);
|
2006-11-19 16:30:19 +00:00
|
|
|
trans_class->transform_caps =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_video_box_transform_caps);
|
|
|
|
trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_video_box_set_caps);
|
|
|
|
trans_class->get_unit_size = GST_DEBUG_FUNCPTR (gst_video_box_get_unit_size);
|
2010-03-22 15:58:26 +00:00
|
|
|
trans_class->fixate_caps = GST_DEBUG_FUNCPTR (gst_video_box_fixate_caps);
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-08-28 17:59:20 +00:00
|
|
|
gst_video_box_init (GstVideoBox * video_box, GstVideoBoxClass * g_class)
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
{
|
|
|
|
video_box->box_right = DEFAULT_RIGHT;
|
|
|
|
video_box->box_left = DEFAULT_LEFT;
|
|
|
|
video_box->box_top = DEFAULT_TOP;
|
|
|
|
video_box->box_bottom = DEFAULT_BOTTOM;
|
2005-07-07 18:38:54 +00:00
|
|
|
video_box->crop_right = 0;
|
|
|
|
video_box->crop_left = 0;
|
|
|
|
video_box->crop_top = 0;
|
|
|
|
video_box->crop_bottom = 0;
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
video_box->fill_type = DEFAULT_FILL_TYPE;
|
|
|
|
video_box->alpha = DEFAULT_ALPHA;
|
|
|
|
video_box->border_alpha = DEFAULT_BORDER_ALPHA;
|
2009-08-14 11:15:57 +00:00
|
|
|
video_box->autocrop = FALSE;
|
2009-08-14 11:26:36 +00:00
|
|
|
|
|
|
|
video_box->mutex = g_mutex_new ();
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_video_box_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
2005-07-05 10:11:24 +00:00
|
|
|
GstVideoBox *video_box = GST_VIDEO_BOX (object);
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
|
2009-08-14 11:26:36 +00:00
|
|
|
g_mutex_lock (video_box->mutex);
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
switch (prop_id) {
|
2005-07-05 10:11:24 +00:00
|
|
|
case PROP_LEFT:
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
video_box->box_left = g_value_get_int (value);
|
|
|
|
if (video_box->box_left < 0) {
|
|
|
|
video_box->border_left = -video_box->box_left;
|
|
|
|
video_box->crop_left = 0;
|
|
|
|
} else {
|
|
|
|
video_box->border_left = 0;
|
|
|
|
video_box->crop_left = video_box->box_left;
|
|
|
|
}
|
|
|
|
break;
|
2005-07-05 10:11:24 +00:00
|
|
|
case PROP_RIGHT:
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
video_box->box_right = g_value_get_int (value);
|
|
|
|
if (video_box->box_right < 0) {
|
|
|
|
video_box->border_right = -video_box->box_right;
|
|
|
|
video_box->crop_right = 0;
|
|
|
|
} else {
|
|
|
|
video_box->border_right = 0;
|
|
|
|
video_box->crop_right = video_box->box_right;
|
|
|
|
}
|
|
|
|
break;
|
2005-07-05 10:11:24 +00:00
|
|
|
case PROP_TOP:
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
video_box->box_top = g_value_get_int (value);
|
|
|
|
if (video_box->box_top < 0) {
|
|
|
|
video_box->border_top = -video_box->box_top;
|
|
|
|
video_box->crop_top = 0;
|
|
|
|
} else {
|
|
|
|
video_box->border_top = 0;
|
|
|
|
video_box->crop_top = video_box->box_top;
|
|
|
|
}
|
|
|
|
break;
|
2005-07-05 10:11:24 +00:00
|
|
|
case PROP_BOTTOM:
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
video_box->box_bottom = g_value_get_int (value);
|
|
|
|
if (video_box->box_bottom < 0) {
|
|
|
|
video_box->border_bottom = -video_box->box_bottom;
|
|
|
|
video_box->crop_bottom = 0;
|
|
|
|
} else {
|
|
|
|
video_box->border_bottom = 0;
|
|
|
|
video_box->crop_bottom = video_box->box_bottom;
|
|
|
|
}
|
|
|
|
break;
|
2005-07-05 10:11:24 +00:00
|
|
|
case PROP_FILL_TYPE:
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
video_box->fill_type = g_value_get_enum (value);
|
|
|
|
break;
|
2005-07-05 10:11:24 +00:00
|
|
|
case PROP_ALPHA:
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
video_box->alpha = g_value_get_double (value);
|
|
|
|
break;
|
2005-07-05 10:11:24 +00:00
|
|
|
case PROP_BORDER_ALPHA:
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
video_box->border_alpha = g_value_get_double (value);
|
|
|
|
break;
|
2009-08-14 11:15:57 +00:00
|
|
|
case PROP_AUTOCROP:
|
|
|
|
video_box->autocrop = g_value_get_boolean (value);
|
|
|
|
break;
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
2010-03-22 15:58:26 +00:00
|
|
|
gst_video_box_recalc_transform (video_box);
|
2009-08-14 11:26:36 +00:00
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (video_box, "Calling reconfigure");
|
2010-03-08 19:09:01 +00:00
|
|
|
gst_base_transform_reconfigure (GST_BASE_TRANSFORM_CAST (video_box));
|
2009-08-14 11:26:36 +00:00
|
|
|
|
|
|
|
g_mutex_unlock (video_box->mutex);
|
2009-08-14 11:15:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_video_box_autocrop (GstVideoBox * video_box)
|
|
|
|
{
|
2010-03-08 20:17:58 +00:00
|
|
|
gint crop_w = video_box->in_width - video_box->out_width;
|
|
|
|
gint crop_h = video_box->in_height - video_box->out_height;
|
2009-08-14 11:15:57 +00:00
|
|
|
|
2010-03-08 20:17:58 +00:00
|
|
|
video_box->box_left = crop_w / 2;
|
2009-08-14 11:15:57 +00:00
|
|
|
if (video_box->box_left < 0) {
|
|
|
|
video_box->border_left = -video_box->box_left;
|
|
|
|
video_box->crop_left = 0;
|
|
|
|
} else {
|
|
|
|
video_box->border_left = 0;
|
|
|
|
video_box->crop_left = video_box->box_left;
|
|
|
|
}
|
|
|
|
|
2010-03-08 20:17:58 +00:00
|
|
|
/* Round down/up for odd width differences */
|
|
|
|
if (crop_w < 0)
|
|
|
|
crop_w -= 1;
|
|
|
|
else
|
|
|
|
crop_w += 1;
|
|
|
|
|
|
|
|
video_box->box_right = crop_w / 2;
|
2009-08-14 11:15:57 +00:00
|
|
|
if (video_box->box_right < 0) {
|
|
|
|
video_box->border_right = -video_box->box_right;
|
|
|
|
video_box->crop_right = 0;
|
|
|
|
} else {
|
|
|
|
video_box->border_right = 0;
|
|
|
|
video_box->crop_right = video_box->box_right;
|
|
|
|
}
|
|
|
|
|
2010-03-08 20:17:58 +00:00
|
|
|
video_box->box_top = crop_h / 2;
|
2009-08-14 11:15:57 +00:00
|
|
|
if (video_box->box_top < 0) {
|
|
|
|
video_box->border_top = -video_box->box_top;
|
|
|
|
video_box->crop_top = 0;
|
|
|
|
} else {
|
|
|
|
video_box->border_top = 0;
|
|
|
|
video_box->crop_top = video_box->box_top;
|
|
|
|
}
|
|
|
|
|
2010-03-08 20:17:58 +00:00
|
|
|
/* Round down/up for odd height differences */
|
|
|
|
if (crop_h < 0)
|
|
|
|
crop_h -= 1;
|
|
|
|
else
|
|
|
|
crop_h += 1;
|
|
|
|
video_box->box_bottom = crop_h / 2;
|
|
|
|
|
2009-08-14 11:15:57 +00:00
|
|
|
if (video_box->box_bottom < 0) {
|
|
|
|
video_box->border_bottom = -video_box->box_bottom;
|
|
|
|
video_box->crop_bottom = 0;
|
|
|
|
} else {
|
|
|
|
video_box->border_bottom = 0;
|
|
|
|
video_box->crop_bottom = video_box->box_bottom;
|
|
|
|
}
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
}
|
2005-10-26 14:08:49 +00:00
|
|
|
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
static void
|
|
|
|
gst_video_box_get_property (GObject * object, guint prop_id, GValue * value,
|
|
|
|
GParamSpec * pspec)
|
|
|
|
{
|
2005-07-05 10:11:24 +00:00
|
|
|
GstVideoBox *video_box = GST_VIDEO_BOX (object);
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
2005-07-05 10:11:24 +00:00
|
|
|
case PROP_LEFT:
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
g_value_set_int (value, video_box->box_left);
|
|
|
|
break;
|
2005-07-05 10:11:24 +00:00
|
|
|
case PROP_RIGHT:
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
g_value_set_int (value, video_box->box_right);
|
|
|
|
break;
|
2005-07-05 10:11:24 +00:00
|
|
|
case PROP_TOP:
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
g_value_set_int (value, video_box->box_top);
|
|
|
|
break;
|
2005-07-05 10:11:24 +00:00
|
|
|
case PROP_BOTTOM:
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
g_value_set_int (value, video_box->box_bottom);
|
|
|
|
break;
|
2005-07-05 10:11:24 +00:00
|
|
|
case PROP_FILL_TYPE:
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
g_value_set_enum (value, video_box->fill_type);
|
|
|
|
break;
|
2005-07-05 10:11:24 +00:00
|
|
|
case PROP_ALPHA:
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
g_value_set_double (value, video_box->alpha);
|
|
|
|
break;
|
2005-07-05 10:11:24 +00:00
|
|
|
case PROP_BORDER_ALPHA:
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
g_value_set_double (value, video_box->border_alpha);
|
|
|
|
break;
|
2009-08-14 11:15:57 +00:00
|
|
|
case PROP_AUTOCROP:
|
|
|
|
g_value_set_boolean (value, video_box->autocrop);
|
|
|
|
break;
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-07-05 10:11:24 +00:00
|
|
|
static GstCaps *
|
2005-08-24 13:34:05 +00:00
|
|
|
gst_video_box_transform_caps (GstBaseTransform * trans,
|
|
|
|
GstPadDirection direction, GstCaps * from)
|
2005-07-05 10:11:24 +00:00
|
|
|
{
|
2010-03-08 19:09:01 +00:00
|
|
|
GstVideoBox *video_box = GST_VIDEO_BOX (trans);
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
GstCaps *to, *ret;
|
|
|
|
const GstCaps *templ;
|
2010-04-05 13:51:13 +00:00
|
|
|
const gchar *name;
|
2005-10-24 13:22:14 +00:00
|
|
|
GstStructure *structure;
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
GstPad *other;
|
|
|
|
gint width, height;
|
2005-07-05 10:11:24 +00:00
|
|
|
|
2005-10-24 13:22:14 +00:00
|
|
|
to = gst_caps_copy (from);
|
2010-04-07 14:11:11 +00:00
|
|
|
/* Just to be sure... */
|
|
|
|
gst_caps_truncate (to);
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
structure = gst_caps_get_structure (to, 0);
|
|
|
|
|
2010-04-07 14:11:11 +00:00
|
|
|
/* Transform width/height */
|
|
|
|
if (video_box->autocrop) {
|
|
|
|
gst_structure_remove_field (structure, "width");
|
|
|
|
gst_structure_remove_field (structure, "height");
|
|
|
|
} else {
|
|
|
|
/* calculate width and height */
|
|
|
|
if (gst_structure_get_int (structure, "width", &width)) {
|
|
|
|
if (direction == GST_PAD_SINK) {
|
|
|
|
width -= video_box->box_left;
|
|
|
|
width -= video_box->box_right;
|
|
|
|
} else {
|
|
|
|
width += video_box->box_left;
|
|
|
|
width += video_box->box_right;
|
|
|
|
}
|
|
|
|
if (width <= 0)
|
|
|
|
width = 1;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (trans, "New caps width: %d", width);
|
|
|
|
gst_structure_set (structure, "width", G_TYPE_INT, width, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gst_structure_get_int (structure, "height", &height)) {
|
|
|
|
if (direction == GST_PAD_SINK) {
|
|
|
|
height -= video_box->box_top;
|
|
|
|
height -= video_box->box_bottom;
|
|
|
|
} else {
|
|
|
|
height += video_box->box_top;
|
|
|
|
height += video_box->box_bottom;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (height <= 0)
|
|
|
|
height = 1;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (trans, "New caps height: %d", height);
|
|
|
|
gst_structure_set (structure, "height", G_TYPE_INT, height, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Supported conversions:
|
|
|
|
* I420->AYUV
|
2010-04-07 15:43:56 +00:00
|
|
|
* I420->YV12
|
|
|
|
* YV12->AYUV
|
|
|
|
* YV12->I420
|
2010-04-07 14:11:11 +00:00
|
|
|
* AYUV->I420
|
2010-04-07 15:43:56 +00:00
|
|
|
* AYUV->YV12
|
2010-04-07 14:11:11 +00:00
|
|
|
* AYUV->xRGB (24bpp, 32bpp, incl. alpha)
|
|
|
|
* xRGB->xRGB (24bpp, 32bpp, from/to all variants, incl. alpha)
|
|
|
|
* xRGB->AYUV (24bpp, 32bpp, incl. alpha)
|
|
|
|
*
|
|
|
|
* Passthrough only for everything else.
|
2010-04-05 13:51:13 +00:00
|
|
|
*/
|
|
|
|
name = gst_structure_get_name (structure);
|
|
|
|
if (g_str_equal (name, "video/x-raw-yuv")) {
|
|
|
|
guint32 fourcc;
|
|
|
|
|
|
|
|
if (gst_structure_get_fourcc (structure, "format", &fourcc) &&
|
|
|
|
(fourcc == GST_STR_FOURCC ("AYUV") ||
|
2010-04-07 15:43:56 +00:00
|
|
|
fourcc == GST_STR_FOURCC ("I420") ||
|
|
|
|
fourcc == GST_STR_FOURCC ("YV12"))) {
|
2010-04-05 13:51:13 +00:00
|
|
|
GValue list = { 0, };
|
|
|
|
GValue val = { 0, };
|
2010-04-07 14:11:11 +00:00
|
|
|
GstStructure *s2;
|
2010-04-05 13:51:13 +00:00
|
|
|
|
|
|
|
/* get rid of format */
|
|
|
|
gst_structure_remove_field (structure, "format");
|
|
|
|
gst_structure_remove_field (structure, "color-matrix");
|
|
|
|
gst_structure_remove_field (structure, "chroma-site");
|
|
|
|
|
2010-04-07 14:11:11 +00:00
|
|
|
s2 = gst_structure_copy (structure);
|
|
|
|
|
2010-04-05 13:51:13 +00:00
|
|
|
g_value_init (&list, GST_TYPE_LIST);
|
|
|
|
g_value_init (&val, GST_TYPE_FOURCC);
|
|
|
|
gst_value_set_fourcc (&val, GST_STR_FOURCC ("AYUV"));
|
|
|
|
gst_value_list_append_value (&list, &val);
|
|
|
|
g_value_reset (&val);
|
|
|
|
gst_value_set_fourcc (&val, GST_STR_FOURCC ("I420"));
|
|
|
|
gst_value_list_append_value (&list, &val);
|
2010-04-07 15:43:56 +00:00
|
|
|
g_value_reset (&val);
|
|
|
|
gst_value_set_fourcc (&val, GST_STR_FOURCC ("YV12"));
|
|
|
|
gst_value_list_append_value (&list, &val);
|
2010-04-07 14:11:11 +00:00
|
|
|
g_value_unset (&val);
|
2010-04-05 13:51:13 +00:00
|
|
|
gst_structure_set_value (structure, "format", &list);
|
|
|
|
g_value_unset (&list);
|
2010-04-07 14:11:11 +00:00
|
|
|
|
2010-04-14 16:13:56 +00:00
|
|
|
/* We can only convert to RGB if input is AYUV */
|
|
|
|
if (fourcc == GST_STR_FOURCC ("AYUV")) {
|
|
|
|
gst_structure_set_name (s2, "video/x-raw-rgb");
|
|
|
|
g_value_init (&list, GST_TYPE_LIST);
|
|
|
|
g_value_init (&val, G_TYPE_INT);
|
|
|
|
g_value_set_int (&val, 32);
|
|
|
|
gst_value_list_append_value (&list, &val);
|
|
|
|
g_value_reset (&val);
|
|
|
|
g_value_set_int (&val, 24);
|
|
|
|
gst_value_list_append_value (&list, &val);
|
|
|
|
g_value_unset (&val);
|
|
|
|
gst_structure_set_value (s2, "depth", &list);
|
|
|
|
gst_structure_set_value (s2, "bpp", &list);
|
|
|
|
g_value_unset (&list);
|
|
|
|
}
|
2010-04-07 14:11:11 +00:00
|
|
|
gst_caps_append_structure (to, s2);
|
2010-04-05 13:51:13 +00:00
|
|
|
}
|
|
|
|
} else if (g_str_equal (name, "video/x-raw-rgb")) {
|
|
|
|
gint bpp;
|
|
|
|
|
2010-04-05 15:08:15 +00:00
|
|
|
if (gst_structure_get_int (structure, "bpp", &bpp) &&
|
|
|
|
(bpp == 32 || bpp == 24)) {
|
2010-04-05 13:51:13 +00:00
|
|
|
GValue list = { 0, };
|
|
|
|
GValue val = { 0, };
|
2010-04-07 14:11:11 +00:00
|
|
|
GstStructure *s2;
|
2010-04-05 13:51:13 +00:00
|
|
|
|
|
|
|
/* get rid of format */
|
|
|
|
gst_structure_remove_field (structure, "depth");
|
2010-04-05 15:08:15 +00:00
|
|
|
gst_structure_remove_field (structure, "bpp");
|
2010-04-05 13:51:13 +00:00
|
|
|
gst_structure_remove_field (structure, "red_mask");
|
|
|
|
gst_structure_remove_field (structure, "green_mask");
|
|
|
|
gst_structure_remove_field (structure, "blue_mask");
|
|
|
|
gst_structure_remove_field (structure, "alpha_mask");
|
|
|
|
|
2010-04-07 14:11:11 +00:00
|
|
|
s2 = gst_structure_copy (structure);
|
|
|
|
|
2010-04-05 13:51:13 +00:00
|
|
|
g_value_init (&list, GST_TYPE_LIST);
|
|
|
|
g_value_init (&val, G_TYPE_INT);
|
|
|
|
g_value_set_int (&val, 32);
|
|
|
|
gst_value_list_append_value (&list, &val);
|
|
|
|
g_value_reset (&val);
|
|
|
|
g_value_set_int (&val, 24);
|
|
|
|
gst_value_list_append_value (&list, &val);
|
2010-04-07 14:11:11 +00:00
|
|
|
g_value_unset (&val);
|
2010-04-05 13:51:13 +00:00
|
|
|
gst_structure_set_value (structure, "depth", &list);
|
2010-04-05 15:08:15 +00:00
|
|
|
gst_structure_set_value (structure, "bpp", &list);
|
2010-04-05 13:51:13 +00:00
|
|
|
g_value_unset (&list);
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
|
2010-04-07 14:11:11 +00:00
|
|
|
gst_structure_set_name (s2, "video/x-raw-yuv");
|
|
|
|
gst_structure_set (s2, "format", GST_TYPE_FOURCC, GST_STR_FOURCC ("AYUV"),
|
|
|
|
NULL);
|
|
|
|
gst_caps_append_structure (to, s2);
|
2009-08-14 11:15:57 +00:00
|
|
|
}
|
2005-07-05 10:11:24 +00:00
|
|
|
}
|
|
|
|
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
/* filter against set allowed caps on the pad */
|
|
|
|
other = (direction == GST_PAD_SINK) ? trans->srcpad : trans->sinkpad;
|
|
|
|
|
|
|
|
templ = gst_pad_get_pad_template_caps (other);
|
|
|
|
ret = gst_caps_intersect (to, templ);
|
|
|
|
gst_caps_unref (to);
|
2005-10-24 13:22:14 +00:00
|
|
|
|
2005-10-26 17:23:06 +00:00
|
|
|
GST_DEBUG_OBJECT (video_box, "direction %d, transformed %" GST_PTR_FORMAT
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
" to %" GST_PTR_FORMAT, direction, from, ret);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2009-08-14 11:15:57 +00:00
|
|
|
static gboolean
|
2010-03-22 15:58:26 +00:00
|
|
|
gst_video_box_recalc_transform (GstVideoBox * video_box)
|
2009-08-14 11:15:57 +00:00
|
|
|
{
|
|
|
|
gboolean res = TRUE;
|
|
|
|
|
|
|
|
/* if we have the same format in and out and we don't need to perform any
|
2010-03-08 19:09:01 +00:00
|
|
|
* cropping at all, we can just operate in passthrough mode */
|
2010-03-08 20:02:19 +00:00
|
|
|
if (video_box->in_format == video_box->out_format &&
|
2009-08-14 11:15:57 +00:00
|
|
|
video_box->box_left == 0 && video_box->box_right == 0 &&
|
2010-03-22 15:58:26 +00:00
|
|
|
video_box->box_top == 0 && video_box->box_bottom == 0 &&
|
|
|
|
video_box->in_sdtv == video_box->out_sdtv) {
|
2009-08-14 11:15:57 +00:00
|
|
|
|
|
|
|
GST_LOG_OBJECT (video_box, "we are using passthrough");
|
2010-03-08 19:09:01 +00:00
|
|
|
gst_base_transform_set_passthrough (GST_BASE_TRANSFORM_CAST (video_box),
|
|
|
|
TRUE);
|
2009-08-14 11:15:57 +00:00
|
|
|
} else {
|
|
|
|
GST_LOG_OBJECT (video_box, "we are not using passthrough");
|
2010-03-08 19:09:01 +00:00
|
|
|
gst_base_transform_set_passthrough (GST_BASE_TRANSFORM_CAST (video_box),
|
|
|
|
FALSE);
|
2009-08-14 11:15:57 +00:00
|
|
|
}
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2010-03-22 15:58:26 +00:00
|
|
|
static gboolean
|
|
|
|
gst_video_box_select_processing_functions (GstVideoBox * video_box)
|
|
|
|
{
|
|
|
|
switch (video_box->out_format) {
|
|
|
|
case GST_VIDEO_FORMAT_AYUV:
|
|
|
|
video_box->fill = fill_ayuv;
|
|
|
|
switch (video_box->in_format) {
|
|
|
|
case GST_VIDEO_FORMAT_AYUV:
|
|
|
|
video_box->copy = copy_ayuv_ayuv;
|
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_I420:
|
2010-04-07 15:43:56 +00:00
|
|
|
case GST_VIDEO_FORMAT_YV12:
|
2010-03-22 15:58:26 +00:00
|
|
|
video_box->copy = copy_i420_ayuv;
|
|
|
|
break;
|
2010-04-07 14:11:11 +00:00
|
|
|
case GST_VIDEO_FORMAT_ARGB:
|
|
|
|
case GST_VIDEO_FORMAT_ABGR:
|
|
|
|
case GST_VIDEO_FORMAT_RGBA:
|
|
|
|
case GST_VIDEO_FORMAT_BGRA:
|
|
|
|
case GST_VIDEO_FORMAT_xRGB:
|
|
|
|
case GST_VIDEO_FORMAT_xBGR:
|
|
|
|
case GST_VIDEO_FORMAT_RGBx:
|
|
|
|
case GST_VIDEO_FORMAT_BGRx:
|
|
|
|
case GST_VIDEO_FORMAT_RGB:
|
|
|
|
case GST_VIDEO_FORMAT_BGR:
|
|
|
|
video_box->copy = copy_rgb32_ayuv;
|
|
|
|
break;
|
2010-03-22 15:58:26 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_I420:
|
2010-04-07 15:43:56 +00:00
|
|
|
case GST_VIDEO_FORMAT_YV12:
|
2010-03-22 15:58:26 +00:00
|
|
|
video_box->fill = fill_i420;
|
|
|
|
switch (video_box->in_format) {
|
|
|
|
case GST_VIDEO_FORMAT_AYUV:
|
|
|
|
video_box->copy = copy_ayuv_i420;
|
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_I420:
|
2010-04-07 15:43:56 +00:00
|
|
|
case GST_VIDEO_FORMAT_YV12:
|
2010-03-22 15:58:26 +00:00
|
|
|
video_box->copy = copy_i420_i420;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2010-04-05 13:51:13 +00:00
|
|
|
case GST_VIDEO_FORMAT_ARGB:
|
|
|
|
case GST_VIDEO_FORMAT_ABGR:
|
|
|
|
case GST_VIDEO_FORMAT_RGBA:
|
|
|
|
case GST_VIDEO_FORMAT_BGRA:
|
|
|
|
case GST_VIDEO_FORMAT_xRGB:
|
|
|
|
case GST_VIDEO_FORMAT_xBGR:
|
|
|
|
case GST_VIDEO_FORMAT_RGBx:
|
|
|
|
case GST_VIDEO_FORMAT_BGRx:
|
2010-04-05 15:08:15 +00:00
|
|
|
case GST_VIDEO_FORMAT_RGB:
|
|
|
|
case GST_VIDEO_FORMAT_BGR:
|
|
|
|
video_box->fill = (video_box->out_format == GST_VIDEO_FORMAT_BGR
|
|
|
|
|| video_box->out_format ==
|
|
|
|
GST_VIDEO_FORMAT_RGB) ? fill_rgb24 : fill_rgb32;
|
2010-04-05 13:51:13 +00:00
|
|
|
switch (video_box->in_format) {
|
|
|
|
case GST_VIDEO_FORMAT_ARGB:
|
|
|
|
case GST_VIDEO_FORMAT_ABGR:
|
|
|
|
case GST_VIDEO_FORMAT_RGBA:
|
|
|
|
case GST_VIDEO_FORMAT_BGRA:
|
|
|
|
case GST_VIDEO_FORMAT_xRGB:
|
|
|
|
case GST_VIDEO_FORMAT_xBGR:
|
|
|
|
case GST_VIDEO_FORMAT_RGBx:
|
|
|
|
case GST_VIDEO_FORMAT_BGRx:
|
2010-04-05 15:08:15 +00:00
|
|
|
case GST_VIDEO_FORMAT_RGB:
|
|
|
|
case GST_VIDEO_FORMAT_BGR:
|
2010-04-05 13:51:13 +00:00
|
|
|
video_box->copy = copy_rgb32;
|
2010-04-07 14:11:11 +00:00
|
|
|
break;
|
|
|
|
case GST_VIDEO_FORMAT_AYUV:
|
|
|
|
video_box->copy = copy_ayuv_rgb32;
|
2010-04-05 13:51:13 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2010-04-07 15:27:12 +00:00
|
|
|
case GST_VIDEO_FORMAT_GRAY8:
|
|
|
|
case GST_VIDEO_FORMAT_GRAY16_BE:
|
|
|
|
case GST_VIDEO_FORMAT_GRAY16_LE:
|
|
|
|
video_box->fill = fill_gray;
|
|
|
|
switch (video_box->in_format) {
|
|
|
|
case GST_VIDEO_FORMAT_GRAY8:
|
|
|
|
case GST_VIDEO_FORMAT_GRAY16_BE:
|
|
|
|
case GST_VIDEO_FORMAT_GRAY16_LE:
|
|
|
|
video_box->copy = copy_packed_simple;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2010-03-22 15:58:26 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return video_box->fill != NULL && video_box->copy != NULL;
|
|
|
|
}
|
|
|
|
|
2005-06-02 10:03:23 +00:00
|
|
|
static gboolean
|
2005-07-05 10:11:24 +00:00
|
|
|
gst_video_box_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out)
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
{
|
2010-03-08 19:09:01 +00:00
|
|
|
GstVideoBox *video_box = GST_VIDEO_BOX (trans);
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
gboolean ret;
|
2010-03-22 15:58:26 +00:00
|
|
|
const gchar *matrix;
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
|
2010-03-08 20:17:58 +00:00
|
|
|
g_mutex_lock (video_box->mutex);
|
|
|
|
|
2010-03-08 20:02:19 +00:00
|
|
|
ret =
|
|
|
|
gst_video_format_parse_caps (in, &video_box->in_format,
|
|
|
|
&video_box->in_width, &video_box->in_height);
|
|
|
|
ret &=
|
|
|
|
gst_video_format_parse_caps (out, &video_box->out_format,
|
|
|
|
&video_box->out_width, &video_box->out_height);
|
2005-07-07 18:38:54 +00:00
|
|
|
|
2010-03-22 15:58:26 +00:00
|
|
|
matrix = gst_video_parse_caps_color_matrix (in);
|
|
|
|
video_box->in_sdtv = matrix ? g_str_equal (matrix, "sdtv") : TRUE;
|
|
|
|
matrix = gst_video_parse_caps_color_matrix (out);
|
|
|
|
video_box->out_sdtv = matrix ? g_str_equal (matrix, "sdtv") : TRUE;
|
|
|
|
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
/* something wrong getting the caps */
|
|
|
|
if (!ret)
|
|
|
|
goto no_caps;
|
|
|
|
|
2008-10-21 12:38:35 +00:00
|
|
|
GST_DEBUG_OBJECT (trans, "Input w: %d h: %d", video_box->in_width,
|
|
|
|
video_box->in_height);
|
|
|
|
GST_DEBUG_OBJECT (trans, "Output w: %d h: %d", video_box->out_width,
|
|
|
|
video_box->out_height);
|
|
|
|
|
2009-08-14 11:15:57 +00:00
|
|
|
if (video_box->autocrop)
|
|
|
|
gst_video_box_autocrop (video_box);
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
|
2009-08-14 11:15:57 +00:00
|
|
|
/* recalc the transformation strategy */
|
2010-03-22 15:58:26 +00:00
|
|
|
ret = gst_video_box_recalc_transform (video_box);
|
2005-07-05 10:11:24 +00:00
|
|
|
|
2010-03-22 15:58:26 +00:00
|
|
|
if (ret)
|
|
|
|
ret = gst_video_box_select_processing_functions (video_box);
|
2010-03-08 20:17:58 +00:00
|
|
|
g_mutex_unlock (video_box->mutex);
|
|
|
|
|
2005-06-02 10:03:23 +00:00
|
|
|
return ret;
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
no_caps:
|
|
|
|
{
|
2010-03-08 20:02:19 +00:00
|
|
|
GST_DEBUG_OBJECT (video_box,
|
|
|
|
"Invalid caps: %" GST_PTR_FORMAT " -> %" GST_PTR_FORMAT, in, out);
|
2010-03-08 20:17:58 +00:00
|
|
|
g_mutex_unlock (video_box->mutex);
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
}
|
|
|
|
|
2005-08-24 13:34:05 +00:00
|
|
|
static gboolean
|
|
|
|
gst_video_box_get_unit_size (GstBaseTransform * trans, GstCaps * caps,
|
|
|
|
guint * size)
|
2005-07-15 10:42:30 +00:00
|
|
|
{
|
2010-03-08 19:09:01 +00:00
|
|
|
GstVideoBox *video_box = GST_VIDEO_BOX (trans);
|
2010-03-08 20:02:19 +00:00
|
|
|
GstVideoFormat format;
|
2005-10-17 15:14:29 +00:00
|
|
|
gint width, height;
|
2010-03-08 20:02:19 +00:00
|
|
|
gboolean ret;
|
2005-07-15 10:42:30 +00:00
|
|
|
|
2006-08-20 13:09:51 +00:00
|
|
|
g_assert (size);
|
|
|
|
|
2010-03-08 20:02:19 +00:00
|
|
|
ret = gst_video_format_parse_caps (caps, &format, &width, &height);
|
|
|
|
if (!ret) {
|
|
|
|
GST_ERROR_OBJECT (video_box, "Invalid caps: %" GST_PTR_FORMAT, caps);
|
|
|
|
return FALSE;
|
2005-07-15 10:42:30 +00:00
|
|
|
}
|
2005-08-04 20:05:51 +00:00
|
|
|
|
2010-03-08 20:02:19 +00:00
|
|
|
*size = gst_video_format_get_size (format, width, height);
|
|
|
|
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
GST_LOG_OBJECT (video_box, "Returning from _unit_size %d", *size);
|
|
|
|
|
2005-08-24 13:34:05 +00:00
|
|
|
return TRUE;
|
2005-07-15 10:42:30 +00:00
|
|
|
}
|
|
|
|
|
2005-01-19 17:09:57 +00:00
|
|
|
static void
|
2010-03-22 15:58:26 +00:00
|
|
|
gst_video_box_fixate_caps (GstBaseTransform * trans,
|
|
|
|
GstPadDirection direction, GstCaps * caps, GstCaps * othercaps)
|
2005-01-19 17:09:57 +00:00
|
|
|
{
|
2010-03-22 15:58:26 +00:00
|
|
|
gint width, height;
|
|
|
|
GstStructure *s;
|
|
|
|
gboolean ret;
|
2005-01-19 17:09:57 +00:00
|
|
|
|
2010-03-22 15:58:26 +00:00
|
|
|
ret = gst_video_format_parse_caps (caps, NULL, &width, &height);
|
|
|
|
if (!ret)
|
|
|
|
return;
|
2005-01-19 17:09:57 +00:00
|
|
|
|
2010-03-22 15:58:26 +00:00
|
|
|
s = gst_caps_get_structure (othercaps, 0);
|
|
|
|
gst_structure_fixate_field_nearest_int (s, "width", width);
|
|
|
|
gst_structure_fixate_field_nearest_int (s, "height", height);
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
}
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
static void
|
2010-03-22 15:58:26 +00:00
|
|
|
gst_video_box_process (GstVideoBox * video_box, const guint8 * src,
|
2010-03-21 19:14:19 +00:00
|
|
|
guint8 * dest)
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
{
|
2010-03-22 15:58:26 +00:00
|
|
|
guint b_alpha = CLAMP ((guint) video_box->border_alpha * 256, 0, 256);
|
|
|
|
guint i_alpha = CLAMP ((guint) video_box->alpha * 256, 0, 256);
|
|
|
|
GstVideoBoxFill fill_type = video_box->fill_type;
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
gint br, bl, bt, bb, crop_w, crop_h;
|
|
|
|
|
|
|
|
crop_h = 0;
|
|
|
|
crop_w = 0;
|
|
|
|
|
|
|
|
br = video_box->box_right;
|
|
|
|
bl = video_box->box_left;
|
|
|
|
bt = video_box->box_top;
|
|
|
|
bb = video_box->box_bottom;
|
|
|
|
|
|
|
|
if (br >= 0 && bl >= 0) {
|
|
|
|
crop_w = video_box->in_width - (br + bl);
|
|
|
|
} else if (br >= 0 && bl < 0) {
|
|
|
|
crop_w = video_box->in_width - (br);
|
|
|
|
} else if (br < 0 && bl >= 0) {
|
|
|
|
crop_w = video_box->in_width - (bl);
|
|
|
|
} else if (br < 0 && bl < 0) {
|
|
|
|
crop_w = video_box->in_width;
|
|
|
|
}
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
if (bb >= 0 && bt >= 0) {
|
|
|
|
crop_h = video_box->in_height - (bb + bt);
|
|
|
|
} else if (bb >= 0 && bt < 0) {
|
|
|
|
crop_h = video_box->in_height - (bb);
|
|
|
|
} else if (bb < 0 && bt >= 0) {
|
|
|
|
crop_h = video_box->in_height - (bt);
|
|
|
|
} else if (bb < 0 && bt < 0) {
|
|
|
|
crop_h = video_box->in_height;
|
|
|
|
}
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
|
2010-03-08 19:09:01 +00:00
|
|
|
GST_DEBUG_OBJECT (video_box, "Borders are: L:%d, R:%d, T:%d, B:%d", bl, br,
|
|
|
|
bt, bb);
|
2010-03-22 15:58:26 +00:00
|
|
|
GST_DEBUG_OBJECT (video_box, "Alpha value is: %u (frame) %u (border)",
|
|
|
|
i_alpha, b_alpha);
|
|
|
|
|
|
|
|
if (crop_h < 0 || crop_w < 0) {
|
2010-04-05 13:51:13 +00:00
|
|
|
video_box->fill (fill_type, b_alpha, video_box->out_format, dest,
|
|
|
|
video_box->out_sdtv, video_box->out_width, video_box->out_height);
|
2010-03-22 15:58:26 +00:00
|
|
|
} else if (bb == 0 && bt == 0 && br == 0 && bl == 0) {
|
2010-04-05 13:51:13 +00:00
|
|
|
video_box->copy (i_alpha, video_box->out_format, dest, video_box->out_sdtv,
|
|
|
|
video_box->out_width, video_box->out_height, 0, 0, video_box->in_format,
|
|
|
|
src, video_box->in_sdtv, video_box->in_width, video_box->in_height, 0,
|
|
|
|
0, crop_w, crop_h);
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
} else {
|
2010-03-22 15:58:26 +00:00
|
|
|
gint src_x = 0, src_y = 0;
|
|
|
|
gint dest_x = 0, dest_y = 0;
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
|
2010-03-26 09:31:22 +00:00
|
|
|
/* Fill everything if a border should be added somewhere */
|
|
|
|
if (bt < 0 || bb < 0 || br < 0 || bl < 0)
|
2010-04-05 13:51:13 +00:00
|
|
|
video_box->fill (fill_type, b_alpha, video_box->out_format, dest,
|
|
|
|
video_box->out_sdtv, video_box->out_width, video_box->out_height);
|
2010-03-26 09:31:22 +00:00
|
|
|
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
/* Top border */
|
|
|
|
if (bt < 0) {
|
2010-03-22 15:58:26 +00:00
|
|
|
dest_y += -bt;
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
} else {
|
2010-03-22 15:58:26 +00:00
|
|
|
src_y += bt;
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
}
|
2005-01-19 17:09:57 +00:00
|
|
|
|
2010-03-22 15:58:26 +00:00
|
|
|
/* Left border */
|
|
|
|
if (bl < 0) {
|
|
|
|
dest_x += -bl;
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
} else {
|
2010-03-22 15:58:26 +00:00
|
|
|
src_x += bl;
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
}
|
|
|
|
|
2010-03-22 15:58:26 +00:00
|
|
|
/* Frame */
|
2010-04-05 13:51:13 +00:00
|
|
|
video_box->copy (i_alpha, video_box->out_format, dest, video_box->out_sdtv,
|
|
|
|
video_box->out_width, video_box->out_height, dest_x, dest_y,
|
|
|
|
video_box->in_format, src, video_box->in_sdtv, video_box->in_width,
|
|
|
|
video_box->in_height, src_x, src_y, crop_w, crop_h);
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
}
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
|
2010-03-22 15:58:26 +00:00
|
|
|
GST_LOG_OBJECT (video_box, "image created");
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
}
|
|
|
|
|
2005-06-02 10:03:23 +00:00
|
|
|
static GstFlowReturn
|
2005-07-05 10:11:24 +00:00
|
|
|
gst_video_box_transform (GstBaseTransform * trans, GstBuffer * in,
|
2005-07-15 10:42:30 +00:00
|
|
|
GstBuffer * out)
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
{
|
2010-03-08 19:09:01 +00:00
|
|
|
GstVideoBox *video_box = GST_VIDEO_BOX (trans);
|
2010-03-21 19:14:19 +00:00
|
|
|
const guint8 *indata;
|
|
|
|
guint8 *outdata;
|
2010-03-08 19:20:59 +00:00
|
|
|
GstClockTime timestamp, stream_time;
|
|
|
|
|
|
|
|
timestamp = GST_BUFFER_TIMESTAMP (in);
|
|
|
|
stream_time =
|
|
|
|
gst_segment_to_stream_time (&trans->segment, GST_FORMAT_TIME, timestamp);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (video_box, "sync to %" GST_TIME_FORMAT,
|
|
|
|
GST_TIME_ARGS (timestamp));
|
|
|
|
|
|
|
|
if (GST_CLOCK_TIME_IS_VALID (stream_time))
|
|
|
|
gst_object_sync_values (G_OBJECT (video_box), stream_time);
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
|
gst/videobox/gstvideobox.c: Add AYUV->AYUV and AYUV->I420 formats.
Original commit message from CVS:
Based on patch by: Dejan Sakelšak <sakdean at gmail dot com>
* gst/videobox/gstvideobox.c: (gst_video_box_class_init),
(gst_video_box_set_property), (gst_video_box_transform_caps),
(video_box_recalc_transform), (gst_video_box_set_caps),
(gst_video_box_get_unit_size), (gst_video_box_apply_alpha),
(gst_video_box_ayuv_ayuv), (gst_video_box_clear), (UVfloor),
(UVceil), (gst_video_box_ayuv_i420), (gst_video_box_i420_ayuv),
(gst_video_box_i420_i420), (gst_video_box_transform),
(plugin_init):
Add AYUV->AYUV and AYUV->I420 formats.
Fix negotiation and I420->AYUV conversion.
Fixes #429329.
2007-05-28 15:01:33 +00:00
|
|
|
indata = GST_BUFFER_DATA (in);
|
|
|
|
outdata = GST_BUFFER_DATA (out);
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
|
2009-08-14 11:26:36 +00:00
|
|
|
g_mutex_lock (video_box->mutex);
|
2010-03-22 15:58:26 +00:00
|
|
|
gst_video_box_process (video_box, indata, outdata);
|
2009-08-14 11:26:36 +00:00
|
|
|
g_mutex_unlock (video_box->mutex);
|
2005-07-15 10:42:30 +00:00
|
|
|
return GST_FLOW_OK;
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
}
|
|
|
|
|
2009-01-28 10:29:42 +00:00
|
|
|
/* FIXME: 0.11 merge with videocrop plugin */
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
static gboolean
|
|
|
|
plugin_init (GstPlugin * plugin)
|
|
|
|
{
|
2007-11-29 11:40:15 +00:00
|
|
|
oil_init ();
|
|
|
|
|
2010-03-08 19:20:59 +00:00
|
|
|
gst_controller_init (NULL, NULL);
|
|
|
|
|
2010-03-08 19:09:01 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (videobox_debug, "videobox", 0,
|
|
|
|
"Resizes a video by adding borders or cropping");
|
|
|
|
|
A plugin to add an alpha channel to I420 video. Can optionally do chroma keying.
Original commit message from CVS:
* configure.ac:
* gst/alpha/Makefile.am:
* gst/alpha/gstalpha.c: (gst_alpha_method_get_type),
(gst_alpha_get_type), (gst_alpha_base_init),
(gst_alpha_class_init), (gst_alpha_init), (gst_alpha_set_property),
(gst_alpha_get_property), (gst_alpha_sink_link), (gst_alpha_add),
(gst_alpha_chroma_key), (gst_alpha_chain),
(gst_alpha_change_state), (plugin_init):
A plugin to add an alpha channel to I420 video. Can optionally do
chroma keying.
* gst/multipart/Makefile.am:
* gst/multipart/multipart.c: (plugin_init):
* gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
(gst_multipart_demux_class_init), (gst_multipart_demux_init),
(gst_multipart_demux_finalize), (gst_multipart_demux_handle_event),
(gst_multipart_find_pad_by_mime), (gst_multipart_demux_chain),
(gst_multipart_demux_change_state),
(gst_multipart_demux_plugin_init):
* gst/multipart/multipartmux.c: (gst_multipart_mux_get_type),
(gst_multipart_mux_base_init), (gst_multipart_mux_class_init),
(gst_multipart_mux_get_sink_event_masks), (gst_multipart_mux_init),
(gst_multipart_mux_sinkconnect), (gst_multipart_mux_pad_link),
(gst_multipart_mux_pad_unlink),
(gst_multipart_mux_request_new_pad),
(gst_multipart_mux_handle_src_event),
(gst_multipart_mux_next_buffer), (gst_multipart_mux_compare_pads),
(gst_multipart_mux_queue_pads), (gst_multipart_mux_loop),
(gst_multipart_mux_get_property), (gst_multipart_mux_set_property),
(gst_multipart_mux_change_state), (gst_multipart_mux_plugin_init):
A Multipart demuxer/muxer. Not sure if it violates specs. Used to
send multipart jpeg images to a browser.
* gst/videobox/Makefile.am:
* gst/videobox/README:
* gst/videobox/gstvideobox.c: (gst_video_box_fill_get_type),
(gst_video_box_get_type), (gst_video_box_base_init),
(gst_video_box_class_init), (gst_video_box_init),
(gst_video_box_set_property), (gst_video_box_get_property),
(gst_video_box_sink_link), (gst_video_box_i420),
(gst_video_box_ayuv), (gst_video_box_chain),
(gst_video_box_change_state), (plugin_init):
Crops or adds borders around an image. can do alpha channel
borders as well.
* gst/videomixer/Makefile.am:
* gst/videomixer/README:
* gst/videomixer/videomixer.c: (gst_videomixer_pad_get_type),
(gst_videomixer_pad_base_init), (gst_videomixer_pad_class_init),
(gst_videomixer_pad_get_sink_event_masks),
(gst_videomixer_pad_get_property),
(gst_videomixer_pad_set_property),
(gst_videomixer_pad_sinkconnect), (gst_videomixer_pad_link),
(gst_videomixer_pad_unlink), (gst_videomixer_pad_init),
(gst_video_mixer_background_get_type), (gst_videomixer_get_type),
(gst_videomixer_base_init), (gst_videomixer_class_init),
(gst_videomixer_init), (gst_videomixer_request_new_pad),
(gst_videomixer_handle_src_event),
(gst_videomixer_blend_ayuv_i420), (gst_videomixer_fill_checker),
(gst_videomixer_fill_color), (gst_videomixer_fill_queues),
(gst_videomixer_blend_buffers), (gst_videomixer_update_queues),
(gst_videomixer_loop), (gst_videomixer_get_property),
(gst_videomixer_set_property), (gst_videomixer_change_state),
(plugin_init):
Generic video mixer plugin, can handle multiple inputs all with
different framerates and video sizes. Is fully alpha channel
aware.
2004-05-28 18:01:34 +00:00
|
|
|
return gst_element_register (plugin, "videobox", GST_RANK_NONE,
|
|
|
|
GST_TYPE_VIDEO_BOX);
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
|
|
|
"videobox",
|
|
|
|
"resizes a video by adding borders or cropping",
|
2005-11-14 02:13:35 +00:00
|
|
|
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
|