...
 
Commits (494)
......@@ -52,6 +52,7 @@ Makefile
/gst-libs/gst/audio/audio-marshal.[ch]
/gst-libs/gst/video/video-marshal.[ch]
/gst-libs/gst/*/*-enumtypes.[ch]
/tests/examples/compositor/crossfade
/tests/examples/playback/playback-test
tmp-orc.c
......
include: "https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/master/gitlab/ci_template.yml"
[submodule "common"]
path = common
url = https://anongit.freedesktop.org/git/gstreamer/common.git
url = https://gitlab.freedesktop.org/gstreamer/common.git
Subproject commit cd1dee06bf07f094677d0cf3eea4a2e8c2636b24
Subproject commit 59cb678164719ff59dcf6c8b93df4617a1075d11
......@@ -498,6 +498,7 @@ AG_GST_CHECK_PLUGIN(audioconvert)
AG_GST_CHECK_PLUGIN(audiomixer)
AG_GST_CHECK_PLUGIN(audiorate)
AG_GST_CHECK_PLUGIN(audiotestsrc)
AG_GST_CHECK_PLUGIN(compositor)
AG_GST_CHECK_PLUGIN(encoding)
AG_GST_CHECK_PLUGIN(videoconvert)
AG_GST_CHECK_PLUGIN(gio)
......@@ -922,6 +923,7 @@ gst/audiomixer/Makefile
gst/audiorate/Makefile
gst/audioresample/Makefile
gst/audiotestsrc/Makefile
gst/compositor/Makefile
gst/encoding/Makefile
gst/videoconvert/Makefile
gst/gio/Makefile
......@@ -1008,6 +1010,7 @@ tests/check/Makefile
tests/examples/Makefile
tests/examples/app/Makefile
tests/examples/audio/Makefile
tests/examples/compositor/Makefile
tests/examples/decodebin_next/Makefile
tests/examples/dynamic/Makefile
tests/examples/encoding/Makefile
......
......@@ -205,6 +205,8 @@
<xi:include href="xml/gstvideo.xml" />
<xi:include href="xml/gstvideometa.xml" />
<xi:include href="xml/gstvideoaffinetransformationmeta.xml" />
<xi:include href="xml/gstvideoaggregator.xml" />
<xi:include href="xml/gstvideoaggregatorpad.xml" />
<xi:include href="xml/gstvideooverlaycomposition.xml" />
<xi:include href="xml/gstvideofilter.xml" />
<xi:include href="xml/gstvideodither.xml" />
......
......@@ -393,6 +393,7 @@ GST_AUDIO_DECODER_STREAM_LOCK
GST_AUDIO_DECODER_STREAM_UNLOCK
gst_audio_decoder_finish_frame
gst_audio_decoder_set_output_format
gst_audio_decoder_set_output_caps
gst_audio_decoder_negotiate
gst_audio_decoder_allocate_output_buffer
gst_audio_decoder_get_allocator
......@@ -707,6 +708,7 @@ gst_audio_converter_update_config
gst_audio_converter_get_config
gst_audio_converter_reset
gst_audio_converter_supports_inplace
gst_audio_converter_is_passthrough
<SUBSECTION Standard>
gst_audio_converter_flags_get_type
GST_TYPE_AUDIO_CONVERTER_FLAGS
......@@ -1456,6 +1458,7 @@ GstRTCPType
GstRTCPPacket
GstRTCPSDESType
GstRTCPFBType
GstRTCPXRType
gst_rtcp_buffer_new_take_data
gst_rtcp_buffer_new_copy_data
......@@ -1549,6 +1552,36 @@ gst_rtcp_unix_to_ntp
gst_rtcp_sdes_name_to_type
gst_rtcp_sdes_type_to_name
gst_rtcp_packet_xr_first_rb
gst_rtcp_packet_xr_next_rb
gst_rtcp_packet_xr_get_ssrc
gst_rtcp_packet_xr_get_block_length
gst_rtcp_packet_xr_get_block_type
gst_rtcp_packet_xr_get_dlrr_block
gst_rtcp_packet_xr_get_prt_by_seq
gst_rtcp_packet_xr_get_prt_info
gst_rtcp_packet_xr_get_rle_info
gst_rtcp_packet_xr_get_rle_nth_chunk
gst_rtcp_packet_xr_get_rrt
gst_rtcp_packet_xr_get_summary_info
gst_rtcp_packet_xr_get_summary_jitter
gst_rtcp_packet_xr_get_summary_pkt
gst_rtcp_packet_xr_get_summary_ttl
gst_rtcp_packet_xr_get_voip_burst_metrics
gst_rtcp_packet_xr_get_voip_configuration_params
gst_rtcp_packet_xr_get_voip_delay_metrics
gst_rtcp_packet_xr_get_voip_jitter_buffer_params
gst_rtcp_packet_xr_get_voip_metrics_ssrc
gst_rtcp_packet_xr_get_voip_packet_metrics
gst_rtcp_packet_xr_get_voip_quality_metrics
gst_rtcp_packet_xr_get_voip_signal_metrics
<SUBSECTION Standard>
GST_RTCP_RTPFB_TYPE_RCTP_SR_REQ
GST_TYPE_RTCPFB_TYPE
......@@ -1557,6 +1590,7 @@ GST_TYPE_RTCP_TYPE
gst_rtcp_type_get_type
gst_rtcpfb_type_get_type
gst_rtcpsdes_type_get_type
gst_rtcpxr_type_get_type
</SECTION>
<SECTION>
......@@ -2762,6 +2796,7 @@ GST_VIDEO_FPS_RANGE
GST_VIDEO_FORMATS_ALL
GST_VIDEO_CAPS_MAKE
GST_VIDEO_CAPS_MAKE_WITH_FEATURES
GST_CAPS_FEATURE_FORMAT_INTERLACED
<SUBSECTION Standard>
gst_video_format_get_type
GST_TYPE_VIDEO_FORMAT
......@@ -2821,7 +2856,9 @@ GST_VIDEO_INFO_IS_GRAY
GST_VIDEO_INFO_HAS_ALPHA
GST_VIDEO_INFO_INTERLACE_MODE
GST_VIDEO_INFO_IS_INTERLACED
GST_VIDEO_INFO_FIELD_HEIGHT
GST_VIDEO_INFO_FIELD_ORDER
GST_VIDEO_INFO_FIELD_RATE_N
GST_VIDEO_INFO_FLAGS
GST_VIDEO_INFO_WIDTH
GST_VIDEO_INFO_HEIGHT
......@@ -2856,6 +2893,7 @@ gst_video_info_new
gst_video_info_copy
gst_video_info_free
gst_video_info_set_format
gst_video_info_set_interlaced_format
gst_video_info_from_caps
gst_video_info_to_caps
gst_video_info_convert
......@@ -3041,6 +3079,7 @@ gst_video_time_code_free
gst_video_time_code_copy
gst_video_time_code_init
gst_video_time_code_init_from_date_time
gst_video_time_code_init_from_date_time_full
GST_VIDEO_TIME_CODE_INIT
gst_video_time_code_clear
gst_video_time_code_is_valid
......@@ -3054,6 +3093,7 @@ gst_video_time_code_to_string
gst_video_time_code_add_interval
gst_video_time_code_new_from_string
gst_video_time_code_new_from_date_time
gst_video_time_code_new_from_date_time_full
<SUBSECTION>
GstVideoTimeCodeInterval
......@@ -3195,6 +3235,37 @@ GST_VIDEO_AFFINE_TRANSFORMATION_META_API_TYPE
GST_VIDEO_AFFINE_TRANSFORMATION_META_INFO
</SECTION>
<SECTION>
<FILE>gstvideoaggregator</FILE>
<TITLE>GstVideoAggregator</TITLE>
GstVideoAggregator
GstVideoAggregatorClass
<SUBSECTION Standard>
GST_IS_VIDEO_AGGREGATOR
GST_IS_VIDEO_AGGREGATOR_CLASS
GST_TYPE_VIDEO_AGGREGATOR
GST_VIDEO_AGGREGATOR
GST_VIDEO_AGGREGATOR_CLASS
GST_VIDEO_AGGREGATOR_GET_CLASS
gst_video_aggregator_get_type
GstVideoAggregatorPrivate
</SECTION>
<SECTION>
<FILE>gstvideoaggregatorpad</FILE>
<TITLE>GstVideoAggregatorPad</TITLE>
GstVideoAggregatorPad
GstVideoAggregatorPadClass
<SUBSECTION Standard>
GST_IS_VIDEO_AGGREGATOR_PAD
GST_IS_VIDEO_AGGREGATOR_PADCLASS
GST_TYPE_VIDEO_AGGREGATOR_PAD
GST_VIDEO_AGGREGATOR_PAD
GST_VIDEO_AGGREGATOR_PAD_CLASS
GST_VIDEO_AGGREGATOR_PAD_GET_CLASS
gst_video_aggregator_pad_get_type
</SECTION>
<SECTION>
<FILE>gstvideooverlaycomposition</FILE>
<INCLUDE>gst/video/video.h</INCLUDE>
......@@ -3340,6 +3411,7 @@ gst_video_decoder_get_estimate_rate
gst_video_decoder_get_output_state
gst_video_decoder_set_estimate_rate
gst_video_decoder_set_output_state
gst_video_decoder_set_interlaced_output_state
gst_video_decoder_set_max_errors
gst_video_decoder_set_packetized
gst_video_decoder_get_needs_format
......@@ -3535,11 +3607,20 @@ gst_video_vbi_parser_free
gst_video_vbi_parser_add_line
gst_video_vbi_parser_get_ancillary
gst_video_vbi_parser_copy
GstVideoVBIEncoder
gst_video_vbi_encoder_new
gst_video_vbi_encoder_free
gst_video_vbi_encoder_add_ancillary
gst_video_vbi_encoder_write_line
gst_video_vbi_encoder_copy
<SUBSECTION closedcaption>
GstVideoCaptionType
GstVideoCaptionMeta
gst_buffer_get_video_caption_meta
gst_buffer_add_video_caption_meta
gst_video_caption_type_from_caps
gst_video_caption_type_to_caps
<SUBSECTION Standard>
GST_TYPE_VIDEO_ANCILLARY_DID
GST_TYPE_VIDEO_ANCILLARY_DI_D16
......@@ -3550,6 +3631,7 @@ gst_video_caption_meta_get_info
GST_VIDEO_CAPTION_META_INFO
gst_video_caption_meta_api_get_type
gst_video_vbi_parser_get_type
gst_video_vbi_encoder_get_type
gst_video_ancillary_di_d16_get_type
gst_video_ancillary_did_get_type
gst_video_caption_type_get_type
......
......@@ -50,6 +50,8 @@ gst_video_filter_get_type
gst_video_sink_get_type
gst_color_balance_get_type
gst_color_balance_channel_get_type
gst_video_aggregator_get_type
gst_video_aggregator_pad_get_type
gst_video_direction_get_type
gst_video_orientation_get_type
gst_video_overlay_get_type
......
......@@ -31,6 +31,7 @@
<xi:include href="xml/element-audiotestsrc.xml" />
<xi:include href="xml/element-cdparanoiasrc.xml" />
<xi:include href="xml/element-clockoverlay.xml" />
<xi:include href="xml/element-compositor.xml" />
<xi:include href="xml/element-decodebin.xml" />
<xi:include href="xml/element-decodebin3.xml" />
<xi:include href="xml/element-encodebin.xml" />
......@@ -70,14 +71,19 @@
<xi:include href="xml/element-glfilterglass.xml" />
<xi:include href="xml/element-glimagesinkelement.xml" />
<xi:include href="xml/element-glimagesink.xml" />
<xi:include href="xml/element-glmixerbin.xml" />
<xi:include href="xml/element-glmosaic.xml" />
<xi:include href="xml/element-gloverlay.xml" />
<xi:include href="xml/element-glshader.xml" />
<xi:include href="xml/element-glsinkbin.xml" />
<xi:include href="xml/element-glsrcbin.xml" />
<xi:include href="xml/element-glstereomix.xml" />
<xi:include href="xml/element-glstereosplit.xml" />
<xi:include href="xml/element-gltestsrc.xml" />
<xi:include href="xml/element-gltransformation.xml" />
<xi:include href="xml/element-glupload.xml" />
<xi:include href="xml/element-glvideomixerelement.xml" />
<xi:include href="xml/element-glvideomixer.xml" />
<xi:include href="xml/element-glviewconvert.xml" />
<xi:include href="xml/element-multifdsink.xml" />
<xi:include href="xml/element-multisocketsink.xml" />
......@@ -140,6 +146,7 @@
<xi:include href="xml/plugin-audioresample.xml" />
<xi:include href="xml/plugin-audiotestsrc.xml" />
<xi:include href="xml/plugin-cdparanoia.xml" />
<xi:include href="xml/plugin-compositor.xml" />
<xi:include href="xml/plugin-encoding.xml" />
<xi:include href="xml/plugin-gio.xml" />
<xi:include href="xml/plugin-ivorbisdec.xml" />
......
......@@ -226,6 +226,23 @@ GST_TYPE_CLOCK_OVERLAY
gst_clock_overlay_get_type
</SECTION>
<SECTION>
<FILE>element-compositor</FILE>
<TITLE>compositor</TITLE>
GstCompositor
GstCompositorBackground
<SUBSECTION Standard>
GstCompositorClass
GST_COMPOSITOR
GST_COMPOSITOR_CAST
GST_IS_COMPOSITOR
GST_COMPOSITOR_CLASS
GST_IS_COMPOSITOR_CLASS
GST_TYPE_COMPOSITOR
<SUBSECTION Private>
gst_compositor_get_type
</SECTION>
<SECTION>
<FILE>element-decodebin</FILE>
<TITLE>decodebin</TITLE>
......@@ -868,6 +885,39 @@ GST_TYPE_GL_IMAGE_SINK_BIN
gst_gl_image_sink_bin_get_type
</SECTION>
<SECTION>
<FILE>element-glmixerbin</FILE>
<TITLE>glmixerbin</TITLE>
GstGLMixerBin
GstGLMixerBinStartTimeSelection
<SUBSECTION Standard>
GstGLMixerBinClass
GST_GL_MIXER_BIN
GST_GL_MIXER_BIN_CAST
GST_IS_GL_MIXER_BIN
GST_GL_MIXER_BIN_CLASS
GST_IS_GL_MIXER_BIN_CLASS
GST_TYPE_GL_MIXER_BIN
<SUBSECTION Private>
gst_gl_mixer_bin_get_type
</SECTION>
<SECTION>
<FILE>element-glmosaic</FILE>
<TITLE>glmosaic</TITLE>
GstGLMosaic
<SUBSECTION Standard>
GstGLMosaicClass
GST_GL_MOSAIC
GST_GL_MOSAIC_CAST
GST_IS_GL_MOSAIC
GST_GL_MOSAIC_CLASS
GST_IS_GL_MOSAIC_CLASS
GST_TYPE_GL_MOSAIC
<SUBSECTION Private>
gst_gl_mosaic_get_type
</SECTION>
<SECTION>
<FILE>element-gloverlay</FILE>
<TITLE>gloverlay</TITLE>
......@@ -916,6 +966,22 @@ GST_TYPE_GL_SRC_BIN
gst_gl_src_bin_get_type
</SECTION>
<SECTION>
<FILE>element-glstereomix</FILE>
<TITLE>glstereomix</TITLE>
GstGLStereoMix
<SUBSECTION Standard>
GstGLStereoMixClass
GST_GL_STEREO_MIX
GST_GL_STEREO_MIX_CAST
GST_IS_GL_STEREO_MIX
GST_GL_STEREO_MIX_CLASS
GST_IS_GL_STEREO_MIX_CLASS
GST_TYPE_GL_STEREO_MIX
<SUBSECTION Private>
gst_gl_stereo_mix_get_type
</SECTION>
<SECTION>
<FILE>element-glstereosplit</FILE>
<TITLE>glstereosplit</TITLE>
......@@ -978,6 +1044,39 @@ GST_TYPE_GL_UPLOAD_ELEMENT
gst_gl_upload_element_get_type
</SECTION>
<SECTION>
<FILE>element-glvideomixerelement</FILE>
<TITLE>glvideomixerelement</TITLE>
GstGLVideoMixer
GstGLVideoMixerBackground
<SUBSECTION Standard>
GstGLVideoMixerClass
GST_GL_VIDEO_MIXER
GST_GL_VIDEO_MIXER_CAST
GST_IS_GL_VIDEO_MIXER
GST_GL_VIDEO_MIXER_CLASS
GST_IS_GL_VIDEO_MIXER_CLASS
GST_TYPE_GL_VIDEO_MIXER
<SUBSECTION Private>
gst_gl_video_mixer_get_type
</SECTION>
<SECTION>
<FILE>element-glvideomixer</FILE>
<TITLE>glvideomixer</TITLE>
GstGLVideoMixerBin
<SUBSECTION Standard>
GstGLVideoMixerBinClass
GST_GL_VIDEO_MIXER_BIN
GST_GL_VIDEO_MIXER_BIN_CAST
GST_IS_GL_VIDEO_MIXER_BIN
GST_GL_VIDEO_MIXER_BIN_CLASS
GST_IS_GL_VIDEO_MIXER_BIN_CLASS
GST_TYPE_GL_VIDEO_MIXER_BIN
<SUBSECTION Private>
gst_gl_video_mixer_bin_get_type
</SECTION>
<SECTION>
<FILE>element-glviewconvert</FILE>
<TITLE>glviewconvert</TITLE>
......
......@@ -19,6 +19,8 @@ GObject
GstAudioInterleave
GstAudioMixer
GstLiveAdder
GstVideoAggregator
GstCompositor
GstAudioDecoder
GstOpusDec
GstVorbisDec
......
......@@ -11,6 +11,7 @@ GstAudioInterleave GstChildProxy
GstAudioMixer GstChildProxy
GstBin GstChildProxy
GstCdParanoiaSrc GstURIHandler
GstCompositor GstChildProxy
GstDecodeBin GstChildProxy
GstDecodebin3 GstChildProxy
GstEncodeBin GstChildProxy
......
<plugin>
<name>compositor</name>
<description>Compositor</description>
<filename>../../gst/compositor/.libs/libgstcompositor.so</filename>
<basename>libgstcompositor.so</basename>
<version>1.15.0.1</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins git</package>
<origin>Unknown package origin</origin>
<elements>
<element>
<name>compositor</name>
<longname>Compositor</longname>
<class>Filter/Editor/Video/Compositor</class>
<description>Composite multiple video streams</description>
<author>Wim Taymans &lt;wim@fluendo.com&gt;, Sebastian Dröge &lt;sebastian.droege@collabora.co.uk&gt;</author>
<pads>
<caps>
<name>sink_%u</name>
<direction>sink</direction>
<presence>request</presence>
<details>video/x-raw, format=(string){ AYUV, BGRA, ARGB, RGBA, ABGR, Y444, Y42B, YUY2, UYVY, YVYU, I420, YV12, NV12, NV21, Y41B, RGB, BGR, xRGB, xBGR, RGBx, BGRx }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>video/x-raw, format=(string){ AYUV, BGRA, ARGB, RGBA, ABGR, Y444, Y42B, YUY2, UYVY, YVYU, I420, YV12, NV12, NV21, Y41B, RGB, BGR, xRGB, xBGR, RGBx, BGRx }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
</caps>
</pads>
</element>
</elements>
</plugin>
\ No newline at end of file
plugin_LTLIBRARIES = libgstopengl.la
# These have to stay in -bad until we can move GstVideoAggregator to -base
# gstglbasemixer.c
# gstglbasemixer.h
# gstglmixer.c
# gstglmixer.h
# gstglmixerbin.h
# gstglmixerbin.c
# gstglstereomix.c
# gstglstereomix.h
# gstglvideomixer.c
# gstglvideomixer.h
libgstopengl_la_SOURCES = \
gstopengl.c \
gstglalpha.c \
......@@ -43,13 +31,18 @@ libgstopengl_la_SOURCES = \
effects/gstgleffectblur.c \
effects/gstgleffectsobel.c \
effects/gstgleffectlaplacian.c \
gstglbasemixer.c \
gstglcolorscale.c \
gstglcolorbalance.c \
gstgldeinterlace.c \
gstglfiltershader.c \
gstglfilterapp.c \
gstglviewconvert.c \
gstglmixer.c \
gstglmixerbin.c \
gstglstereomix.c \
gstglstereosplit.c \
gstgldeinterlace.c \
gstglvideomixer.c \
gstglviewconvert.c \
gltestsrc.c \
gstgltestsrc.c \
gstgloverlaycompositorelement.c \
......@@ -67,12 +60,17 @@ noinst_HEADERS = \
gstglfiltercube.h \
gstgleffects.h \
effects/gstgleffectssources.h \
gstglbasemixer.h \
gstglcolorscale.h \
gstglcolorbalance.h \
gstgldeinterlace.h \
gstglfiltershader.h \
gstglfilterapp.h \
gstglmixer.h \
gstglmixerbin.h \
gstglstereomix.h \
gstglstereosplit.h \
gstgldeinterlace.h \
gstglvideomixer.h \
gstglviewconvert.h \
gltestsrc.h \
gstgltestsrc.h \
......@@ -81,13 +79,13 @@ noinst_HEADERS = \
# full opengl required
if USE_OPENGL
# gstglmosaic.c
libgstopengl_la_SOURCES += \
gstglmosaic.c \
gstglfilterglass.c
# gstglmosaic.h
noinst_HEADERS += \
gstglfilterglass.h \
gstglmosaic.h \
effects/gstgleffectscurves.h \
effects/gstgleffectlumatocurve.h
......
......@@ -28,10 +28,6 @@
#include "gstglbasemixer.h"
#define gst_gl_base_mixer_parent_class parent_class
G_DEFINE_ABSTRACT_TYPE (GstGLBaseMixer, gst_gl_base_mixer,
GST_TYPE_VIDEO_AGGREGATOR);
#define GST_CAT_DEFAULT gst_gl_base_mixer_debug
GST_DEBUG_CATEGORY (gst_gl_base_mixer_debug);
......@@ -45,14 +41,6 @@ static void gst_gl_base_mixer_set_context (GstElement * element,
static GstStateChangeReturn gst_gl_base_mixer_change_state (GstElement *
element, GstStateChange transition);
enum
{
PROP_PAD_0
};
#define GST_GL_BASE_MIXER_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_GL_BASE_MIXER, GstGLBaseMixerPrivate))
struct _GstGLBaseMixerPrivate
{
gboolean negotiated;
......@@ -60,6 +48,10 @@ struct _GstGLBaseMixerPrivate
GstGLContext *other_context;
};
#define gst_gl_base_mixer_parent_class parent_class
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstGLBaseMixer, gst_gl_base_mixer,
GST_TYPE_VIDEO_AGGREGATOR);
G_DEFINE_TYPE (GstGLBaseMixerPad, gst_gl_base_mixer_pad,
GST_TYPE_VIDEO_AGGREGATOR_PAD);
......@@ -73,7 +65,6 @@ gst_gl_base_mixer_pad_class_init (GstGLBaseMixerPadClass * klass)
gobject_class->set_property = gst_gl_base_mixer_pad_set_property;
gobject_class->get_property = gst_gl_base_mixer_pad_get_property;
vaggpad_class->set_info = NULL;
vaggpad_class->prepare_frame = NULL;
vaggpad_class->clean_frame = NULL;
}
......@@ -261,8 +252,6 @@ gst_gl_base_mixer_class_init (GstGLBaseMixerClass * klass)
gobject_class = (GObjectClass *) klass;
element_class = GST_ELEMENT_CLASS (klass);
g_type_class_add_private (klass, sizeof (GstGLBaseMixerPrivate));
gobject_class->get_property = gst_gl_base_mixer_get_property;
gobject_class->set_property = gst_gl_base_mixer_set_property;
......@@ -293,7 +282,7 @@ gst_gl_base_mixer_class_init (GstGLBaseMixerClass * klass)
static void
gst_gl_base_mixer_init (GstGLBaseMixer * mix)
{
mix->priv = GST_GL_BASE_MIXER_GET_PRIVATE (mix);
mix->priv = gst_gl_base_mixer_get_instance_private (mix);
}
static void
......
......@@ -62,6 +62,8 @@ static void gst_gl_deinterlace_get_property (GObject * object,
static gboolean gst_gl_deinterlace_start (GstBaseTransform * trans);
static gboolean gst_gl_deinterlace_reset (GstBaseTransform * trans);
static GstCaps *gst_gl_deinterlace_transform_internal_caps (GstGLFilter *
filter, GstPadDirection direction, GstCaps * caps, GstCaps * caps_filter);
static gboolean gst_gl_deinterlace_init_fbo (GstGLFilter * filter);
static gboolean gst_gl_deinterlace_filter (GstGLFilter * filter,
GstBuffer * inbuf, GstBuffer * outbuf);
......@@ -264,6 +266,8 @@ gst_gl_deinterlace_class_init (GstGLDeinterlaceClass * klass)
GST_BASE_TRANSFORM_CLASS (klass)->start = gst_gl_deinterlace_start;
GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_deinterlace_reset;
GST_GL_FILTER_CLASS (klass)->transform_internal_caps =
gst_gl_deinterlace_transform_internal_caps;
GST_GL_FILTER_CLASS (klass)->filter = gst_gl_deinterlace_filter;
GST_GL_FILTER_CLASS (klass)->filter_texture =
gst_gl_deinterlace_filter_texture;
......@@ -327,6 +331,26 @@ gst_gl_deinterlace_reset (GstBaseTransform * trans)
return GST_BASE_TRANSFORM_CLASS (parent_class)->stop (trans);
}
static GstCaps *
gst_gl_deinterlace_transform_internal_caps (GstGLFilter * filter,
GstPadDirection direction, GstCaps * caps, GstCaps * caps_filter)
{
gint len;
GstCaps *res;
GstStructure *s;
res = gst_caps_copy (caps);
for (len = gst_caps_get_size (res); len > 0; len--) {
s = gst_caps_get_structure (res, len - 1);
if (direction == GST_PAD_SINK) {
gst_structure_remove_field (s, "interlace-mode");
}
}
return res;
}
static void
gst_gl_deinterlace_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
......
......@@ -64,8 +64,7 @@ static GstStaticPadTemplate gst_gl_download_element_src_pad_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (
EXTRA_CAPS_TEMPLATE
GST_STATIC_CAPS (EXTRA_CAPS_TEMPLATE
"video/x-raw; video/x-raw(memory:GLMemory)"));
static GstStaticPadTemplate gst_gl_download_element_sink_pad_template =
......
......@@ -26,10 +26,9 @@
#include <gst/gst.h>
#include <gst/video/video.h>
#include "gstglmixer.h"
#include <string.h>
#define gst_gl_mixer_parent_class parent_class
G_DEFINE_ABSTRACT_TYPE (GstGLMixer, gst_gl_mixer, GST_TYPE_GL_BASE_MIXER);
#include "gstglmixer.h"
#define GST_CAT_DEFAULT gst_gl_mixer_debug
GST_DEBUG_CATEGORY (gst_gl_mixer_debug);
......@@ -38,15 +37,17 @@ static void gst_gl_mixer_pad_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static void gst_gl_mixer_pad_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static gboolean gst_gl_mixer_pad_prepare_frame (GstVideoAggregatorPad * vpad,
GstVideoAggregator * vagg, GstBuffer * buffer,
GstVideoFrame * prepared_frame);
static void gst_gl_mixer_pad_clean_frame (GstVideoAggregatorPad * vpad,
GstVideoAggregator * vagg, GstVideoFrame * prepared_frame);
enum
{
PROP_PAD_0
};
#define GST_GL_MIXER_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_GL_MIXER, GstGLMixerPrivate))
struct _GstGLMixerPrivate
{
gboolean negotiated;
......@@ -56,6 +57,10 @@ struct _GstGLMixerPrivate
GCond gl_resource_cond;
};
#define gst_gl_mixer_parent_class parent_class
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstGLMixer, gst_gl_mixer,
GST_TYPE_GL_BASE_MIXER);
G_DEFINE_TYPE (GstGLMixerPad, gst_gl_mixer_pad, GST_TYPE_GL_BASE_MIXER_PAD);
static void
......@@ -68,9 +73,8 @@ gst_gl_mixer_pad_class_init (GstGLMixerPadClass * klass)
gobject_class->set_property = gst_gl_mixer_pad_set_property;
gobject_class->get_property = gst_gl_mixer_pad_get_property;
vaggpad_class->set_info = NULL;
vaggpad_class->prepare_frame = NULL;
vaggpad_class->clean_frame = NULL;
vaggpad_class->prepare_frame = gst_gl_mixer_pad_prepare_frame;
vaggpad_class->clean_frame = gst_gl_mixer_pad_clean_frame;
}
static void
......@@ -95,6 +99,50 @@ gst_gl_mixer_pad_set_property (GObject * object, guint prop_id,
}
}
static gboolean
gst_gl_mixer_pad_prepare_frame (GstVideoAggregatorPad * vpad,
GstVideoAggregator * vagg, GstBuffer * buffer,
GstVideoFrame * prepared_frame)
{
GstGLMixerPad *pad = GST_GL_MIXER_PAD (vpad);
GstGLMixer *mix = GST_GL_MIXER (vagg);
GstVideoInfo gl_info;
GstGLSyncMeta *sync_meta;
pad->current_texture = 0;
gst_video_info_set_format (&gl_info,
GST_VIDEO_FORMAT_RGBA,
GST_VIDEO_INFO_WIDTH (&vpad->info), GST_VIDEO_INFO_HEIGHT (&vpad->info));
sync_meta = gst_buffer_get_gl_sync_meta (buffer);
if (sync_meta)
gst_gl_sync_meta_wait (sync_meta, GST_GL_BASE_MIXER (mix)->context);
if (!gst_video_frame_map (prepared_frame, &gl_info, buffer,
GST_MAP_READ | GST_MAP_GL)) {
GST_ERROR_OBJECT (pad, "Failed to map input frame");
return FALSE;
}
pad->current_texture = *(guint *) prepared_frame->data[0];
return TRUE;
}
static void
gst_gl_mixer_pad_clean_frame (GstVideoAggregatorPad * vpad,
GstVideoAggregator * vagg, GstVideoFrame * prepared_frame)
{
GstGLMixerPad *pad = GST_GL_MIXER_PAD (vpad);
pad->current_texture = 0;
if (prepared_frame->buffer) {
gst_video_frame_unmap (prepared_frame);
memset (prepared_frame, 0, sizeof (GstVideoFrame));
}
}
static gboolean
_negotiated_caps (GstAggregator * agg, GstCaps * caps)
{
......@@ -357,8 +405,6 @@ gst_gl_mixer_class_init (GstGLMixerClass * klass)
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "glmixer", 0, "OpenGL mixer");
g_type_class_add_private (klass, sizeof (GstGLMixerPrivate));
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_gl_mixer_finalize);
gobject_class->get_property = gst_gl_mixer_get_property;
......@@ -396,7 +442,7 @@ gst_gl_mixer_reset (GstGLMixer * mix)
static void
gst_gl_mixer_init (GstGLMixer * mix)
{
mix->priv = GST_GL_MIXER_GET_PRIVATE (mix);
mix->priv = gst_gl_mixer_get_instance_private (mix);
mix->priv->gl_resource_ready = FALSE;
g_mutex_init (&mix->priv->gl_resource_lock);
......@@ -561,42 +607,6 @@ context_error:
}
}
static gboolean
gst_gl_mixer_upload_frames (GstElement * element, GstPad * sink_pad,
gpointer user_data)
{
GstVideoAggregatorPad *vaggpad = GST_VIDEO_AGGREGATOR_PAD (sink_pad);
GstGLMixerPad *pad = GST_GL_MIXER_PAD (sink_pad);
GstGLMixer *mix = GST_GL_MIXER (element);
pad->current_texture = 0;
if (vaggpad->buffer != NULL) {
GstVideoInfo gl_info;
GstVideoFrame gl_frame;
GstGLSyncMeta *sync_meta;
gst_video_info_set_format (&gl_info,
GST_VIDEO_FORMAT_RGBA,
GST_VIDEO_INFO_WIDTH (&vaggpad->info),
GST_VIDEO_INFO_HEIGHT (&vaggpad->info));
sync_meta = gst_buffer_get_gl_sync_meta (vaggpad->buffer);
if (sync_meta)
gst_gl_sync_meta_wait (sync_meta, GST_GL_BASE_MIXER (mix)->context);
if (!gst_video_frame_map (&gl_frame, &gl_info, vaggpad->buffer,
GST_MAP_READ | GST_MAP_GL)) {
GST_ERROR_OBJECT (pad, "Failed to map input frame");
return FALSE;
}
pad->current_texture = *(guint *) gl_frame.data[0];
gst_video_frame_unmap (&gl_frame);
}
return TRUE;
}
gboolean
gst_gl_mixer_process_textures (GstGLMixer * mix, GstBuffer * outbuf)
{
......@@ -616,12 +626,6 @@ gst_gl_mixer_process_textures (GstGLMixer * mix, GstBuffer * outbuf)
out_tex = (GstGLMemory *) out_frame.map[0].memory;
if (!gst_element_foreach_sink_pad (GST_ELEMENT_CAST (mix),
gst_gl_mixer_upload_frames, NULL)) {
res = FALSE;
goto out;
}
g_mutex_lock (&priv->gl_resource_lock);
if (!priv->gl_resource_ready)
g_cond_wait (&priv->gl_resource_cond, &priv->gl_resource_lock);
......
......@@ -68,6 +68,7 @@ struct input_chain
GstGhostPad *ghost_pad;
GstElement *upload;
GstElement *in_convert;
GstElement *in_overlay;
GstPad *mixer_pad;
};
......@@ -91,6 +92,12 @@ _free_input_chain (struct input_chain *chain)
chain->in_convert = NULL;
}
if (chain->in_overlay) {
gst_element_set_state (chain->in_overlay, GST_STATE_NULL);
gst_bin_remove (GST_BIN (chain->self), chain->in_overlay);
chain->in_overlay = NULL;
}
if (chain->mixer_pad) {
gst_element_release_request_pad (chain->self->mixer, chain->mixer_pad);
gst_object_unref (chain->mixer_pad);
......@@ -126,9 +133,8 @@ enum
static void gst_gl_mixer_bin_child_proxy_init (gpointer g_iface,
gpointer iface_data);
#define GST_GL_MIXER_BIN_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_MIXER_BIN, GstGLMixerBinPrivate))
G_DEFINE_TYPE_WITH_CODE (GstGLMixerBin, gst_gl_mixer_bin, GST_TYPE_BIN,
G_ADD_PRIVATE (GstGLMixerBin)
G_IMPLEMENT_INTERFACE (GST_TYPE_CHILD_PROXY,
gst_gl_mixer_bin_child_proxy_init));
......@@ -145,7 +151,6 @@ static void gst_gl_mixer_bin_set_property (GObject * object, guint prop_id,
static void gst_gl_mixer_bin_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static void gst_gl_mixer_bin_dispose (GObject * object);
static void gst_gl_mixer_bin_finalize (GObject * object);
static GstPad *gst_gl_mixer_bin_request_new_pad (GstElement * element,
GstPadTemplate * templ, const gchar * req_name, const GstCaps * caps);
......@@ -160,8 +165,6 @@ gst_gl_mixer_bin_class_init (GstGLMixerBinClass * klass)
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
GstCaps *upload_caps;
g_type_class_add_private (klass, sizeof (GstGLMixerBinPrivate));
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "glmixerbin", 0,
"opengl mixer bin");
......@@ -172,7 +175,6 @@ gst_gl_mixer_bin_class_init (GstGLMixerBinClass * klass)
gobject_class->get_property = gst_gl_mixer_bin_get_property;
gobject_class->set_property = gst_gl_mixer_bin_set_property;
gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_gl_mixer_bin_dispose);
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_gl_mixer_bin_finalize);
g_object_class_install_property (gobject_class, PROP_MIXER,
g_param_spec_object ("mixer",
......@@ -183,11 +185,10 @@ gst_gl_mixer_bin_class_init (GstGLMixerBinClass * klass)
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_LATENCY,
g_param_spec_int64 ("latency", "Buffer latency",
g_param_spec_uint64 ("latency", "Buffer latency",
"Additional latency in live mode to allow upstream "
"to take longer to produce buffers for the current "
"position", 0,
(G_MAXLONG == G_MAXINT64) ? G_MAXINT64 : (G_MAXLONG * GST_SECOND - 1),
"position (in nanoseconds)", 0, G_MAXUINT64,
DEFAULT_LATENCY, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_START_TIME_SELECTION,
......@@ -235,7 +236,7 @@ gst_gl_mixer_bin_init (GstGLMixerBin * self)
gboolean res = TRUE;
GstPad *pad;
self->priv = GST_GL_MIXER_BIN_GET_PRIVATE (self);
self->priv = gst_gl_mixer_bin_get_instance_private (self);
self->out_convert = gst_element_factory_make ("glcolorconvert", NULL);
self->download = gst_element_factory_make ("gldownload", NULL);
......@@ -259,17 +260,6 @@ gst_gl_mixer_bin_init (GstGLMixerBin * self)
GST_ERROR_OBJECT (self, "failed to create output chain");
}
static void
gst_gl_mixer_bin_finalize (GObject * object)
{
GstGLMixerBin *self = GST_GL_MIXER_BIN (object);
if (self->mixer)
gst_object_unref (self->mixer);
G_OBJECT_CLASS (gst_gl_mixer_bin_parent_class)->finalize (object);
}
static void
gst_gl_mixer_bin_dispose (GObject * object)
{
......@@ -308,16 +298,21 @@ _create_input_chain (GstGLMixerBin * self, struct input_chain *chain,
chain->upload = gst_element_factory_make ("glupload", NULL);
chain->in_convert = gst_element_factory_make ("glcolorconvert", NULL);
chain->in_overlay = gst_element_factory_make ("gloverlaycompositor", NULL);
res &= gst_bin_add (GST_BIN (self), chain->in_convert);
res &= gst_bin_add (GST_BIN (self), chain->in_overlay);
res &= gst_bin_add (GST_BIN (self), chain->upload);
pad = gst_element_get_static_pad (chain->in_convert, "src");
pad = gst_element_get_static_pad (chain->in_overlay, "src");
if (gst_pad_link (pad, mixer_pad) != GST_PAD_LINK_OK) {
gst_object_unref (pad);
return FALSE;
}
gst_object_unref (pad);
res &=
gst_element_link_pads (chain->in_convert, "src", chain->in_overlay,
"sink");
res &=
gst_element_link_pads (chain->upload, "src", chain->in_convert, "sink");
......@@ -349,6 +344,7 @@ _create_input_chain (GstGLMixerBin * self, struct input_chain *chain,
gst_element_sync_state_with_parent (chain->upload);
gst_element_sync_state_with_parent (chain->in_convert);
gst_element_sync_state_with_parent (chain->in_overlay);
return TRUE;
}
......@@ -398,39 +394,18 @@ _connect_mixer_element (GstGLMixerBin * self)
return res;
}
/*
* @mixer: (transfer floating):
*/
static gboolean
gst_gl_mixer_bin_set_mixer (GstGLMixerBin * self, GstElement * mixer)
void
gst_gl_mixer_bin_finish_init_with_element (GstGLMixerBin * self,
GstElement * element)
{
g_return_val_if_fail (GST_IS_ELEMENT (mixer), FALSE);
if (self->mixer) {
gst_element_set_locked_state (self->mixer, TRUE);
gst_bin_remove (GST_BIN (self), self->mixer);
gst_element_set_state (self->mixer, GST_STATE_NULL);
gst_object_unref (self->mixer);
self->mixer = NULL;
}
self->mixer = mixer;
g_return_if_fail (GST_IS_ELEMENT (element));
gst_object_ref_sink (mixer);
self->mixer = element;
if (mixer && !_connect_mixer_element (self)) {
if (!_connect_mixer_element (self)) {
gst_object_unref (self->mixer);
self->mixer = NULL;
return FALSE;
}
return TRUE;
}
void
gst_gl_mixer_bin_finish_init_with_element (GstGLMixerBin * self,
GstElement * element)
{
gst_gl_mixer_bin_set_mixer (self, element);
}
void
......@@ -475,7 +450,11 @@ gst_gl_mixer_bin_set_property (GObject * object,
GstElement *mixer = g_value_get_object (value);
/* FIXME: deal with replacing a mixer */
g_return_if_fail (!self->mixer || (self->mixer == mixer));
gst_gl_mixer_bin_set_mixer (self, mixer);
self->mixer = mixer;
if (mixer) {
gst_object_ref_sink (mixer);
_connect_mixer_element (self);
}
break;
}
default:
......@@ -560,12 +539,9 @@ gst_gl_mixer_bin_change_state (GstElement * element, GstStateChange transition)
if (klass->create_element)
self->mixer = klass->create_element ();
if (!self->mixer) {
if (!self->mixer)
g_signal_emit (element,
gst_gl_mixer_bin_signals[SIGNAL_CREATE_ELEMENT], 0, &self->mixer);
if (self->mixer && g_object_is_floating (self->mixer))
gst_object_ref_sink (self->mixer);
}
if (!self->mixer) {
GST_ERROR_OBJECT (element, "Failed to retrieve element");
......
......@@ -55,10 +55,15 @@ enum
PROP_0,
};
static void gst_gl_mosaic_child_proxy_init (gpointer g_iface,
gpointer iface_data);
#define DEBUG_INIT \
GST_DEBUG_CATEGORY_INIT (gst_gl_mosaic_debug, "glmosaic", 0, "glmosaic element");
G_DEFINE_TYPE_WITH_CODE (GstGLMosaic, gst_gl_mosaic, GST_TYPE_GL_MIXER,
G_IMPLEMENT_INTERFACE (GST_TYPE_CHILD_PROXY,
gst_gl_mosaic_child_proxy_init);
DEBUG_INIT);
static void gst_gl_mosaic_set_property (GObject * object, guint prop_id,
......@@ -66,6 +71,10 @@ static void gst_gl_mosaic_set_property (GObject * object, guint prop_id,
static void gst_gl_mosaic_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static GstPad *gst_gl_mosaic_request_new_pad (GstElement * element,
GstPadTemplate * temp, const gchar * req_name, const GstCaps * caps);
static void gst_gl_mosaic_release_pad (GstElement * element, GstPad * pad);
static void gst_gl_mosaic_reset (GstGLMixer * mixer);
static gboolean gst_gl_mosaic_init_shader (GstGLMixer * mixer,
GstCaps * outcaps);
......@@ -128,6 +137,10 @@ gst_gl_mosaic_class_init (GstGLMosaicClass * klass)
gobject_class->set_property = gst_gl_mosaic_set_property;
gobject_class->get_property = gst_gl_mosaic_get_property;
element_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_gl_mosaic_request_new_pad);
element_class->release_pad = GST_DEBUG_FUNCPTR (gst_gl_mosaic_release_pad);
gst_element_class_set_metadata (element_class, "OpenGL mosaic",
"Filter/Effect/Video", "OpenGL mosaic",
"Julien Isorce <julien.isorce@gmail.com>");
......@@ -171,6 +184,44 @@ gst_gl_mosaic_get_property (GObject * object, guint prop_id,
}
}
static GstPad *
gst_gl_mosaic_request_new_pad (GstElement * element, GstPadTemplate * templ,
const gchar * req_name, const GstCaps * caps)
{
GstPad *newpad;
newpad = (GstPad *)
GST_ELEMENT_CLASS (gst_gl_mosaic_parent_class)->request_new_pad (element,
templ, req_name, caps);
if (newpad == NULL)
goto could_not_create;
gst_child_proxy_child_added (GST_CHILD_PROXY (element), G_OBJECT (newpad),
GST_OBJECT_NAME (newpad));
return newpad;
could_not_create:
{
GST_DEBUG_OBJECT (element, "could not create/add pad");
return NULL;
}
}
static void
gst_gl_mosaic_release_pad (GstElement * element, GstPad * pad)
{
GstGLMosaic *gl_mosaic = GST_GL_MOSAIC (element);
GST_DEBUG_OBJECT (gl_mosaic, "release pad %s:%s", GST_DEBUG_PAD_NAME (pad));
gst_child_proxy_child_removed (GST_CHILD_PROXY (gl_mosaic), G_OBJECT (pad),
GST_OBJECT_NAME (pad));
GST_ELEMENT_CLASS (gst_gl_mosaic_parent_class)->release_pad (element, pad);
}
static void
gst_gl_mosaic_reset (GstGLMixer * mixer)
{
......@@ -356,3 +407,43 @@ gst_gl_mosaic_callback (gpointer stuff)
return TRUE;
}
/* GstChildProxy implementation */
static GObject *
gst_gl_mosaic_child_proxy_get_child_by_index (GstChildProxy * child_proxy,
guint index)
{
GstGLMosaic *gl_mosaic = GST_GL_MOSAIC (child_proxy);
GObject *obj = NULL;
GST_OBJECT_LOCK (gl_mosaic);
obj = g_list_nth_data (GST_ELEMENT_CAST (gl_mosaic)->sinkpads, index);
if (obj)
gst_object_ref (obj);
GST_OBJECT_UNLOCK (gl_mosaic);
return obj;
}
static guint
gst_gl_mosaic_child_proxy_get_children_count (GstChildProxy * child_proxy)
{
guint count = 0;
GstGLMosaic *gl_mosaic = GST_GL_MOSAIC (child_proxy);
GST_OBJECT_LOCK (gl_mosaic);
count = GST_ELEMENT_CAST (gl_mosaic)->numsinkpads;
GST_OBJECT_UNLOCK (gl_mosaic);
GST_INFO_OBJECT (gl_mosaic, "Children Count: %d", count);
return count;
}
static void
gst_gl_mosaic_child_proxy_init (gpointer g_iface, gpointer iface_data)
{
GstChildProxyInterface *iface = g_iface;
iface->get_child_by_index = gst_gl_mosaic_child_proxy_get_child_by_index;
iface->get_children_count = gst_gl_mosaic_child_proxy_get_children_count;
}
......@@ -45,7 +45,7 @@
#include <stdio.h>
#include <stdlib.h>
#ifdef _MSC_VER
#if defined(_MSC_VER) || (defined (__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR >= 6)
#define HAVE_BOOLEAN
#endif
#include <jpeglib.h>
......
......@@ -78,12 +78,17 @@ gst_gl_stereo_mix_pad_init (GstGLStereoMixPad * pad)
{
}
static void gst_gl_stereo_mix_child_proxy_init (gpointer g_iface,
gpointer iface_data);
#define gst_gl_stereo_mix_parent_class parent_class
G_DEFINE_TYPE (GstGLStereoMix, gst_gl_stereo_mix, GST_TYPE_GL_MIXER);
G_DEFINE_TYPE_WITH_CODE (GstGLStereoMix, gst_gl_stereo_mix, GST_TYPE_GL_MIXER,
G_IMPLEMENT_INTERFACE (GST_TYPE_CHILD_PROXY,
gst_gl_stereo_mix_child_proxy_init));
static GstCaps *_update_caps (GstVideoAggregator * vagg, GstCaps * caps);
static gboolean _negotiated_caps (GstAggregator * aggregator, GstCaps * caps);
gboolean gst_gl_stereo_mix_make_output (GstGLStereoMix * mix);
static gboolean gst_gl_stereo_mix_make_output (GstGLStereoMix * mix);
static gboolean gst_gl_stereo_mix_process_frames (GstGLStereoMix * mixer);
#define DEFAULT_DOWNMIX GST_GL_STEREO_DOWNMIX_ANAGLYPH_GREEN_MAGENTA_DUBOIS
......@@ -133,8 +138,12 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink_%u",
"; " GST_VIDEO_CAPS_MAKE (GST_GL_COLOR_CONVERT_FORMATS))
);
static GstFlowReturn gst_gl_stereo_mix_get_output_buffer (GstVideoAggregator *
videoaggregator, GstBuffer ** outbuf);
static GstPad *gst_gl_stereo_mix_request_new_pad (GstElement * element,
GstPadTemplate * temp, const gchar * req_name, const GstCaps * caps);
static void gst_gl_stereo_mix_release_pad (GstElement * element, GstPad * pad);
static GstFlowReturn gst_gl_stereo_mix_create_output_buffer (GstVideoAggregator
* videoaggregator, GstBuffer ** outbuf);
static gboolean gst_gl_stereo_mix_stop (GstAggregator * agg);
static gboolean gst_gl_stereo_mix_start (GstAggregator * agg);
static gboolean gst_gl_stereo_mix_src_query (GstAggregator * agg,
......@@ -184,6 +193,11 @@ gst_gl_stereo_mix_class_init (GstGLStereoMixClass * klass)
gst_element_class_add_static_pad_template_with_gtype (element_class,
&sink_factory, GST_TYPE_GL_STEREO_MIX_PAD);
element_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_gl_stereo_mix_request_new_pad);
element_class->release_pad =
GST_DEBUG_FUNCPTR (gst_gl_stereo_mix_release_pad);
agg_class->stop = gst_gl_stereo_mix_stop;
agg_class->start = gst_gl_stereo_mix_start;
agg_class->src_query = gst_gl_stereo_mix_src_query;
......@@ -191,8 +205,8 @@ gst_gl_stereo_mix_class_init (GstGLStereoMixClass * klass)
videoaggregator_class->aggregate_frames = gst_gl_stereo_mix_aggregate_frames;
videoaggregator_class->update_caps = _update_caps;
videoaggregator_class->get_output_buffer =
gst_gl_stereo_mix_get_output_buffer;
videoaggregator_class->create_output_buffer =
gst_gl_stereo_mix_create_output_buffer;
base_mix_class->supported_gl_api =
GST_GL_API_GLES2 | GST_GL_API_OPENGL | GST_GL_API_OPENGL3;
......@@ -249,7 +263,7 @@ gst_gl_stereo_mix_src_query (GstAggregator * agg, GstQuery * query)
static GstFlowReturn
gst_gl_stereo_mix_get_output_buffer (GstVideoAggregator * videoaggregator,
gst_gl_stereo_mix_create_output_buffer (GstVideoAggregator * videoaggregator,
GstBuffer ** outbuf)
{
GstGLStereoMix *mix = GST_GL_STEREO_MIX (videoaggregator);
......@@ -287,7 +301,7 @@ gst_gl_stereo_mix_get_output_buffer (GstVideoAggregator * videoaggregator,
return ret;
}
gboolean
static gboolean
gst_gl_stereo_mix_make_output (GstGLStereoMix * mix)
{
GList *walk;
......@@ -302,11 +316,12 @@ gst_gl_stereo_mix_make_output (GstGLStereoMix * mix)
while (walk) {
GstVideoAggregatorPad *vaggpad = walk->data;
GstGLStereoMixPad *pad = walk->data;
GstBuffer *buffer = gst_video_aggregator_pad_get_current_buffer (vaggpad);
GST_LOG_OBJECT (mix, "Checking pad %" GST_PTR_FORMAT, vaggpad);
if (vaggpad->buffer != NULL) {
pad->current_buffer = vaggpad->buffer;
if (buffer != NULL) {
pad->current_buffer = buffer;
GST_DEBUG_OBJECT (pad, "Got buffer %" GST_PTR_FORMAT,
pad->current_buffer);
......@@ -399,6 +414,42 @@ gst_gl_stereo_mix_set_property (GObject * object,
}
}
static GstPad *
gst_gl_stereo_mix_request_new_pad (GstElement * element, GstPadTemplate * templ,
const gchar * req_name, const GstCaps * caps)
{
GstPad *newpad;
newpad = (GstPad *)
GST_ELEMENT_CLASS (parent_class)->request_new_pad (element,
templ, req_name, caps);
if (newpad == NULL)
goto could_not_create;
gst_child_proxy_child_added (GST_CHILD_PROXY (element), G_OBJECT (newpad),
GST_OBJECT_NAME (newpad));
return GST_PAD_CAST (newpad);
could_not_create:
{
GST_DEBUG_OBJECT (element, "could not create/add pad");
return NULL;
}
}
static void
gst_gl_stereo_mix_release_pad (GstElement * element, GstPad * pad)
{
GST_DEBUG_OBJECT (element, "release pad %s:%s", GST_DEBUG_PAD_NAME (pad));
gst_child_proxy_child_removed (GST_CHILD_PROXY (element), G_OBJECT (pad),
GST_OBJECT_NAME (pad));
GST_ELEMENT_CLASS (parent_class)->release_pad (element, pad);
}
static gboolean
gst_gl_stereo_mix_start (GstAggregator * agg)
{
......@@ -696,3 +747,43 @@ gst_gl_stereo_mix_process_frames (GstGLStereoMix * mixer)
return TRUE;
}
/* GstChildProxy implementation */
static GObject *
gst_gl_stereo_mix_child_proxy_get_child_by_index (GstChildProxy * child_proxy,
guint index)
{
GstGLStereoMix *gl_stereo_mix = GST_GL_STEREO_MIX (child_proxy);
GObject *obj = NULL;
GST_OBJECT_LOCK (gl_stereo_mix);
obj = g_list_nth_data (GST_ELEMENT_CAST (gl_stereo_mix)->sinkpads, index);
if (obj)
gst_object_ref (obj);
GST_OBJECT_UNLOCK (gl_stereo_mix);
return obj;
}
static guint
gst_gl_stereo_mix_child_proxy_get_children_count (GstChildProxy * child_proxy)
{
guint count = 0;
GstGLStereoMix *gl_stereo_mix = GST_GL_STEREO_MIX (child_proxy);
GST_OBJECT_LOCK (gl_stereo_mix);
count = GST_ELEMENT_CAST (gl_stereo_mix)->numsinkpads;
GST_OBJECT_UNLOCK (gl_stereo_mix);
GST_INFO_OBJECT (gl_stereo_mix, "Children Count: %d", count);
return count;
}
static void
gst_gl_stereo_mix_child_proxy_init (gpointer g_iface, gpointer iface_data)
{
GstChildProxyInterface *iface = g_iface;
iface->get_child_by_index = gst_gl_stereo_mix_child_proxy_get_child_by_index;
iface->get_children_count = gst_gl_stereo_mix_child_proxy_get_children_count;
}
......@@ -510,11 +510,6 @@ gst_gl_test_src_start (GstBaseSrc * basesrc)
{
GstGLTestSrc *src = GST_GL_TEST_SRC (basesrc);
if (!gst_gl_ensure_element_data (src, &src->display, &src->other_context))
return FALSE;
gst_gl_display_filter_gl_api (src->display, SUPPORTED_GL_APIS);
src->running_time = 0;
src->n_frames = 0;
src->negotiated = FALSE;
......@@ -735,18 +730,6 @@ gst_gl_test_src_change_state (GstElement * element, GstStateChange transition)
gst_element_state_get_name (GST_STATE_TRANSITION_CURRENT (transition)),
gst_element_state_get_name (GST_STATE_TRANSITION_NEXT (transition)));
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
if (!gst_gl_ensure_element_data (element, &src->display,
&src->other_context))
return GST_STATE_CHANGE_FAILURE;
gst_gl_display_filter_gl_api (src->display, SUPPORTED_GL_APIS);
break;
default:
break;
}
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
if (ret == GST_STATE_CHANGE_FAILURE)
return ret;
......
This diff is collapsed.
......@@ -43,8 +43,6 @@
#include "config.h"
#endif
#undef HAVE_VIDEO_AGGREGATOR_IN_BASE
#include "gstglimagesink.h"
#include "gstgluploadelement.h"
#include "gstgldownloadelement.h"
......@@ -58,11 +56,9 @@
#include "gstgleffects.h"
#include "gstglcolorscale.h"
#ifdef HAVE_VIDEO_AGGREGATOR_IN_BASE
#include "gstglmixerbin.h"
#include "gstglvideomixer.h"
#include "gstglstereomix.h"
#endif
#include "gstglfiltershader.h"
#include "gstglfilterapp.h"
......@@ -81,12 +77,17 @@
#include "gstgloverlay.h"
#endif
#include "gstglmixerbin.h"
#include "gstglvideomixer.h"
#include "gstglstereomix.h"
#if GST_GL_HAVE_OPENGL
#endif /* GST_GL_HAVE_OPENGL */
#if GST_GL_HAVE_OPENGL
#include "gstglfilterglass.h"
/* #include "gstglfilterreflectedscreen.h" */
#ifdef HAVE_VIDEO_AGGREGATOR_IN_BASE
#include "gstglmosaic.h"
#endif
#ifdef HAVE_PNG
#include "gstgldifferencematte.h"
/* #include "gstglbumper.h" */
......@@ -169,12 +170,11 @@ plugin_init (GstPlugin * plugin)
GST_RANK_NONE, GST_TYPE_GL_SRC_BIN)) {
return FALSE;
}
#ifdef HAVE_VIDEO_AGGREGATOR_IN_BASE
if (!gst_element_register (plugin, "glmixerbin",
GST_RANK_NONE, GST_TYPE_GL_MIXER_BIN)) {
return FALSE;
}
#endif
if (!gst_element_register (plugin, "glfiltercube",
GST_RANK_NONE, GST_TYPE_GL_FILTER_CUBE)) {
......@@ -200,7 +200,7 @@ plugin_init (GstPlugin * plugin)
GST_RANK_NONE, GST_TYPE_GL_COLORSCALE)) {
return FALSE;
}
#ifdef HAVE_VIDEO_AGGREGATOR_IN_BASE
if (!gst_element_register (plugin, "glvideomixer",
GST_RANK_NONE, gst_gl_video_mixer_bin_get_type ())) {
return FALSE;
......@@ -210,7 +210,6 @@ plugin_init (GstPlugin * plugin)
GST_RANK_NONE, gst_gl_video_mixer_get_type ())) {
return FALSE;
}
#endif
if (!gst_element_register (plugin, "glshader",
GST_RANK_NONE, gst_gl_filtershader_get_type ())) {
......@@ -231,12 +230,11 @@ plugin_init (GstPlugin * plugin)