pidgin.vv: 603bb4b4: Create the media srcs inside PurpleMedia...
maiku at soc.pidgin.im
maiku at soc.pidgin.im
Fri Jan 30 04:05:33 EST 2009
-----------------------------------------------------------------
Revision: 603bb4b4fbde143586abdf5fe202fb10ee8d608e
Ancestor: 76290f7a280d917adb6873ecf15868453f80d73e
Author: maiku at soc.pidgin.im
Date: 2009-01-30T06:39:41
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/603bb4b4fbde143586abdf5fe202fb10ee8d608e
Modified files:
libpurple/media.c pidgin/gtkmedia.c
ChangeLog:
Create the media srcs inside PurpleMedia.
-------------- next part --------------
============================================================
--- libpurple/media.c 44623d4b75f3579dda7eb7e2e5e51e2467c241fa
+++ libpurple/media.c 9386a2980ee11135fc5a28fbdc00ae2bc8e205f1
@@ -1565,6 +1565,7 @@ purple_media_add_stream_internal(PurpleM
FsParticipant *participant = NULL;
PurpleMediaStream *stream = NULL;
FsStreamDirection *direction = NULL;
+ PurpleMediaSessionType session_type;
if (!session) {
GError *err = NULL;
@@ -1621,6 +1622,12 @@ purple_media_add_stream_internal(PurpleM
g_signal_emit(media, purple_media_signals[STATE_CHANGED],
0, PURPLE_MEDIA_STATE_CHANGED_NEW,
session->id, NULL);
+
+ session_type = purple_media_from_fs(type, FS_DIRECTION_SEND);
+ purple_media_set_src(media, session->id,
+ purple_media_manager_get_element(
+ purple_media_manager_get(), session_type));
+ gst_element_set_state(session->src, GST_STATE_PLAYING);
}
if (!(participant = purple_media_add_participant(media, who))) {
============================================================
--- pidgin/gtkmedia.c 48569fe415614652ed13f93815a41e5a82b440d5
+++ pidgin/gtkmedia.c 633e9e189fd886957aa14039197b9a1c091ed21a
@@ -411,35 +411,13 @@ pidgin_media_ready_cb(PurpleMedia *media
{
GstElement *pipeline = purple_media_get_pipeline(media);
GtkWidget *send_widget = NULL, *recv_widget = NULL;
- GstElement *audiosendbin = NULL, *audiosendlevel = NULL;
- GstElement *videosendbin = NULL;
- gboolean audiorecvbool = FALSE;
- gboolean videorecvbool = FALSE;
gboolean is_initiator;
+ PurpleMediaSessionType type =
+ purple_media_get_session_type(media, sid);
- PurpleMediaSessionType type = purple_media_get_session_type(media, sid);
- if (type & PURPLE_MEDIA_AUDIO) {
- if (!audiosendbin && (type & PURPLE_MEDIA_SEND_AUDIO)) {
- purple_media_audio_init_src(&audiosendbin, &audiosendlevel);
- purple_media_set_src(media, sid, audiosendbin);
- gst_element_set_state(audiosendbin, GST_STATE_PLAYING);
- }
- if (!audiorecvbool && (type & PURPLE_MEDIA_RECV_AUDIO)) {
- audiorecvbool = TRUE;
- }
- } else if (type & PURPLE_MEDIA_VIDEO) {
- if (!videosendbin && (type & PURPLE_MEDIA_SEND_VIDEO)) {
- purple_media_video_init_src(&videosendbin);
- purple_media_set_src(media, sid, videosendbin);
- gst_element_set_state(videosendbin, GST_STATE_PLAYING);
- }
- if (!videorecvbool && (type & PURPLE_MEDIA_RECV_VIDEO)) {
- videorecvbool = TRUE;
- }
- }
-
if (gtkmedia->priv->recv_widget == NULL
- && (videorecvbool || audiorecvbool)) {
+ && type & (PURPLE_MEDIA_RECV_VIDEO |
+ PURPLE_MEDIA_RECV_AUDIO)) {
recv_widget = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
gtk_box_pack_start(GTK_BOX(gtkmedia->priv->display),
recv_widget, TRUE, TRUE, 0);
@@ -447,7 +425,8 @@ pidgin_media_ready_cb(PurpleMedia *media
} else
recv_widget = gtkmedia->priv->recv_widget;
if (gtkmedia->priv->send_widget == NULL
- && (videosendbin || audiosendbin)) {
+ && type & (PURPLE_MEDIA_SEND_VIDEO |
+ PURPLE_MEDIA_SEND_AUDIO)) {
send_widget = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
gtk_box_pack_start(GTK_BOX(gtkmedia->priv->display),
send_widget, TRUE, TRUE, 0);
@@ -455,7 +434,7 @@ pidgin_media_ready_cb(PurpleMedia *media
} else
send_widget = gtkmedia->priv->send_widget;
- if (videorecvbool) {
+ if (type & PURPLE_MEDIA_RECV_VIDEO) {
PidginMediaRealizeData *data;
GtkWidget *aspect;
GtkWidget *remote_video;
@@ -494,7 +473,7 @@ pidgin_media_ready_cb(PurpleMedia *media
gtkmedia->priv->remote_video = remote_video;
}
- if (videosendbin) {
+ if (type & PURPLE_MEDIA_SEND_VIDEO) {
PidginMediaRealizeData *data;
GtkWidget *aspect;
GtkWidget *local_video;
@@ -535,7 +514,7 @@ pidgin_media_ready_cb(PurpleMedia *media
gtkmedia->priv->local_video = local_video;
}
- if (audiorecvbool) {
+ if (type & PURPLE_MEDIA_RECV_AUDIO) {
gtkmedia->priv->recv_progress = gtk_progress_bar_new();
gtk_widget_set_size_request(gtkmedia->priv->recv_progress, 10, 70);
gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(gtkmedia->priv->recv_progress),
@@ -544,7 +523,7 @@ pidgin_media_ready_cb(PurpleMedia *media
gtkmedia->priv->recv_progress, FALSE, FALSE, 0);
gtk_widget_show(gtkmedia->priv->recv_progress);
}
- if (audiosendbin) {
+ if (type & PURPLE_MEDIA_SEND_AUDIO) {
gtkmedia->priv->send_progress = gtk_progress_bar_new();
gtk_widget_set_size_request(gtkmedia->priv->send_progress, 10, 70);
gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(gtkmedia->priv->send_progress),
@@ -557,7 +536,7 @@ pidgin_media_ready_cb(PurpleMedia *media
}
- if (audiorecvbool || audiosendbin) {
+ if (type & PURPLE_MEDIA_AUDIO) {
GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
g_signal_connect(G_OBJECT(bus), "message::element",
G_CALLBACK(level_message_cb), gtkmedia);
More information about the Commits
mailing list