Commit e1c1bb32 authored by Mike Wey's avatar Mike Wey

Update the libraries to the latest versions,

parent 50136fca
......@@ -3,6 +3,7 @@ GtkD ChangeLog
Release: 3.8.0
--------------
-Update the libraries to the latest versions.
-Implement a DClosure. #225
-Add a Signals.connect overload for D functions and delegates.
-Bring back the OpCast changes for ObjectG.
......
......@@ -97,13 +97,13 @@ Library | Version
--- | ---
Gtk+ | 3.22
Gdk | 3.22
Glib | 2.54
GObject | 2.54
Gio | 2.54
Pango | 1.40
Atk | 2.26
Glib | 2.56
GObject | 2.56
Gio | 2.56
Pango | 1.42
Atk | 2.28
Gdk-pixbuf | 2.36
Cairo | 1.12.2
GtksourceView | 3.24
GStreamer | 1.12
Vte3 | 0.50
GStreamer | 1.14
Vte3 | 0.52
......@@ -202,13 +202,15 @@ public class AppSink : BaseSink, URIHandlerIF
/**
* Get the last preroll sample in @appsink. This was the sample that caused the
* appsink to preroll in the PAUSED state. This sample can be pulled many times
* and remains available to the application even after EOS.
* appsink to preroll in the PAUSED state.
*
* This function is typically used when dealing with a pipeline in the PAUSED
* state. Calling this function after doing a seek will give the sample right
* after the seek position.
*
* Calling this function will clear the internal reference to the preroll
* buffer.
*
* Note that the preroll sample will also be returned as the first sample
* when calling gst_app_sink_pull_sample().
*
......@@ -360,13 +362,15 @@ public class AppSink : BaseSink, URIHandlerIF
/**
* Get the last preroll sample in @appsink. This was the sample that caused the
* appsink to preroll in the PAUSED state. This sample can be pulled many times
* and remains available to the application even after EOS.
* appsink to preroll in the PAUSED state.
*
* This function is typically used when dealing with a pipeline in the PAUSED
* state. Calling this function after doing a seek will give the sample right
* after the seek position.
*
* Calling this function will clear the internal reference to the preroll
* buffer.
*
* Note that the preroll sample will also be returned as the first sample
* when calling gst_app_sink_pull_sample().
*
......@@ -478,13 +482,15 @@ public class AppSink : BaseSink, URIHandlerIF
/**
* Get the last preroll sample in @appsink. This was the sample that caused the
* appsink to preroll in the PAUSED state. This sample can be pulled many times
* and remains available to the application even after EOS.
* appsink to preroll in the PAUSED state.
*
* This function is typically used when dealing with a pipeline in the PAUSED
* state. Calling this function after doing a seek will give the sample right
* after the seek position.
*
* Calling this function will clear the internal reference to the preroll
* buffer.
*
* Note that the preroll sample will also be returned as the first sample
* when calling gst_app_sink_pull_sample() or the "pull-sample" action signal.
*
......@@ -526,13 +532,15 @@ public class AppSink : BaseSink, URIHandlerIF
/**
* Get the last preroll sample in @appsink. This was the sample that caused the
* appsink to preroll in the PAUSED state. This sample can be pulled many times
* and remains available to the application even after EOS.
* appsink to preroll in the PAUSED state.
*
* This function is typically used when dealing with a pipeline in the PAUSED
* state. Calling this function after doing a seek will give the sample right
* after the seek position.
*
* Calling this function will clear the internal reference to the preroll
* buffer.
*
* Note that the preroll sample will also be returned as the first sample
* when calling gst_app_sink_pull_sample() or the "pull-sample" action signal.
*
......
......@@ -30,6 +30,7 @@ private import gst.app.c.functions;
public import gst.app.c.types;
private import gst.base.BaseSrc;
private import gstreamer.Buffer;
private import gstreamer.BufferList;
private import gstreamer.Caps;
private import gstreamer.Sample;
private import gstreamer.URIHandlerIF;
......@@ -211,11 +212,11 @@ public class AppSrc : BaseSrc, URIHandlerIF
*
* Params:
* min = the min latency
* max = the min latency
* max = the max latency
*/
public void getLatency(ulong* min, ulong* max)
public void getLatency(out ulong min, out ulong max)
{
gst_app_src_get_latency(gstAppSrc, min, max);
gst_app_src_get_latency(gstAppSrc, &min, &max);
}
/**
......@@ -269,6 +270,28 @@ public class AppSrc : BaseSrc, URIHandlerIF
return gst_app_src_push_buffer(gstAppSrc, (buffer is null) ? null : buffer.getBufferStruct());
}
/**
* Adds a buffer list to the queue of buffers and buffer lists that the
* appsrc element will push to its source pad. This function takes ownership
* of @buffer_list.
*
* When the block property is TRUE, this function can block until free
* space becomes available in the queue.
*
* Params:
* bufferList = a #GstBufferList to push
*
* Returns: #GST_FLOW_OK when the buffer list was successfuly queued.
* #GST_FLOW_FLUSHING when @appsrc is not PAUSED or PLAYING.
* #GST_FLOW_EOS when EOS occured.
*
* Since: 1.14
*/
public GstFlowReturn pushBufferList(BufferList bufferList)
{
return gst_app_src_push_buffer_list(gstAppSrc, (bufferList is null) ? null : bufferList.getBufferListStruct());
}
/**
* Extract a buffer from the provided sample and adds it to the queue of
* buffers that the appsrc element will push to its source pad. Any
......@@ -345,7 +368,7 @@ public class AppSrc : BaseSrc, URIHandlerIF
*
* Params:
* min = the min latency
* max = the min latency
* max = the max latency
*/
public void setLatency(ulong min, ulong max)
{
......@@ -443,6 +466,25 @@ public class AppSrc : BaseSrc, URIHandlerIF
return Signals.connect(this, "push-buffer", dlg, connectFlags ^ ConnectFlags.SWAPPED);
}
/**
* Adds a buffer list to the queue of buffers and buffer lists that the
* appsrc element will push to its source pad. This function does not take
* ownership of the buffer list so the buffer list needs to be unreffed
* after calling this function.
*
* When the block property is TRUE, this function can block until free space
* becomes available in the queue.
*
* Params:
* bufferList = a buffer list to push
*
* Since: 1.14
*/
gulong addOnPushBufferList(GstFlowReturn delegate(BufferList, AppSrc) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
return Signals.connect(this, "push-buffer-list", dlg, connectFlags ^ ConnectFlags.SWAPPED);
}
/**
* Extract a buffer from the provided sample and adds the extracted buffer
* to the queue of buffers that the appsrc element will
......
......@@ -72,6 +72,7 @@ shared static this()
Linker.link(gst_app_src_get_size, "gst_app_src_get_size", LIBRARY_GSTAPP);
Linker.link(gst_app_src_get_stream_type, "gst_app_src_get_stream_type", LIBRARY_GSTAPP);
Linker.link(gst_app_src_push_buffer, "gst_app_src_push_buffer", LIBRARY_GSTAPP);
Linker.link(gst_app_src_push_buffer_list, "gst_app_src_push_buffer_list", LIBRARY_GSTAPP);
Linker.link(gst_app_src_push_sample, "gst_app_src_push_sample", LIBRARY_GSTAPP);
Linker.link(gst_app_src_set_callbacks, "gst_app_src_set_callbacks", LIBRARY_GSTAPP);
Linker.link(gst_app_src_set_duration, "gst_app_src_set_duration", LIBRARY_GSTAPP);
......@@ -121,6 +122,7 @@ __gshared extern(C)
long function(GstAppSrc* appsrc) c_gst_app_src_get_size;
GstAppStreamType function(GstAppSrc* appsrc) c_gst_app_src_get_stream_type;
GstFlowReturn function(GstAppSrc* appsrc, GstBuffer* buffer) c_gst_app_src_push_buffer;
GstFlowReturn function(GstAppSrc* appsrc, GstBufferList* bufferList) c_gst_app_src_push_buffer_list;
GstFlowReturn function(GstAppSrc* appsrc, GstSample* sample) c_gst_app_src_push_sample;
void function(GstAppSrc* appsrc, GstAppSrcCallbacks* callbacks, void* userData, GDestroyNotify notify) c_gst_app_src_set_callbacks;
void function(GstAppSrc* appsrc, GstClockTime duration) c_gst_app_src_set_duration;
......@@ -168,6 +170,7 @@ alias c_gst_app_src_get_max_bytes gst_app_src_get_max_bytes;
alias c_gst_app_src_get_size gst_app_src_get_size;
alias c_gst_app_src_get_stream_type gst_app_src_get_stream_type;
alias c_gst_app_src_push_buffer gst_app_src_push_buffer;
alias c_gst_app_src_push_buffer_list gst_app_src_push_buffer_list;
alias c_gst_app_src_push_sample gst_app_src_push_sample;
alias c_gst_app_src_set_callbacks gst_app_src_set_callbacks;
alias c_gst_app_src_set_duration gst_app_src_set_duration;
......
......@@ -183,7 +183,17 @@ struct GstAppSrcClass
* #GST_FLOW_EOS when EOS occured.
*/
extern(C) GstFlowReturn function(GstAppSrc* appsrc, GstSample* sample) pushSample;
void*[3] GstReserved;
/**
*
* Params:
* appsrc = a #GstAppSrc
* bufferList = a #GstBufferList to push
* Returns: #GST_FLOW_OK when the buffer list was successfuly queued.
* #GST_FLOW_FLUSHING when @appsrc is not PAUSED or PLAYING.
* #GST_FLOW_EOS when EOS occured.
*/
extern(C) GstFlowReturn function(GstAppSrc* appsrc, GstBufferList* bufferList) pushBufferList;
void*[2] GstReserved;
}
struct GstAppSrcPrivate;
/*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version, with
* some exceptions, please read the COPYING file.
*
* gtkD 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with gtkD; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
module gst.base.Aggregator;
private import glib.MemorySlice;
private import gobject.ObjectG;
private import gst.base.c.functions;
public import gst.base.c.types;
private import gstreamer.AllocationParams;
private import gstreamer.Allocator;
private import gstreamer.Buffer;
private import gstreamer.BufferPool;
private import gstreamer.Caps;
private import gstreamer.Element;
/**
* Manages a set of pads with the purpose of aggregating their buffers.
* Control is given to the subclass when all pads have data.
*
* * Base class for mixers and muxers. Subclasses should at least implement
* the #GstAggregatorClass.aggregate() virtual method.
*
* * Installs a #GstPadChainFunction, a #GstPadEventFullFunction and a
* #GstPadQueryFunction to queue all serialized data packets per sink pad.
* Subclasses should not overwrite those, but instead implement
* #GstAggregatorClass.sink_event() and #GstAggregatorClass.sink_query() as
* needed.
*
* * When data is queued on all pads, the aggregate vmethod is called.
*
* * One can peek at the data on any given GstAggregatorPad with the
* gst_aggregator_pad_peek_buffer () method, and remove it from the pad
* with the gst_aggregator_pad_pop_buffer () method. When a buffer
* has been taken with pop_buffer (), a new buffer can be queued
* on that pad.
*
* * If the subclass wishes to push a buffer downstream in its aggregate
* implementation, it should do so through the
* gst_aggregator_finish_buffer () method. This method will take care
* of sending and ordering mandatory events such as stream start, caps
* and segment.
*
* * Same goes for EOS events, which should not be pushed directly by the
* subclass, it should instead return GST_FLOW_EOS in its aggregate
* implementation.
*
* * Note that the aggregator logic regarding gap event handling is to turn
* these into gap buffers with matching PTS and duration. It will also
* flag these buffers with GST_BUFFER_FLAG_GAP and GST_BUFFER_FLAG_DROPPABLE
* to ease their identification and subsequent processing.
*
* * Subclasses must use (a subclass of) #GstAggregatorPad for both their
* sink and source pads.
* See gst_element_class_add_static_pad_template_with_gtype().
*
* This class used to live in gst-plugins-bad and was moved to core.
*/
public class Aggregator : Element
{
/** the main Gtk struct */
protected GstAggregator* gstAggregator;
/** Get the main Gtk struct */
public GstAggregator* getAggregatorStruct(bool transferOwnership = false)
{
if (transferOwnership)
ownedRef = false;
return gstAggregator;
}
/** the main Gtk struct as a void* */
protected override void* getStruct()
{
return cast(void*)gstAggregator;
}
/**
* Sets our main struct and passes it to the parent class.
*/
public this (GstAggregator* gstAggregator, bool ownedRef = false)
{
this.gstAggregator = gstAggregator;
super(cast(GstElement*)gstAggregator, ownedRef);
}
/** */
public static GType getType()
{
return gst_aggregator_get_type();
}
/**
* This method will push the provided output buffer downstream. If needed,
* mandatory events such as stream-start, caps, and segment events will be
* sent before pushing the buffer.
*
* Params:
* buffer = the #GstBuffer to push.
*/
public GstFlowReturn finishBuffer(Buffer buffer)
{
return gst_aggregator_finish_buffer(gstAggregator, (buffer is null) ? null : buffer.getBufferStruct());
}
/**
* Lets #GstAggregator sub-classes get the memory @allocator
* acquired by the base class and its @params.
*
* Unref the @allocator after use it.
*
* Params:
* allocator = the #GstAllocator
* used
* params = the
* #GstAllocationParams of @allocator
*/
public void getAllocator(out Allocator allocator, out AllocationParams params)
{
GstAllocator* outallocator = null;
GstAllocationParams* outparams = sliceNew!GstAllocationParams();
gst_aggregator_get_allocator(gstAggregator, &outallocator, outparams);
allocator = ObjectG.getDObject!(Allocator)(outallocator);
params = ObjectG.getDObject!(AllocationParams)(outparams, true);
}
/**
* Returns: the instance of the #GstBufferPool used
* by @trans; free it after use it
*/
public BufferPool getBufferPool()
{
auto p = gst_aggregator_get_buffer_pool(gstAggregator);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(BufferPool)(cast(GstBufferPool*) p, true);
}
/**
* Retrieves the latency values reported by @self in response to the latency
* query, or %GST_CLOCK_TIME_NONE if there is not live source connected and the element
* will not wait for the clock.
*
* Typically only called by subclasses.
*
* Returns: The latency or %GST_CLOCK_TIME_NONE if the element does not sync
*/
public GstClockTime getLatency()
{
return gst_aggregator_get_latency(gstAggregator);
}
/**
* Lets #GstAggregator sub-classes tell the baseclass what their internal
* latency is. Will also post a LATENCY message on the bus so the pipeline
* can reconfigure its global latency.
*
* Params:
* minLatency = minimum latency
* maxLatency = maximum latency
*/
public void setLatency(GstClockTime minLatency, GstClockTime maxLatency)
{
gst_aggregator_set_latency(gstAggregator, minLatency, maxLatency);
}
/**
* Sets the caps to be used on the src pad.
*
* Params:
* caps = The #GstCaps to set on the src pad.
*/
public void setSrcCaps(Caps caps)
{
gst_aggregator_set_src_caps(gstAggregator, (caps is null) ? null : caps.getCapsStruct());
}
}
/*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version, with
* some exceptions, please read the COPYING file.
*
* gtkD 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with gtkD; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
module gst.base.AggregatorPad;
private import gobject.ObjectG;
private import gst.base.c.functions;
public import gst.base.c.types;
private import gstreamer.Buffer;
private import gstreamer.Pad;
/**
* Pads managed by a #GstAggregor subclass.
*
* This class used to live in gst-plugins-bad and was moved to core.
*/
public class AggregatorPad : Pad
{
/** the main Gtk struct */
protected GstAggregatorPad* gstAggregatorPad;
/** Get the main Gtk struct */
public GstAggregatorPad* getAggregatorPadStruct(bool transferOwnership = false)
{
if (transferOwnership)
ownedRef = false;
return gstAggregatorPad;
}
/** the main Gtk struct as a void* */
protected override void* getStruct()
{
return cast(void*)gstAggregatorPad;
}
/**
* Sets our main struct and passes it to the parent class.
*/
public this (GstAggregatorPad* gstAggregatorPad, bool ownedRef = false)
{
this.gstAggregatorPad = gstAggregatorPad;
super(cast(GstPad*)gstAggregatorPad, ownedRef);
}
/** */
public static GType getType()
{
return gst_aggregator_pad_get_type();
}
/**
* Drop the buffer currently queued in @pad.
*
* Returns: TRUE if there was a buffer queued in @pad, or FALSE if not.
*/
public bool dropBuffer()
{
return gst_aggregator_pad_drop_buffer(gstAggregatorPad) != 0;
}
/**
* Returns: %TRUE if the pad is EOS, otherwise %FALSE.
*/
public bool isEos()
{
return gst_aggregator_pad_is_eos(gstAggregatorPad) != 0;
}
/**
* Returns: A reference to the buffer in @pad or
* NULL if no buffer was queued. You should unref the buffer after
* usage.
*/
public Buffer peekBuffer()
{
auto p = gst_aggregator_pad_peek_buffer(gstAggregatorPad);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(Buffer)(cast(GstBuffer*) p, true);
}
/**
* Steal the ref to the buffer currently queued in @pad.
*
* Returns: The buffer in @pad or NULL if no buffer was
* queued. You should unref the buffer after usage.
*/
public Buffer popBuffer()
{
auto p = gst_aggregator_pad_pop_buffer(gstAggregatorPad);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(Buffer)(cast(GstBuffer*) p, true);
}
}
......@@ -30,6 +30,7 @@ private import gst.base.c.functions;
public import gst.base.c.types;
private import gstreamer.AllocationParams;
private import gstreamer.Allocator;
private import gstreamer.BufferList;
private import gstreamer.BufferPool;
private import gstreamer.Caps;
private import gstreamer.Element;
......@@ -449,6 +450,34 @@ public class BaseSrc : Element
return gst_base_src_start_wait(gstBaseSrc);
}
/**
* Subclasses can call this from their create virtual method implementation
* to submit a buffer list to be pushed out later. This is useful in
* cases where the create function wants to produce multiple buffers to be
* pushed out in one go in form of a #GstBufferList, which can reduce overhead
* drastically, especially for packetised inputs (for data streams where
* the packetisation/chunking is not important it is usually more efficient
* to return larger buffers instead).
*
* Subclasses that use this function from their create function must return
* %GST_FLOW_OK and no buffer from their create virtual method implementation.
* If a buffer is returned after a buffer list has also been submitted via this
* function the behaviour is undefined.
*
* Subclasses must only call this function once per create function call and
* subclasses must only call this function when the source operates in push
* mode.
*
* Params:
* bufferList = a #GstBufferList
*
* Since: 1.14
*/
public void submitBufferList(BufferList bufferList)
{
gst_base_src_submit_buffer_list(gstBaseSrc, (bufferList is null) ? null : bufferList.getBufferListStruct());
}
/**
* If the #GstBaseSrcClass.create() method performs its own synchronisation
* against the clock it must unblock when going from PLAYING to the PAUSED state
......
......@@ -43,10 +43,10 @@ private import gstreamer.Query;
* be installed with gst_collect_pads_set_function ().
*
* * Pads are added to the collection with gst_collect_pads_add_pad()/
* gst_collect_pads_remove_pad(). The pad
* has to be a sinkpad. The chain and event functions of the pad are
* overridden. The element_private of the pad is used to store
* private information for the collectpads.
* gst_collect_pads_remove_pad(). The pad has to be a sinkpad. When added,
* the chain, event and query functions of the pad are overridden. The
* element_private of the pad is used to store private information for the
* collectpads.
*
* * For each pad, data is queued in the _chain function or by
* performing a pull_range.
......
......@@ -164,7 +164,13 @@ public class FlowCombiner
ownedRef = false;
}
/** */
/**
* Increments the reference count on the #GstFlowCombiner.
*
* Returns: the #GstFlowCombiner.
*
* Since: 1.12.1
*/
public FlowCombiner doref()
{
auto p = gst_flow_combiner_ref(gstFlowCombiner);
......@@ -200,7 +206,11 @@ public class FlowCombiner
gst_flow_combiner_reset(gstFlowCombiner);
}
/** */
/**
* Decrements the reference count on the #GstFlowCombiner.
*
* Since: 1.12.1
*/
public void unref()
{
gst_flow_combiner_unref(gstFlowCombiner);
......
......@@ -190,6 +190,30 @@ public class QueueArray
return gst_queue_array_peek_head_struct(gstQueueArray);
}
/**
* Returns the tail of the queue @array, but does not remove it from the queue.
*
* Returns: The tail of the queue
*
* Since: 1.14
*/
public void* peekTail()
{
return gst_queue_array_peek_tail(gstQueueArray);
}