/* gstreamermm - a C++ wrapper for gstreamer
 *
 * Copyright 2008 The gstreamermm Development Team
 *
 * This library 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 2.1 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gstreamermm/pipeline.h>
#include <gstreamermm/element.h>
#include <gstreamermm/buffer.h>
#include <gstreamermm/taglist.h>
#include <gstreamermm/caps.h>
#include <gstreamermm/pad.h>
_DEFS(gstreamermm,gst)

namespace Gst
{

_WRAP_ENUM(PlayFlags, GstPlayFlags)

/** Gst::PlayBin2 - playbin2 plugin.
 * Please include <gstreamermm/playbin2.h> to use.  Please note that, though
 * using the underlying GObject is fine, using its C <B>type</B> is not
 * guaranteed to be API stable across releases because it is not guaranteed to
 * always remain the same.  Also, not all plug-ins are available on all systems
 * and the ones that aren't available are not included in the build.
 *
 * @ingroup GstPlugins
 */
class PlayBin2
: public Gst::Pipeline
{
  _CLASS_GOBJECT(PlayBin2, GstPlayBin2, GST_PLAY_BIN2, Gst::Pipeline, GstPipeline)

  _IS_GSTREAMERMM_PLUGIN

protected:
  PlayBin2();
  PlayBin2(const Glib::ustring& name);

public:
/** Creates a new playbin2 plugin with a unique name.
 */
  _WRAP_CREATE()

/** Creates a new playbin2 plugin with the given name.
 */
  _WRAP_CREATE(const Glib::ustring& name)

  _WRAP_PROPERTY("uri", Glib::ustring)
  _WRAP_PROPERTY("suburi", Glib::ustring)
  _WRAP_PROPERTY("source", Glib::RefPtr<Gst::Element>)
  _WRAP_PROPERTY("flags", PlayFlags)
  _WRAP_PROPERTY("n-video", int)
  _WRAP_PROPERTY("current-video", int)
  _WRAP_PROPERTY("n-audio", int)
  _WRAP_PROPERTY("current-audio", int)
  _WRAP_PROPERTY("n-text", int)
  _WRAP_PROPERTY("current-text", int)
  _WRAP_PROPERTY("subtitle-encoding", Glib::ustring)
  _WRAP_PROPERTY("audio-sink", Glib::RefPtr<Gst::Element>)
  _WRAP_PROPERTY("video-sink", Glib::RefPtr<Gst::Element>)
  _WRAP_PROPERTY("vis-plugin", Glib::RefPtr<Gst::Element>)
  _WRAP_PROPERTY("volume", double)
  _WRAP_PROPERTY("mute", bool)
  _WRAP_PROPERTY("frame", Glib::RefPtr<Gst::Buffer>)
  _WRAP_PROPERTY("subtitle-font-desc", Glib::ustring)
  _WRAP_PROPERTY("connection-speed", guint)
  _WRAP_PROPERTY("buffer-size", int)
  _WRAP_PROPERTY("buffer-duration", gint64)

  _WRAP_SIGNAL(void about_to_finish(), "about-to-finish")
  _WRAP_SIGNAL(void video_changed(), "video-changed")
  _WRAP_SIGNAL(void audio_changed(), "audio-changed")
  _WRAP_SIGNAL(void text_changed(), "text-changed")
  _WRAP_SIGNAL(Gst::TagList get_video_tags(int arg0), "get-video-tags")
  _WRAP_SIGNAL(Gst::TagList get_audio_tags(int arg0), "get-audio-tags")
  _WRAP_SIGNAL(Gst::TagList get_text_tags(int arg0), "get-text-tags")
#m4 _CONVERSION(`GstCaps*', `const Glib::RefPtr<Gst::Caps>&', `Glib::wrap($3, true)')
  _WRAP_SIGNAL(Glib::RefPtr<Gst::Buffer> convert_frame(const Glib::RefPtr<Gst::Caps>& arg0), "convert-frame")
  _WRAP_SIGNAL(Glib::RefPtr<Gst::Pad> get_video_pad(int arg0), "get-video-pad")
  _WRAP_SIGNAL(Glib::RefPtr<Gst::Pad> get_audio_pad(int arg0), "get-audio-pad")
  _WRAP_SIGNAL(Glib::RefPtr<Gst::Pad> get_text_pad(int arg0), "get-text-pad")
};

} //namespace Gst
