22
octobre
2012
Gstreamer 1.0 base-plugins pour Vala
octobre
2012
Un article de Rachel
Pas de commentaires
Suite aux modifications apportées à Gstreamer, j’ai du réécrire ma bibliothèque. la voici :
using Gst;
namespace Gst
{
namespace BasePlugins
{
public class DecodeBin
{
Element decodebin;
Gst.Caps caps;
string sub;
public DecodeBin(){decodebin = ElementFactory.make("decodebin","decodebin");}
public DecodeBin.from_string(string name){decodebin2 = ElementFactory.make("decodebin",name);}
public static DecodeBin make(){DecodeBin db = new DecodeBin();return db;}
public static DecodeBin make_from_string(string name){DecodeBin db = new DecodeBin.from_string(name);return db;}
public Gst.Caps Caps{
get{decodebin.get("caps",out caps);return caps;}
set{decodebin.set("caps",value);}
}
public Gst.Caps SinkCaps{
get{decodebin.get("sink-caps",out caps);return caps;}
set{decodebin.set("sink-caps",value);}
}
public string SubtitleEncoding{
get{decodebin.get("subtitle-encoding", out sub);return sub;}
set{decodebin.set("subtitle-encoding",value);}
}
public void AutoplugContinue (Callback connect_func){Signal.connect(decodebin,"autoplug-contiue",connect_func,null);}
public void AutoplugFactories (Callback connect_func){Signal.connect(decodebin,"autoplug-factories",connect_func,null);}
public void AutoplugSelect (Callback connect_func){Signal.connect(decodebin,"autoplug-select",connect_func,null);}
public void AutoplugSort (Callback connect_func){Signal.connect(decodebin,"autoplug-sort",connect_func,null);}
public void Drained (Callback connect_func){Signal.connect(decodebin,"drained",connect_func,null);}
}
public class PlayBin : GLib.Object
{
Element playbin;
Pad pad;
Buffer o;
TagList tag_list;
string uri;
double volume;
Gst.Bus bus;
Element sink;
ulong u;
int i;
uint ui;
bool mute;
public PlayBin(){playbin = ElementFactory.make("playbin","playbin");}
public PlayBin.from_string(string name){playbin = ElementFactory.make("playbin",name);}
public static PlayBin make(){PlayBin pb = new PlayBin();return pb;}
public static PlayBin make_from_string(string name){PlayBin pb = new PlayBin.from_string(name);return pb;}
public Pad GetAudioPad (int index){Signal.emit_by_name(playbin,"get-audio-pad",index,out pad);return pad;}
public Pad GetTextPad (int index){Signal.emit_by_name(playbin,"get-text-pad",index,out pad);return pad;}
public Pad GetVideoPad (int index){Signal.emit_by_name(playbin,"get-video-pad",index,out pad);return pad;}
public TagList GetAudioTags (int index){Signal.emit_by_name(playbin,"get-audio-tags",index,out tag_list);return tag_list;}
public TagList GetVideoTags (int index){Signal.emit_by_name(playbin,"get-video-tags",index,out tag_list);return tag_list;}
public TagList GetTextTags (int index){Signal.emit_by_name(playbin,"get-text-tags",index,out tag_list);return tag_list;}
public string Uri{
get{playbin.get("uri", out uri);return uri;}
set{playbin.set("uri",value);}
}
public double Volume{
get{playbin.get("volume",out volume);return volume;}
set{playbin.set("volume",value);}
}
public bool Mute{
get{return mute;}
set{mute = value;if(mute){playbin.set("volume",0);}else{playbin.set("volume",volume);}}
}
public Element AudioSink{
get{playbin.get("audio-sink",out sink);return sink;}
set{playbin.set("audio-sink",value);}
}
public Element VideoSink{
get{playbin.get("video-sink",out sink);return sink;}
set{playbin.set("video-sink",value);}
}
public Element Source{
get{playbin.get("source",out sink);return sink;}
set{playbin.set("source",value);}
}
public Element SubpicSink{
get{playbin.get("subpic-sink", out sink);return sink;}
set{playbin.set("subpic-sink",value);}
}
public string SubtitleEncoding{
get{playbin.get("subtitle-encoding", out uri);return uri;}
set{playbin.set("subtitle-encoding", value);}
}
public string SubtitleFontDesc{
get{playbin.get("subtitle-font-desc", out uri);return uri;}
set{playbin.set("subtitle-font-desc", value);}
}
public string SubUri{
get{playbin.get("sub-uri", out uri); return uri;}
set{playbin.set("sub-uri", value);}
}
public int NAudio{get{playbin.get("n-audio",out i);return i;}}
public int NVideo{get{playbin.get("n-video",out i);return i;}}
public int NText{get{playbin.get("n-text",out i);return i;}}
public int CurrentAudio{get{playbin.get("current-audio",out i);return i;}}
public int CurrentVideo{get{playbin.get("current-video",out i);return i;}}
public int CurrentText{get{playbin.get("current-text",out i);return i;}}
public Element TextSink{
get{playbin.get("text-sink",out sink);return sink;}
set{playbin.set("text-sink",value);}
}
public Element VisPlugin{
get{playbin.get("vis-plugin", out sink);return sink;}
set{playbin.set("vis-plugin", value);}
}
public ulong BufferDuration{
get{playbin.get("buffer-duration", out u);return u;}
set{playbin.set("buffer-duration",value);}
}
public int BufferSize{
get{playbin.get("buffer-size", out i);return i;}
set{playbin.set("buffer_size", value);}
}
public uint ConnectionSpeed{
get{playbin.get("connection-speed",out ui);return ui;}
set{playbin.set("connection-speed",value);}
}
public Gst.Bus Bus{
get{bus = playbin.get_bus();return bus;}
set{playbin.bus = value;}
}
public StateChangeReturn SetState(State new_state){return playbin.set_state(new_state);}
public StateChangeReturn GetState(out State state,out State pending,ClockTime clock_time){return playbin.get_state(out state, out pending, clock_time);}
public State CurrentState{get{return playbin.current_state;}}
public void AboutToFinish(Callback connect_func){
Signal.connect(playbin,"about-to-finish",connect_func,null);
}
public void AudioChanged(Callback connect_func){
Signal.connect(playbin,"audio-changed",connect_func,null);
}
public void VideoChanged(Callback connect_func){
Signal.connect(playbin,"video-changed",connect_func,null);
}
public void TextChanged(Callback connect_func){
Signal.connect(playbin,"text-changed",connect_func,null);
}
}
public class XImageSink
{
Element ximagesink;
string str;
bool b;
public XImageSink(){ximagesink = ElementFactory.make("ximagesink","ximagesink");}
public XImageSink.from_string(string name){ximagesink = ElementFactory.make("ximagesink",name);}
public static XImageSink make(){XImageSink xis = new XImageSink();return xis;}
public static XImageSink make_from_string(string name){XImageSink xis = new XImageSink.from_string(name);return xis;}
public string Display{
get{ximagesink.get("display",out str);return str;}
set{ximagesink.set("display",value);}
}
public string PixelAspectRatio{
get{ximagesink.get("pixel-aspect-ratio",out str);return str;}
set{ximagesink.set("pixel-aspect-ratio",value);}
}
public bool ForceAspectRatio{
get{ximagesink.get("force-aspect-ratio",out b);return b;}
set{ximagesink.set("force-aspect-ratio",value);}
}
public bool HandleEvents{
get{ximagesink.get("handle-events",out b);return b;}
set{ximagesink.set("handle-events",value);}
}
public bool HandleExpose{
get{ximagesink.get("handle-expose",out b);return b;}
set{ximagesink.set("handle-expose",value);}
}
public bool ShowPrerollFrame{
get{ximagesink.get("show-preroll-frame",out b);return b;}
set{ximagesink.set("show-preroll-frame",value);}
}
public bool Synchronous{
get{ximagesink.get("synchronous",out b);return b;}
set{ximagesink.set("synchronous",value);}
}
}
public class XvImageSink
{
bool b;
string str;
int i;
Element xvimagesink;
public XvImageSink(){xvimagesink = ElementFactory.make("xvimagesink","xvimagesink");}
public XvImageSink.from_string(string name){xvimagesink = ElementFactory.make("xvimagesink",name);}
public static XvImageSink make(){XvImageSink xvis = new XvImageSink();return xvis;}
public static XvImageSink make_from_string(string name){XvImageSink xvis = new XvImageSink.from_string(name);return xvis;}
public string Display{
get{xvimagesink.get("display",out str);return str;}
set{xvimagesink.set("display",value);}
}
public string PixelAspectRatio{
get{xvimagesink.get("pixel-aspect-ratio",out str);return str;}
set{xvimagesink.set("pixel-aspect-ratio",value);}
}
public bool ForceAspectRatio{
get{xvimagesink.get("force-aspect-ratio",out b);return b;}
set{xvimagesink.set("force-aspect-ratio",value);}
}
public bool HandleEvents{
get{xvimagesink.get("handle-events",out b);return b;}
set{xvimagesink.set("handle-events",value);}
}
public bool HandleExpose{
get{xvimagesink.get("handle-expose",out b);return b;}
set{xvimagesink.set("handle-expose",value);}
}
public bool ShowPrerollFrame{
get{xvimagesink.get("show-preroll-frame",out b);return b;}
set{xvimagesink.set("show-preroll-frame",value);}
}
public bool Synchronous{
get{xvimagesink.get("synchronous",out b);return b;}
set{xvimagesink.set("synchronous",value);}
}
public bool AutopaintColorkey{
get{xvimagesink.get("auto-paint-colorkey",out b);return b;}
set{xvimagesink.set("auto-paint-colorkey",value);}
}
public int Brightness{
get{xvimagesink.get("brightness",out i);return i;}
set{xvimagesink.set("brightness",value);}
}
public int Colorkey{
get{xvimagesink.get("colorkey",out i);return i;}
set{xvimagesink.set("colorkey",value);}
}
public int Contrast{
get{xvimagesink.get("contrast",out i);return i;}
set{xvimagesink.set("contrast",value);}
}
public int Hue{
get{xvimagesink.get("hue",out i);return i;}
set{xvimagesink.set("hue",value);}
}
public int Saturation{
get{xvimagesink.get("saturation",out i);return i;}
set{xvimagesink.set("saturation",value);}
}
public string Device{
get{xvimagesink.get("device",out str);return str;}
set{xvimagesink.set("device",value);}
}
public string DeviceName{
get{xvimagesink.get("device-name",out str);return str;}
set{xvimagesink.set("device-name",value);}
}
public bool DoubleBuffer{
get{xvimagesink.get("double-buffer",out b);return b;}
set{xvimagesink.set("double-buffer",value);}
}
public bool DrawBorders{
get{xvimagesink.get("draw-borders",out b);return b;}
set{xvimagesink.set("draw-borders",value);}
}
}
}
}
namespace Gst
{
namespace BasePlugins
{
public class DecodeBin
{
Element decodebin;
Gst.Caps caps;
string sub;
public DecodeBin(){decodebin = ElementFactory.make("decodebin","decodebin");}
public DecodeBin.from_string(string name){decodebin2 = ElementFactory.make("decodebin",name);}
public static DecodeBin make(){DecodeBin db = new DecodeBin();return db;}
public static DecodeBin make_from_string(string name){DecodeBin db = new DecodeBin.from_string(name);return db;}
public Gst.Caps Caps{
get{decodebin.get("caps",out caps);return caps;}
set{decodebin.set("caps",value);}
}
public Gst.Caps SinkCaps{
get{decodebin.get("sink-caps",out caps);return caps;}
set{decodebin.set("sink-caps",value);}
}
public string SubtitleEncoding{
get{decodebin.get("subtitle-encoding", out sub);return sub;}
set{decodebin.set("subtitle-encoding",value);}
}
public void AutoplugContinue (Callback connect_func){Signal.connect(decodebin,"autoplug-contiue",connect_func,null);}
public void AutoplugFactories (Callback connect_func){Signal.connect(decodebin,"autoplug-factories",connect_func,null);}
public void AutoplugSelect (Callback connect_func){Signal.connect(decodebin,"autoplug-select",connect_func,null);}
public void AutoplugSort (Callback connect_func){Signal.connect(decodebin,"autoplug-sort",connect_func,null);}
public void Drained (Callback connect_func){Signal.connect(decodebin,"drained",connect_func,null);}
}
public class PlayBin : GLib.Object
{
Element playbin;
Pad pad;
Buffer o;
TagList tag_list;
string uri;
double volume;
Gst.Bus bus;
Element sink;
ulong u;
int i;
uint ui;
bool mute;
public PlayBin(){playbin = ElementFactory.make("playbin","playbin");}
public PlayBin.from_string(string name){playbin = ElementFactory.make("playbin",name);}
public static PlayBin make(){PlayBin pb = new PlayBin();return pb;}
public static PlayBin make_from_string(string name){PlayBin pb = new PlayBin.from_string(name);return pb;}
public Pad GetAudioPad (int index){Signal.emit_by_name(playbin,"get-audio-pad",index,out pad);return pad;}
public Pad GetTextPad (int index){Signal.emit_by_name(playbin,"get-text-pad",index,out pad);return pad;}
public Pad GetVideoPad (int index){Signal.emit_by_name(playbin,"get-video-pad",index,out pad);return pad;}
public TagList GetAudioTags (int index){Signal.emit_by_name(playbin,"get-audio-tags",index,out tag_list);return tag_list;}
public TagList GetVideoTags (int index){Signal.emit_by_name(playbin,"get-video-tags",index,out tag_list);return tag_list;}
public TagList GetTextTags (int index){Signal.emit_by_name(playbin,"get-text-tags",index,out tag_list);return tag_list;}
public string Uri{
get{playbin.get("uri", out uri);return uri;}
set{playbin.set("uri",value);}
}
public double Volume{
get{playbin.get("volume",out volume);return volume;}
set{playbin.set("volume",value);}
}
public bool Mute{
get{return mute;}
set{mute = value;if(mute){playbin.set("volume",0);}else{playbin.set("volume",volume);}}
}
public Element AudioSink{
get{playbin.get("audio-sink",out sink);return sink;}
set{playbin.set("audio-sink",value);}
}
public Element VideoSink{
get{playbin.get("video-sink",out sink);return sink;}
set{playbin.set("video-sink",value);}
}
public Element Source{
get{playbin.get("source",out sink);return sink;}
set{playbin.set("source",value);}
}
public Element SubpicSink{
get{playbin.get("subpic-sink", out sink);return sink;}
set{playbin.set("subpic-sink",value);}
}
public string SubtitleEncoding{
get{playbin.get("subtitle-encoding", out uri);return uri;}
set{playbin.set("subtitle-encoding", value);}
}
public string SubtitleFontDesc{
get{playbin.get("subtitle-font-desc", out uri);return uri;}
set{playbin.set("subtitle-font-desc", value);}
}
public string SubUri{
get{playbin.get("sub-uri", out uri); return uri;}
set{playbin.set("sub-uri", value);}
}
public int NAudio{get{playbin.get("n-audio",out i);return i;}}
public int NVideo{get{playbin.get("n-video",out i);return i;}}
public int NText{get{playbin.get("n-text",out i);return i;}}
public int CurrentAudio{get{playbin.get("current-audio",out i);return i;}}
public int CurrentVideo{get{playbin.get("current-video",out i);return i;}}
public int CurrentText{get{playbin.get("current-text",out i);return i;}}
public Element TextSink{
get{playbin.get("text-sink",out sink);return sink;}
set{playbin.set("text-sink",value);}
}
public Element VisPlugin{
get{playbin.get("vis-plugin", out sink);return sink;}
set{playbin.set("vis-plugin", value);}
}
public ulong BufferDuration{
get{playbin.get("buffer-duration", out u);return u;}
set{playbin.set("buffer-duration",value);}
}
public int BufferSize{
get{playbin.get("buffer-size", out i);return i;}
set{playbin.set("buffer_size", value);}
}
public uint ConnectionSpeed{
get{playbin.get("connection-speed",out ui);return ui;}
set{playbin.set("connection-speed",value);}
}
public Gst.Bus Bus{
get{bus = playbin.get_bus();return bus;}
set{playbin.bus = value;}
}
public StateChangeReturn SetState(State new_state){return playbin.set_state(new_state);}
public StateChangeReturn GetState(out State state,out State pending,ClockTime clock_time){return playbin.get_state(out state, out pending, clock_time);}
public State CurrentState{get{return playbin.current_state;}}
public void AboutToFinish(Callback connect_func){
Signal.connect(playbin,"about-to-finish",connect_func,null);
}
public void AudioChanged(Callback connect_func){
Signal.connect(playbin,"audio-changed",connect_func,null);
}
public void VideoChanged(Callback connect_func){
Signal.connect(playbin,"video-changed",connect_func,null);
}
public void TextChanged(Callback connect_func){
Signal.connect(playbin,"text-changed",connect_func,null);
}
}
public class XImageSink
{
Element ximagesink;
string str;
bool b;
public XImageSink(){ximagesink = ElementFactory.make("ximagesink","ximagesink");}
public XImageSink.from_string(string name){ximagesink = ElementFactory.make("ximagesink",name);}
public static XImageSink make(){XImageSink xis = new XImageSink();return xis;}
public static XImageSink make_from_string(string name){XImageSink xis = new XImageSink.from_string(name);return xis;}
public string Display{
get{ximagesink.get("display",out str);return str;}
set{ximagesink.set("display",value);}
}
public string PixelAspectRatio{
get{ximagesink.get("pixel-aspect-ratio",out str);return str;}
set{ximagesink.set("pixel-aspect-ratio",value);}
}
public bool ForceAspectRatio{
get{ximagesink.get("force-aspect-ratio",out b);return b;}
set{ximagesink.set("force-aspect-ratio",value);}
}
public bool HandleEvents{
get{ximagesink.get("handle-events",out b);return b;}
set{ximagesink.set("handle-events",value);}
}
public bool HandleExpose{
get{ximagesink.get("handle-expose",out b);return b;}
set{ximagesink.set("handle-expose",value);}
}
public bool ShowPrerollFrame{
get{ximagesink.get("show-preroll-frame",out b);return b;}
set{ximagesink.set("show-preroll-frame",value);}
}
public bool Synchronous{
get{ximagesink.get("synchronous",out b);return b;}
set{ximagesink.set("synchronous",value);}
}
}
public class XvImageSink
{
bool b;
string str;
int i;
Element xvimagesink;
public XvImageSink(){xvimagesink = ElementFactory.make("xvimagesink","xvimagesink");}
public XvImageSink.from_string(string name){xvimagesink = ElementFactory.make("xvimagesink",name);}
public static XvImageSink make(){XvImageSink xvis = new XvImageSink();return xvis;}
public static XvImageSink make_from_string(string name){XvImageSink xvis = new XvImageSink.from_string(name);return xvis;}
public string Display{
get{xvimagesink.get("display",out str);return str;}
set{xvimagesink.set("display",value);}
}
public string PixelAspectRatio{
get{xvimagesink.get("pixel-aspect-ratio",out str);return str;}
set{xvimagesink.set("pixel-aspect-ratio",value);}
}
public bool ForceAspectRatio{
get{xvimagesink.get("force-aspect-ratio",out b);return b;}
set{xvimagesink.set("force-aspect-ratio",value);}
}
public bool HandleEvents{
get{xvimagesink.get("handle-events",out b);return b;}
set{xvimagesink.set("handle-events",value);}
}
public bool HandleExpose{
get{xvimagesink.get("handle-expose",out b);return b;}
set{xvimagesink.set("handle-expose",value);}
}
public bool ShowPrerollFrame{
get{xvimagesink.get("show-preroll-frame",out b);return b;}
set{xvimagesink.set("show-preroll-frame",value);}
}
public bool Synchronous{
get{xvimagesink.get("synchronous",out b);return b;}
set{xvimagesink.set("synchronous",value);}
}
public bool AutopaintColorkey{
get{xvimagesink.get("auto-paint-colorkey",out b);return b;}
set{xvimagesink.set("auto-paint-colorkey",value);}
}
public int Brightness{
get{xvimagesink.get("brightness",out i);return i;}
set{xvimagesink.set("brightness",value);}
}
public int Colorkey{
get{xvimagesink.get("colorkey",out i);return i;}
set{xvimagesink.set("colorkey",value);}
}
public int Contrast{
get{xvimagesink.get("contrast",out i);return i;}
set{xvimagesink.set("contrast",value);}
}
public int Hue{
get{xvimagesink.get("hue",out i);return i;}
set{xvimagesink.set("hue",value);}
}
public int Saturation{
get{xvimagesink.get("saturation",out i);return i;}
set{xvimagesink.set("saturation",value);}
}
public string Device{
get{xvimagesink.get("device",out str);return str;}
set{xvimagesink.set("device",value);}
}
public string DeviceName{
get{xvimagesink.get("device-name",out str);return str;}
set{xvimagesink.set("device-name",value);}
}
public bool DoubleBuffer{
get{xvimagesink.get("double-buffer",out b);return b;}
set{xvimagesink.set("double-buffer",value);}
}
public bool DrawBorders{
get{xvimagesink.get("draw-borders",out b);return b;}
set{xvimagesink.set("draw-borders",value);}
}
}
}
}