* <title>Embedding the video window in your application</title>
* By default, playbin (or rather the video sinks used) will create their own
* window. Applications will usually want to force output to a window of their
- * own, however. This can be done using the GstXOverlay interface, which most
+ * own, however. This can be done using the #GstXOverlay interface, which most
* video sinks implement. See the documentation there for more details.
* </refsect2>
* <refsect2>
#include <gst/pbutils/pbutils.h>
#include "gstplaybasebin.h"
+#include "gstplayback.h"
GST_DEBUG_CATEGORY_STATIC (gst_play_bin_debug);
#define GST_CAT_DEFAULT gst_play_bin_debug
g_param_spec_object ("vis-plugin", "Vis plugin",
"the visualization element to use (NULL = none)",
GST_TYPE_ELEMENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * GstPlayBin:volume:
+ *
+ * Get or set the current audio stream volume. 1.0 means 100%,
+ * 0.0 means mute. This uses a linear volume scale.
+ *
+ */
g_object_class_install_property (gobject_klass, ARG_VOLUME,
g_param_spec_double ("volume", "volume", "volume",
0.0, VOLUME_MAX_DOUBLE, 1.0,
"Pango font description of font " "to be used for subtitle rendering",
NULL, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
- gobject_klass->dispose = GST_DEBUG_FUNCPTR (gst_play_bin_dispose);
+ gobject_klass->dispose = gst_play_bin_dispose;
gst_element_class_set_details (gstelement_klass, &gst_play_bin_details);
}
vis_bin =
- GST_BIN_CAST (gst_object_get_parent (GST_OBJECT_CAST (play_bin->
- visualisation)));
+ GST_BIN_CAST (gst_object_get_parent (GST_OBJECT_CAST
+ (play_bin->visualisation)));
if (!GST_IS_BIN (vis_bin) || !GST_IS_PAD (tee_pad)) {
goto beach;
GstBin *vis_bin = NULL;
vis_bin =
- GST_BIN_CAST (gst_object_get_parent (GST_OBJECT_CAST (play_bin->
- visualisation)));
+ GST_BIN_CAST (gst_object_get_parent (GST_OBJECT_CAST
+ (play_bin->visualisation)));
/* Check if the visualisation is already in a bin */
if (GST_IS_BIN (vis_bin)) {
if (volume == NULL)
goto no_volume;
g_object_set (G_OBJECT (volume), "volume", play_bin->volume, NULL);
- play_bin->volume_element = volume;
+ play_bin->volume_element = GST_ELEMENT_CAST (gst_object_ref (volume));
gst_bin_add (GST_BIN_CAST (element), volume);
res = gst_element_link_pads (conv, "src", scale, "sink");
gst_object_unref (play_bin->textoverlay_element);
play_bin->textoverlay_element = NULL;
}
+
+ if (play_bin->volume_element) {
+ gst_object_unref (play_bin->volume_element);
+ play_bin->volume_element = NULL;
+ }
}
/* loop over the streams and set up the pipeline to play this