return FALSE;
}
- /* creating audio_sink from osssink (?) */
+ /* creating fake audio_sink */
play->audio_sink = gst_element_factory_make ("fakesink", "fake_audio");
if (play->audio_sink == NULL)
{
return FALSE;
}
- g_signal_connect (
- G_OBJECT (play->audio_sink), "eos",
- G_CALLBACK (callback_audio_sink_eos), play);
-
gst_bin_add_many (
GST_BIN (play->pipeline), play->volume,
play->audio_sink, NULL);
return FALSE;
}
- g_signal_connect (
- G_OBJECT (play->audio_sink), "eos",
- G_CALLBACK (callback_audio_sink_eos), play);
-
gst_bin_add_many (
GST_BIN (play->pipeline), play->volume,
play->audio_sink, NULL);
gst_bin_add (GST_BIN (play->pipeline), play->audio_sink);
gst_element_connect (play->volume, play->audio_sink);
+ play->audio_sink_element = gst_play_get_sink_element (play, audio_sink);
+
+ if (play->audio_sink_element != NULL) {
+ g_signal_connect (G_OBJECT (play->audio_sink_element), "eos",
+ G_CALLBACK (callback_audio_sink_eos), play);
+ }
+
return TRUE;
}
gst_play_audiot_set_auto (GstPlay *play, GstElement *autoplugger)
{
- g_return_val_if_fail (GST_IS_PLAY(play), FALSE);
+ g_return_val_if_fail (GST_IS_PLAY (play), FALSE);
g_return_val_if_fail (GST_IS_ELEMENT (autoplugger), FALSE);
- if (play->autoplugger){
+ if (play->autoplugger) {
/* we need to remove the existing autoplugger before creating a new one */
gst_element_disconnect (play->autoplugger, play->volume);
gst_element_disconnect (play->autoplugger, play->source);
/* create audiosink. */
play->audio_sink = gst_element_factory_make ("fakesink", "play_audio");
- if (!play->audio_sink)
- g_warning ("You need the fakesink element to use this program.\n");
-
- g_signal_connect (G_OBJECT (play->audio_sink), "eos",
- G_CALLBACK (callback_audio_sink_eos), play);
-
+ if (play->audio_sink == NULL)
+ {
+ gst_play_error_plugin (GST_PLAY_ERROR_FAKESINK, error);
+ return FALSE;
+ }
+
gst_bin_add_many (
GST_BIN (audio_thread), audio_queue, play->volume,
play->audio_sink, NULL);
gst_bin_add (GST_BIN (audio_thread), play->audio_sink);
gst_element_connect (play->volume, play->audio_sink);
+ play->audio_sink_element = gst_play_get_sink_element (play, audio_sink);
+
+ if (play->audio_sink_element != NULL) {
+ g_signal_connect (G_OBJECT (play->audio_sink_element), "eos",
+ G_CALLBACK (callback_audio_sink_eos), play);
+ }
+
return TRUE;
}
audio_thread = g_hash_table_lookup(play->other_elements, "audio_thread");
- if (play->autoplugger){
+ if (play->autoplugger) {
/* we need to remove the existing autoplugger before creating a new one */
gst_element_disconnect (play->autoplugger, audio_thread);
gst_element_disconnect (play->autoplugger, play->source);
static gboolean
-gst_play_video_set_auto (GstPlay *play, GstElement *autoplugger){
+gst_play_video_set_auto (GstPlay *play, GstElement *autoplugger)
+{
GstElement *audio_bin, *video_bin, *work_thread;
video_bin = g_hash_table_lookup(play->other_elements, "video_bin");
work_thread = g_hash_table_lookup(play->other_elements, "work_thread");
- if (play->autoplugger){
+ if (play->autoplugger) {
/* we need to remove the existing autoplugger before creating a new one */
gst_element_disconnect (play->autoplugger, audio_bin);
gst_element_disconnect (play->autoplugger, play->source);
video_bin = g_hash_table_lookup(play->other_elements, "video_bin");
video_mate = g_hash_table_lookup(play->other_elements, "colorspace");
- if (play->video_sink){
+ if (play->video_sink) {
gst_element_disconnect (video_mate, play->video_sink);
gst_bin_remove (GST_BIN (video_bin), play->video_sink);
}
play->video_sink_element = gst_play_get_sink_element (play, video_sink);
- if (play->video_sink_element != NULL){
+ if (play->video_sink_element != NULL) {
g_signal_connect (G_OBJECT (play->video_sink_element), "have_xid",
G_CALLBACK (callback_video_have_xid), play);
g_signal_connect (G_OBJECT (play->video_sink_element), "have_size",
play->audio_sink_element = gst_play_get_sink_element (play, audio_sink);
- if (play->audio_sink_element != NULL){
- g_signal_connect (G_OBJECT (play->audio_sink), "eos",
+ if (play->audio_sink_element != NULL) {
+ g_signal_connect (G_OBJECT (play->audio_sink_element), "eos",
G_CALLBACK (callback_audio_sink_eos), play);
}
return FALSE;
}
- /* create audiosink.
- FIXME : Should use gconf to choose the right one */
- play->audio_sink = gst_element_factory_make ("osssink", "play_audio");
+ /* creating audio_sink element */
+ play->audio_sink = gst_element_factory_make ("fakesink", "fake_audio");
if (!play->audio_sink)
- g_warning ("You need the osssink element to use this program.\n");
+ {
+ gst_play_error_plugin (GST_PLAY_ERROR_FAKESINK, error);
+ return FALSE;
+ }
+ play->audio_sink_element = NULL;
- g_object_set (G_OBJECT (play->audio_sink), "fragment", 0x00180008, NULL);
- g_signal_connect (
- G_OBJECT (play->audio_sink), "eos",
- G_CALLBACK (callback_audio_sink_eos), play);
-
audio_queue = gst_element_factory_make ("queue", "audio_queue");
if (!audio_queue)
{
static gboolean
-gst_play_videots_set_auto (GstPlay *play, GstElement *autoplugger){
+gst_play_videots_set_auto (GstPlay *play, GstElement *autoplugger)
+{
GstElement *audio_bin, *auto_identity, *work_thread;
auto_identity = g_hash_table_lookup(play->other_elements, "auto_identity");
work_thread = g_hash_table_lookup(play->other_elements, "work_thread");
- if (play->autoplugger){
- /* we need to remove the existing autoplugger before creating a new one */
+ if (play->autoplugger) {
+ /* we need to remove the existing autoplugger
+ * before creating a new one */
gst_element_disconnect (play->autoplugger, audio_bin);
gst_element_disconnect (play->autoplugger, play->source);
gst_element_disconnect (play->autoplugger, auto_identity);
{
GstElement *video_mate;
- g_return_val_if_fail (GST_IS_PLAY(play), FALSE);
+ g_return_val_if_fail (GST_IS_PLAY (play), FALSE);
g_return_val_if_fail (GST_IS_ELEMENT (video_sink), FALSE);
- video_mate = g_hash_table_lookup(play->other_elements, "video_queue");
+ video_mate = g_hash_table_lookup (play->other_elements, "video_queue");
- if (play->video_sink){
+ if (play->video_sink) {
gst_element_disconnect (video_mate, play->video_sink);
gst_bin_remove (GST_BIN (play->pipeline), play->video_sink);
}
{
GstElement *audio_bin;
- g_return_val_if_fail (GST_IS_PLAY(play), FALSE);
+ g_return_val_if_fail (GST_IS_PLAY (play), FALSE);
g_return_val_if_fail (GST_IS_ELEMENT (audio_sink), FALSE);
audio_bin = g_hash_table_lookup(play->other_elements, "audio_bin");
gst_bin_add (GST_BIN (audio_bin), play->audio_sink);
gst_element_connect (play->volume, play->audio_sink);
+ play->audio_sink_element = gst_play_get_sink_element (play, audio_sink);
+
+ if (play->audio_sink_element != NULL) {
+ g_signal_connect (G_OBJECT (play->audio_sink_element), "eos",
+ G_CALLBACK (callback_audio_sink_eos), play);
+ }
return TRUE;
}