Hello community,
here is the log from the commit of package telepathy-stream-engine for openSUSE:Factory
checked in at Thu Apr 1 17:48:43 CEST 2010.
--------
--- GNOME/telepathy-stream-engine/telepathy-stream-engine.changes 2010-02-10 20:27:20.000000000 +0100
+++ /mounts/work_src_done/STABLE/telepathy-stream-engine/telepathy-stream-engine.changes 2010-03-23 08:56:39.000000000 +0100
@@ -1,0 +2,10 @@
+Mon Mar 22 23:23:02 CET 2010 - dimstar@opensuse.org
+
+- Update to version 0.5.15:
+ + Build on amd64
+ + Track video threads like the audio threads
+ + Lower the niceness of the video threads to increase
+ interactivity
+ + Remove audio sinks when the output pads are removed
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
telepathy-stream-engine-0.5.14.tar.bz2
New:
----
telepathy-stream-engine-0.5.15.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ telepathy-stream-engine.spec ++++++
--- /var/tmp/diff_new_pack.B6rbaz/_old 2010-04-01 17:48:34.000000000 +0200
+++ /var/tmp/diff_new_pack.B6rbaz/_new 2010-04-01 17:48:34.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package telepathy-stream-engine (Version 0.5.14)
+# spec file for package telepathy-stream-engine (Version 0.5.15)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -27,7 +27,7 @@
BuildRequires: hal-devel
BuildRequires: libxslt
BuildRequires: python-xml
-Version: 0.5.14
+Version: 0.5.15
Release: 1
License: LGPLv2.1+
# runtime dependency
++++++ telepathy-stream-engine-0.5.14.tar.bz2 -> telepathy-stream-engine-0.5.15.tar.bz2 ++++++
++++ 2692 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-stream-engine-0.5.14/ChangeLog new/telepathy-stream-engine-0.5.15/ChangeLog
--- old/telepathy-stream-engine-0.5.14/ChangeLog 2010-02-05 11:20:55.000000000 +0100
+++ new/telepathy-stream-engine-0.5.15/ChangeLog 2010-03-22 18:50:37.000000000 +0100
@@ -1,3 +1,274 @@
+commit 8f75b3e854e54ea9eb059d8f72b619108a19c66a
+Author: Olivier Crête
+Date: Mon Mar 22 13:19:28 2010 -0400
+
+ version 0.5.15
+
+commit a477919df8410f6ec99f78ea0dc45433cde43ba9
+Author: Olivier Crête
+Date: Wed Feb 24 18:06:30 2010 -0500
+
+ Add property to disable automatic keyframes
+
+ Add a property to VideoControl to disable automatic keyframes.
+ Including an implementation
+
+commit 803947d96edded19141bd88a420acf7e6d8c1618
+Author: Olivier Crête
+Date: Tue Feb 23 22:03:37 2010 -0500
+
+ Set MTU from VideoControl interface
+
+commit 6defe7eedaeb6334b8524b6b16046087d1590928
+Author: Olivier Crête
+Date: Tue Feb 23 21:57:10 2010 -0500
+
+ Add MTU to VideoControl API
+
+commit 78297c2c668bd178232ab2bdbc4d197fa19efb78
+Author: Olivier Crête
+Date: Tue Feb 23 21:55:00 2010 -0500
+
+ Correctly set the bitrate from the interface
+
+commit 567b723518feac7008d11c6843c83d4e1deb2a2d
+Author: Olivier Crête
+Date: Fri Feb 19 16:33:05 2010 -0500
+
+ Connect VideoResolutionChanged signal
+
+commit 05c8978b1a739152c297fc5f9cea6c4f8d4a84eb
+Author: Olivier Crête
+Date: Mon Mar 22 13:28:17 2010 -0400
+
+ Print thread id in a safer way
+
+commit d564e6ecb490191e04948cc4f2c57fe4fa7a5e4e
+Author: Olivier Crête
+Date: Mon Mar 22 13:25:32 2010 -0400
+
+ Include unistd.h
+
+commit 18876f7eec17ecb793f5341d9c85b4c97f868c4d
+Author: Olivier Crête
+Date: Mon Mar 22 13:25:20 2010 -0400
+
+ Put header in alpha order
+
+commit a32e4e2955e9351e74f7fafc5499c09c519a7c14
+Author: Olivier Crête
+Date: Mon Mar 22 13:23:50 2010 -0400
+
+ Put own header first
+
+commit 6308edc819d457d141617c6ff7376bc6206203cd
+Author: Olivier Crête
+Date: Mon Mar 22 13:29:01 2010 -0400
+
+ videosink header requires gst.h
+
+commit 9ba343c16c5e6a422e4a0b9ef9f4eb7048be054b
+Author: Olivier Crête
+Date: Fri Mar 19 21:29:08 2010 -0400
+
+ Handle remove audio source pads
+
+commit 2a35109d71d748c4fc8787349c05cc4716fe72e2
+Author: Olivier Crête
+Date: Thu Mar 18 21:13:12 2010 -0400
+
+ Allow raising the niceness back to 0
+
+commit 64bb61680b01135ea6503d24a04c04ae41818d6a
+Author: Olivier Crête
+Date: Thu Mar 18 20:53:11 2010 -0400
+
+ Also add proxy pad parents because they will get the "linked" signal
+
+commit 95dddfb2a4074578227f91a33ea6342c25740ea1
+Author: Olivier Crête
+Date: Thu Mar 18 20:51:20 2010 -0400
+
+ Don't assume iterate_internal_links will return a valid iterator
+
+ Ghost Pads that are not connected will return NULL
+
+commit a2520f7c96982b5a67a3bf27382ae497f1f52de3
+Author: Olivier Crête
+Date: Thu Mar 18 20:16:45 2010 -0400
+
+ Add funnel once it has a pad
+
+commit 9932a7901488b43d0f7f8bd5b88a173a2284a3b7
+Author: Olivier Crête
+Date: Thu Mar 18 20:36:58 2010 -0300
+
+ Iterate the internal link of the peer when a pad is linked, don't go backwards
+
+commit a731938c888ef02b2c9132553ee3bdcb5f4a2ff9
+Author: Olivier Crête
+Date: Thu Mar 18 20:21:38 2010 -0300
+
+ Don't connect to pad-added on bins
+
+commit 581d8938ba3c69abd0bb95d5b5628abef3071276
+Author: Olivier Crête
+Date: Thu Mar 18 20:07:07 2010 -0300
+
+ Don't iterate on peer if it is already known
+
+commit 9db7f2fe4a70f0b718fadade2c64638443d15df5
+Author: Olivier Crête
+Date: Thu Mar 18 19:57:41 2010 -0300
+
+ Also track new pads dynamically added on known elements
+
+commit 86027689a756c911a6a57a2d9964e3392b4f9336
+Author: Olivier Crête
+Date: Thu Mar 18 18:28:32 2010 -0300
+
+ Don't iterate further on already known pads
+
+commit eea970535a80c6cc91c171872bfb3fc29e5551c6
+Author: Olivier Crête
+Date: Thu Mar 18 18:25:49 2010 -0300
+
+ Document the return values of add_pad_locked and insert_object_locked
+
+commit 764386e43dbef30d558f2e3d00278a497e76b15b
+Author: Olivier Crête
+Date: Thu Mar 18 18:24:25 2010 -0300
+
+ Return if the pad was already added or not
+
+commit 4d9c5e64564ef342ae7bc47f9153e1b6970952b4
+Author: Olivier Crête
+Date: Wed Mar 17 17:02:46 2010 -0300
+
+ Add empty line after declaration
+
+commit e6c6111678a8d8f8a2d8fb4c661caa4382e84b13
+Author: Olivier Crête
+Date: Wed Mar 17 17:02:01 2010 -0300
+
+ Don't re-connect the linked signal on pads that were already added
+
+commit fa59d05525b7f9ac5efe17b4a7fe3621584e5f10
+Author: Olivier Crête
+Date: Wed Mar 17 16:54:10 2010 -0300
+
+ Suffix functions that need the lock to be taken when called
+
+commit f9ecdc7dc586aba885f1c46dd910ef4ec422eeb0
+Author: Olivier Crête
+Date: Fri Mar 5 12:23:55 2010 -0500
+
+ Return error from create_preview_window if the camera couldn't be started
+
+commit 3143a5cd05b001b35cb126638dd769e530f05c82
+Author: Olivier Crête
+Date: Fri Mar 5 12:23:41 2010 -0500
+
+ Don't increase the video use count if its not used
+
+commit 3fc0a6623f8d27179a9d22ab6701ddfaa761a917
+Author: Olivier Crête
+Date: Fri Mar 5 19:52:51 2010 -0500
+
+ Remove old realtime stuff
+
+commit ca5c91b883e1995c0174feb41e6c834eff289ddd
+Author: Olivier Crête
+Date: Fri Mar 5 19:51:52 2010 -0500
+
+ Set RLIMIT_NICE to 15 so we can re-upgrade the process on cleanup
+
+commit e30033afaf0ee69a7d38273ba4afb7215e6e4a24
+Author: Olivier Crête
+Date: Fri Mar 5 19:32:35 2010 -0500
+
+ setpriority needs tid, so keep table of them
+
+commit db54e8920b2f8a626186018af864bae47704edeb
+Author: Olivier Crête
+Date: Fri Mar 5 18:41:09 2010 -0500
+
+ Execute method on entering video thread
+
+commit 109a12756afc3028702ec6815d61f20707d79812
+Author: Olivier Crête
+Date: Fri Mar 5 18:16:29 2010 -0500
+
+ Actually lower the thread priorities
+
+commit b0fd3037b7afab2de2474006a071a823b746df0d
+Author: Olivier Crête
+Date: Fri Mar 5 18:08:23 2010 -0500
+
+ Add video src to list of tracked items
+
+commit 75d2a595c5ca9241a65b91619be4010f55e5be6d
+Author: Olivier Crête
+Date: Fri Mar 5 18:06:28 2010 -0500
+
+ Listen to video sink addition
+
+commit e0309b496f18e9b3ee4a32748fa45534bbff4423
+Author: Olivier Crête
+Date: Fri Mar 5 18:05:42 2010 -0500
+
+ Make functions audio/video agnostic
+
+commit ee50a4462a98b06073f263322db9f815e83d9f4e
+Author: Olivier Crête
+Date: Fri Mar 5 18:02:05 2010 -0500
+
+ Add sink added signal on video stream
+
+commit d2390f4d81d512608d9a0d45f41e85146eb5c1e7
+Author: Olivier Crête
+Date: Tue Mar 2 17:22:55 2010 -0500
+
+ Add video struct
+
+commit 3883aba8637bfc5d10faff83defb35fb2250f110
+Author: Olivier Crête
+Date: Tue Mar 2 15:17:55 2010 -0500
+
+ Add structure to be able to re-use the element/thread matching code for video
+
+commit 94dbfb837d29735bc6b0c7638bfd265ca822516a
+Author: Olivier Crête
+Date: Fri Mar 5 19:33:11 2010 -0500
+
+ proxy pads don't seem to return an iterator
+
+commit 2868b677d66e7993e0453dc16b5d9f6fbebf058b
+Author: Olivier Crête
+Date: Fri Mar 5 19:32:55 2010 -0500
+
+ Follow linked signal in both directions
+
+commit 2a7aa3d325411ececa8fd945c8abc10d3d7534df
+Author: Olivier Crête
+Date: Tue Feb 23 19:11:38 2010 -0500
+
+ Let the ptime go up to 80 ms
+
+commit ece5573c329144a1d087fe8bc4f24435988ebbb6
+Author: Olivier Crête
+Date: Tue Feb 9 17:14:54 2010 +0000
+
+ Build on amd64
+
+ Patch by Nicolas Dufresne
+
+commit 0830238f8eae37d8c92abfebf4cb046e37f9fc88
+Author: Olivier Crête
+Date: Fri Feb 5 12:25:38 2010 +0200
+
+ version 0.5.14.1
+
commit 1980f387833862f84848c58b8682598270044030
Author: Olivier Crête
Date: Fri Feb 5 11:46:37 2010 +0200
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-stream-engine-0.5.14/NEWS new/telepathy-stream-engine-0.5.15/NEWS
--- old/telepathy-stream-engine-0.5.14/NEWS 2010-02-05 11:20:04.000000000 +0100
+++ new/telepathy-stream-engine-0.5.15/NEWS 2010-03-22 18:29:21.000000000 +0100
@@ -1,4 +1,12 @@
-telepathy-stream-engine 0.5.14 (2009-02-05)
+telepathy-stream-engine 0.5.15 (2010-03-22)
+===========================================
+
+* Build on amd64
+* Track video threads like the audio threads
+* Lower the niceness of the video threads to increase interactivity
+* Remove audio sinks when the output pads are removed
+
+telepathy-stream-engine 0.5.14 (2010-02-05)
===========================================
* Add Video Control API
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-stream-engine-0.5.14/api/Video_Control.xml new/telepathy-stream-engine-0.5.15/api/Video_Control.xml
--- old/telepathy-stream-engine-0.5.14/api/Video_Control.xml 2010-02-05 10:48:11.000000000 +0100
+++ new/telepathy-stream-engine-0.5.15/api/Video_Control.xml 2010-03-22 18:50:06.000000000 +0100
@@ -51,5 +51,26 @@
<arg type="u" name="bitrate" />
</signal>
- </interface>
+
+
+ tp:docstring
+ The Maximum Transmission Unit
+
+ </property>
+
+ <signal name="MTUChanged" tp:name-for-bindings="MTU_Changed">
+ tp:docstring
+ The Maximum Transmission Unit has changed
+
+ <arg type="u" name="mtu" />
+ </signal>
+
+
+ tp:docstring
+ Only send keyframes when manually requested
+
+ </property>
+ </interface>
</node>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-stream-engine-0.5.14/configure.ac new/telepathy-stream-engine-0.5.15/configure.ac
--- old/telepathy-stream-engine-0.5.14/configure.ac 2010-02-05 11:20:04.000000000 +0100
+++ new/telepathy-stream-engine-0.5.15/configure.ac 2010-03-22 18:50:18.000000000 +0100
@@ -9,7 +9,7 @@
m4_define([stream_engine_major_version], [0])
m4_define([stream_engine_minor_version], [5])
-m4_define([stream_engine_micro_version], [14])
+m4_define([stream_engine_micro_version], [15])
m4_define([stream_engine_nano_version], [0])
# Some magic
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-stream-engine-0.5.14/src/audiostream.c new/telepathy-stream-engine-0.5.15/src/audiostream.c
--- old/telepathy-stream-engine-0.5.14/src/audiostream.c 2009-10-21 15:54:40.000000000 +0200
+++ new/telepathy-stream-engine-0.5.15/src/audiostream.c 2010-03-22 18:29:20.000000000 +0100
@@ -22,13 +22,14 @@
#include "config.h"
#endif
+#include "audiostream.h"
+
#include
#include
#include "tp-stream-engine.h"
-#include "audiostream.h"
#include "tp-stream-engine-signals-marshal.h"
#include "util.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-stream-engine-0.5.14/src/stream-engine-main.c new/telepathy-stream-engine-0.5.15/src/stream-engine-main.c
--- old/telepathy-stream-engine-0.5.14/src/stream-engine-main.c 2010-02-05 11:20:04.000000000 +0100
+++ new/telepathy-stream-engine-0.5.15/src/stream-engine-main.c 2010-03-22 18:29:20.000000000 +0100
@@ -20,8 +20,6 @@
#include "config.h"
-#define USE_REALTIME
-#ifdef USE_REALTIME
#define _GNU_SOURCE
#include
#include
@@ -31,7 +29,6 @@
#ifndef RLIMIT_RTTIME
# define RLIMIT_RTTIME 15
#endif
-#endif /* USE_REALTIME */
#include
#include
@@ -73,40 +70,6 @@
#define WATCHDOG_BARK 5
#define WATCHDOG_BITE 30
-#ifdef USE_REALTIME_DISABLED
-#define DEF_PRIORITY_POLICY SCHED_RR
-#define PRIORITY_DELTA 1
-
-static void
-set_realtime (int policy) {
- int prio_policy;
- int prio_delta = PRIORITY_DELTA;
- struct sched_param schedp;
-
- /* set scheduling parameters, scheduler either SCHED_RR or SCHED_FIFO */
- switch (policy) {
- case 1:
- prio_policy = SCHED_RR;
- break;
- case 2:
- prio_policy = SCHED_FIFO;
- break;
- default:
- prio_policy = DEF_PRIORITY_POLICY;
- }
- memset(&schedp, 0x00, sizeof(schedp));
- schedp.sched_priority = sched_get_priority_min(prio_policy) + prio_delta;
- /* 0 pid equals to getpid() ie. current process */
- if (sched_setscheduler(0, prio_policy, &schedp) == -1) {
- perror("sched_setscheduler()");
- }
- /* nail everything to RAM, needed for realtime on systems with swap,
- * also avoids extra calls to vm subsystem */
- /*if (mlockall(MCL_CURRENT|MCL_FUTURE) == -1) {
- perror("mlockall()");
- }*/
-}
-#endif /* USE_REALTIME */
static gboolean
kill_stream_engine (gpointer data G_GNUC_UNUSED)
@@ -207,7 +170,6 @@
GOptionContext *optcontext;
GError *error = NULL;
-#ifdef USE_REALTIME
uid_t uid;
struct rlimit rl;
@@ -216,6 +178,11 @@
if (setrlimit(RLIMIT_RTPRIO, &rl) < 0)
g_warning("setrlimit rtprio: %s", strerror (errno));
+ rl.rlim_max = 15;
+ rl.rlim_cur = 15;
+ if (setrlimit(RLIMIT_NICE, &rl) < 0)
+ g_warning("setrlimit rtprio: %s", strerror (errno));
+
/* In nanoseconds */
rl.rlim_max = rl.rlim_cur = 30*1000*1000;
@@ -231,8 +198,6 @@
g_assert (geteuid() == uid);
}
-#endif
-
g_thread_init (NULL);
optcontext = g_option_context_new ("Telepathy Stream Engine");
@@ -259,30 +224,6 @@
signal (SIGUSR1, got_sigusr1);
-#ifdef USE_REALTIME_DISABLED
- {
- int rt_mode;
- char *rt_env;
-
- /* 3.11.2006: This has to be called before gst_init() in order to make
- * thread pool inherit the scheduling policy. However, this breaks gthreads,
- * so disabled for now... -jl */
- /* Here we don't yet have any media threads running, so the to-be-created
- * threads will inherit the scheduling parameters, as glib doesn't know
- * anything about that... */
- rt_env = getenv("STREAM_ENGINE_REALTIME");
- if (rt_env != NULL) {
- if ((rt_mode = atoi(rt_env))) {
- g_debug("realtime scheduling enabled");
- set_realtime(rt_mode);
- } else {
- g_debug("realtime scheduling disabled");
- }
- } else {
- g_debug("not using realtime scheduling, enable through STREAM_ENGINE_REALTIME env");
- }
- }
-#endif /* USE_REALTIME */
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-stream-engine-0.5.14/src/tp-stream-engine.c new/telepathy-stream-engine-0.5.15/src/tp-stream-engine.c
--- old/telepathy-stream-engine-0.5.14/src/tp-stream-engine.c 2010-02-05 11:20:04.000000000 +0100
+++ new/telepathy-stream-engine-0.5.15/src/tp-stream-engine.c 2010-03-22 18:29:21.000000000 +0100
@@ -22,11 +22,20 @@
#include "config.h"
#endif
+#include "tp-stream-engine.h"
+
+#define _GNU_SOURCE
+
+#include
+#include
#include
#include
#include
-#include
-#include
+#include
+#include
+#include
+#include
+#include
#include
#include
@@ -38,7 +47,6 @@
#include
#include
-#include "tp-stream-engine.h"
#include "tp-stream-engine-signals-marshal.h"
#include
@@ -59,11 +67,11 @@
#define VIDEO_JACK_UDI "/org/freedesktop/Hal/devices/platform_soc_audio_logicaldev_input"
#define VIDEO_JACK_PROPERTY "input.jack.type"
-static void
-_create_pipeline (TpStreamEngine *self);
+static void _create_pipeline (TpStreamEngine *self);
+
+static void setup_realtime_thread (pthread_t thread, pid_t tid);
+static void low_prio_thread (pthread_t thread, pid_t tid);
-static void
-setup_realtime_thread (pthread_t thread);
static void
update_video_src_caps (TpStreamEngine *self, TfStream *forcedstream,
@@ -134,6 +142,14 @@
static guint signals[LAST_SIGNAL] = {0};
+struct ObjectTrackingData {
+ TpStreamEngine *self;
+ GPtrArray *objects;
+
+ void (*setup_thread_prio) (pthread_t thread, pid_t tid);
+
+};
+
/* private structure */
struct _TpStreamEnginePrivate
{
@@ -172,17 +188,19 @@
guint bus_async_source_id;
- GPtrArray *audio_objects;
+ struct ObjectTrackingData audio_object_data;
+ struct ObjectTrackingData video_object_data;
GHashTable *object_threads;
+ GHashTable *object_tids;
DBusGConnection *system_bus_connection;
LibHalContext *libhal_ctx;
gboolean has_tv_out;
- gint camera_height;
- gint camera_width;
+ guint camera_height;
+ guint camera_width;
};
static void
@@ -195,7 +213,7 @@
g_object_set (element, "min-ptime", GST_MSECOND * 20, NULL);
if (g_object_has_property ((GObject *) element, "max-ptime"))
- g_object_set (element, "max-ptime", GST_MSECOND * 50, NULL);
+ g_object_set (element, "max-ptime", GST_MSECOND * 80, NULL);
}
static gboolean
@@ -259,11 +277,20 @@
priv->channels_by_path = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, NULL);
- priv->audio_objects = g_ptr_array_new ();
priv->object_threads = g_hash_table_new (g_direct_hash, g_direct_equal);
+ priv->object_tids = g_hash_table_new (g_direct_hash, g_direct_equal);
+
+ priv->audio_object_data.self = self;
+ priv->audio_object_data.objects = g_ptr_array_new ();
+ priv->audio_object_data.setup_thread_prio = setup_realtime_thread;
+
+ priv->video_object_data.self = self;
+ priv->video_object_data.objects = g_ptr_array_new ();
+ priv->video_object_data.setup_thread_prio = low_prio_thread;
priv->mutex = g_mutex_new ();
+
priv->notifier = fs_element_added_notifier_new ();
g_signal_connect (priv->notifier, "element-added",
G_CALLBACK (set_element_props), self);
@@ -456,8 +483,10 @@
g_mutex_free (self->priv->mutex);
- g_ptr_array_free (self->priv->audio_objects, TRUE);
+ g_ptr_array_free (self->priv->audio_object_data.objects, TRUE);
+ g_ptr_array_free (self->priv->video_object_data.objects, TRUE);
g_hash_table_destroy (self->priv->object_threads);
+ g_hash_table_destroy (self->priv->object_tids);
G_OBJECT_CLASS (tp_stream_engine_parent_class)->finalize (object);
}
@@ -801,77 +830,84 @@
}
static void
-remove_audio_object (gpointer data, GObject *where_the_obj_was)
+remove_object (gpointer data, GObject *where_the_obj_was)
{
- TpStreamEngine *self = data;
+ struct ObjectTrackingData *otd = data;
- g_mutex_lock (self->priv->mutex);
- g_ptr_array_remove (self->priv->audio_objects, where_the_obj_was);
- g_mutex_unlock (self->priv->mutex);
+ g_mutex_lock (otd->self->priv->mutex);
+ g_ptr_array_remove (otd->objects, where_the_obj_was);
+ g_mutex_unlock (otd->self->priv->mutex);
}
static void
-audio_pad_linked (GstPad *pad, GstPad *peer, TpStreamEngine *self);
+pad_linked (GstPad *pad, GstPad *peer, struct ObjectTrackingData *otd);
static gboolean
-insert_audio_object_locked (TpStreamEngine *self, gpointer object)
+insert_object_locked (struct ObjectTrackingData *otd, gpointer object)
{
guint i;
pthread_t thread;
+ pid_t tid;
- for (i = 0; i < self->priv->audio_objects->len; i++)
- if (g_ptr_array_index (self->priv->audio_objects, i) == object)
+ for (i = 0; i < otd->objects->len; i++)
+ if (g_ptr_array_index (otd->objects, i) == object)
return FALSE;
- g_ptr_array_add (self->priv->audio_objects, object);
- g_object_weak_ref (G_OBJECT (object), remove_audio_object, self);
+ g_ptr_array_add (otd->objects, object);
+ g_object_weak_ref (G_OBJECT (object), remove_object, otd);
- thread = GPOINTER_TO_UINT (g_hash_table_lookup (self->priv->object_threads,
- object));
- if (thread)
- setup_realtime_thread (thread);
+
+ thread = GPOINTER_TO_UINT (
+ g_hash_table_lookup (otd->self->priv->object_threads, object));
+ tid = GPOINTER_TO_UINT (
+ g_hash_table_lookup (otd->self->priv->object_tids, object));
+
+ if (thread && tid)
+ otd->setup_thread_prio (thread, tid);
return TRUE;
}
static void
-add_audio_pad (TpStreamEngine *self, GstPad *pad)
+add_pad (struct ObjectTrackingData *otd, GstPad *pad)
{
GstElement *el;
- insert_audio_object_locked (self, pad);
+ insert_object_locked (otd, pad);
el = gst_pad_get_parent_element (pad);
if (el)
{
- insert_audio_object_locked (self, el);
+ insert_object_locked (otd, el);
gst_object_unref (el);
}
- if (gst_pad_get_direction(pad) == GST_PAD_SINK)
- g_signal_connect (pad, "linked", G_CALLBACK (audio_pad_linked), self);
+ g_signal_connect (pad, "linked", G_CALLBACK (pad_linked), otd);
}
static void
-audio_pad_iter (gpointer data, gpointer user_data)
+pad_iter (gpointer data, gpointer user_data)
{
- TpStreamEngine *self = user_data;
+ struct ObjectTrackingData *otd = user_data;
GstPad *pad = data;
GstPad *peerpad = gst_pad_get_peer (pad);
- add_audio_pad (self, pad);
+ add_pad (otd, pad);
if (peerpad)
{
GstIterator *iter;
- add_audio_pad (self, peerpad);
+ add_pad (otd, peerpad);
iter = gst_pad_iterate_internal_links (peerpad);
- while (gst_iterator_foreach (iter, audio_pad_iter, self) ==
- GST_ITERATOR_RESYNC)
- gst_iterator_resync (iter);
- gst_iterator_free (iter);
+ if (iter)
+ {
+ while (gst_iterator_foreach (iter, pad_iter, otd) ==
+ GST_ITERATOR_RESYNC)
+ gst_iterator_resync (iter);
+ gst_iterator_free (iter);
+ }
gst_object_unref (peerpad);
}
@@ -880,30 +916,30 @@
}
static void
-audio_pad_linked (GstPad *pad, GstPad *peer, TpStreamEngine *self)
+pad_linked (GstPad *pad, GstPad *peer, struct ObjectTrackingData *otd)
{
GstIterator *iter = gst_pad_iterate_internal_links (pad);
- g_mutex_lock (self->priv->mutex);
- add_audio_pad (self, peer);
+ g_mutex_lock (otd->self->priv->mutex);
+ add_pad (otd, peer);
- while (gst_iterator_foreach (iter, audio_pad_iter, self) ==
+ while (gst_iterator_foreach (iter, pad_iter, otd) ==
GST_ITERATOR_RESYNC)
gst_iterator_resync (iter);
gst_iterator_free (iter);
- g_mutex_unlock (self->priv->mutex);
+ g_mutex_unlock (otd->self->priv->mutex);
}
static void
-audio_pad_internal_links_iter (gpointer data, gpointer user_data)
+pad_internal_links_iter (gpointer data, gpointer user_data)
{
- TpStreamEngine *self = user_data;
+ struct ObjectTrackingData *otd = user_data;
GstPad *pad = data;
GstIterator *iter;
iter = gst_pad_iterate_internal_links (pad);
- while (gst_iterator_foreach (iter, audio_pad_iter, self) ==
+ while (gst_iterator_foreach (iter, pad_iter, otd) ==
GST_ITERATOR_RESYNC)
gst_iterator_resync (iter);
gst_iterator_free (iter);
@@ -912,25 +948,25 @@
}
static void
-audio_sink_added_cb (TpStreamEngineAudioStream *audiostream,
- GstElement *sink, TpStreamEngine *self)
+sink_added_cb (gpointer stream,
+ GstElement *sink, struct ObjectTrackingData *otd)
{
GstIterator *iter;
- g_mutex_lock (self->priv->mutex);
+ g_mutex_lock (otd->self->priv->mutex);
iter = gst_element_iterate_sink_pads (sink);
- while (gst_iterator_foreach (iter, audio_pad_iter, self) ==
+ while (gst_iterator_foreach (iter, pad_iter, otd) ==
GST_ITERATOR_RESYNC)
gst_iterator_resync (iter);
gst_iterator_resync (iter);
- while (gst_iterator_foreach (iter, audio_pad_internal_links_iter, self) ==
+ while (gst_iterator_foreach (iter, pad_internal_links_iter, otd) ==
GST_ITERATOR_RESYNC)
gst_iterator_resync (iter);
gst_iterator_free (iter);
- g_mutex_unlock (self->priv->mutex);
+ g_mutex_unlock (otd->self->priv->mutex);
}
static void
@@ -999,12 +1035,13 @@
g_mutex_lock (self->priv->mutex);
iter = gst_element_iterate_src_pads (src);
- while (gst_iterator_foreach (iter, audio_pad_iter, self) ==
- GST_ITERATOR_RESYNC)
+ while (gst_iterator_foreach (iter, pad_iter,
+ &self->priv->audio_object_data) == GST_ITERATOR_RESYNC)
gst_iterator_resync (iter);
gst_iterator_resync (iter);
- while (gst_iterator_foreach (iter, audio_pad_internal_links_iter, self) ==
+ while (gst_iterator_foreach (iter, pad_internal_links_iter,
+ &self->priv->audio_object_data) ==
GST_ITERATOR_RESYNC)
gst_iterator_resync (iter);
gst_iterator_free (iter);
@@ -1013,7 +1050,8 @@
gst_object_unref (src);
g_signal_connect (audiostream, "sink-added",
- G_CALLBACK (audio_sink_added_cb), self);
+ G_CALLBACK (sink_added_cb),
+ &self->priv->audio_object_data);
}
else if (media_type == TP_MEDIA_STREAM_TYPE_VIDEO)
{
@@ -1043,6 +1081,10 @@
videostream);
g_mutex_unlock (self->priv->mutex);
+ g_signal_connect (videostream, "sink-added",
+ G_CALLBACK (sink_added_cb),
+ &self->priv->video_object_data);
+
g_signal_connect (videostream, "receiving",
G_CALLBACK (stream_receiving), self);
g_signal_connect (videostream, "size-changed",
@@ -1347,7 +1389,7 @@
}
static void
-setup_realtime_thread (pthread_t thread)
+setup_realtime_thread (pthread_t thread, pid_t tid)
{
struct sched_param param;
gchar buf[128];
@@ -1361,19 +1403,36 @@
}
static void
+low_prio_thread (pthread_t thread, pid_t tid)
+{
+ if (setpriority (PRIO_PROCESS, tid, 15))
+ g_warning ("Could not lower thread priority to 15: %d %s", tid, strerror (errno));
+}
+
+static void
enter_thread (TpStreamEngine *self, GstObject *src, GstElement *owner)
{
pthread_t thread = pthread_self ();
+ pid_t tid = syscall (__NR_gettid);
guint i;
g_mutex_lock (self->priv->mutex);
g_hash_table_insert (self->priv->object_threads, src,
GINT_TO_POINTER (thread));
+ g_hash_table_insert (self->priv->object_tids, src,
+ GINT_TO_POINTER (tid));
+
+ for (i = 0; i < self->priv->audio_object_data.objects->len; i++)
+ if (g_ptr_array_index (self->priv->audio_object_data.objects, i) == src)
+ {
+ self->priv->audio_object_data.setup_thread_prio (thread, tid);
+ break;
+ }
- for (i = 0; i < self->priv->audio_objects->len; i++)
- if (g_ptr_array_index (self->priv->audio_objects, i) == src)
+ for (i = 0; i < self->priv->video_object_data.objects->len; i++)
+ if (g_ptr_array_index (self->priv->video_object_data.objects, i) == src)
{
- setup_realtime_thread (thread);
+ self->priv->video_object_data.setup_thread_prio (thread, tid);
break;
}
@@ -1384,12 +1443,17 @@
leave_thread (TpStreamEngine *self, GstObject *src, GstElement *owner)
{
pthread_t thread = pthread_self ();
+ pid_t tid = syscall (__NR_gettid);
struct sched_param param;
g_mutex_lock (self->priv->mutex);
g_hash_table_remove (self->priv->object_threads, src);
+ g_hash_table_remove (self->priv->object_tids, src);
g_mutex_unlock (self->priv->mutex);
+ if (setpriority (PRIO_PROCESS, tid, 0))
+ g_warning ("Could not restore thread priority to 0: %lX %s", (unsigned long int) thread, strerror (errno));
+
param.sched_priority = 0;
pthread_setschedparam (thread, SCHED_OTHER, ¶m);
}
@@ -1488,6 +1552,7 @@
GstElement *capsfilter;
const gchar *elem;
gboolean ret;
+ GstIterator *iter;
if ((elem = getenv ("FS_VIDEO_SRC")) || (elem = getenv ("FS_VIDEOSRC")))
{
@@ -1525,6 +1590,18 @@
gst_element_set_locked_state (videosrc, TRUE);
+ iter = gst_element_iterate_src_pads (videosrc);
+ while (gst_iterator_foreach (iter, pad_iter,
+ &self->priv->video_object_data) == GST_ITERATOR_RESYNC)
+ gst_iterator_resync (iter);
+
+ gst_iterator_resync (iter);
+ while (gst_iterator_foreach (iter, pad_internal_links_iter,
+ &self->priv->video_object_data) ==
+ GST_ITERATOR_RESYNC)
+ gst_iterator_resync (iter);
+ gst_iterator_free (iter);
+
tee = gst_element_factory_make ("tee", "videotee");
g_assert (tee);
if (!gst_bin_add (GST_BIN (priv->pipeline), tee))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-stream-engine-0.5.14/src/util.c new/telepathy-stream-engine-0.5.15/src/util.c
--- old/telepathy-stream-engine-0.5.14/src/util.c 2008-08-02 03:31:05.000000000 +0200
+++ new/telepathy-stream-engine-0.5.15/src/util.c 2010-03-22 18:29:20.000000000 +0100
@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "util.h"
#include
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-stream-engine-0.5.14/src/videosink.c new/telepathy-stream-engine-0.5.15/src/videosink.c
--- old/telepathy-stream-engine-0.5.14/src/videosink.c 2010-02-03 09:17:39.000000000 +0100
+++ new/telepathy-stream-engine-0.5.15/src/videosink.c 2010-03-22 18:29:20.000000000 +0100
@@ -22,6 +22,8 @@
#include "config.h"
#endif
+#include "videosink.h"
+
#include
#include
@@ -34,7 +36,6 @@
#include
#include "tp-stream-engine-signals-marshal.h"
-#include "videosink.h"
#include "util.h"
#define DEFAULT_XV_DEVICE "0"
@@ -145,8 +146,9 @@
}
else
{
- g_debug("%s:%s: Last diff: %lld diffs: %f Instant fps: %f"
- " averaged over 1s: %f\n", GST_DEBUG_PAD_NAME (pad), diff,
+ g_debug("%s:%s: Last diff: %" G_GINT64_FORMAT " diffs: %f"
+ " Instant fps: %f averaged over 1s: %f\n",
+ GST_DEBUG_PAD_NAME (pad), diff,
diffs, (1.0/diffs), self->priv->framerate);
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-stream-engine-0.5.14/src/videosink.h new/telepathy-stream-engine-0.5.15/src/videosink.h
--- old/telepathy-stream-engine-0.5.14/src/videosink.h 2009-01-13 00:08:07.000000000 +0100
+++ new/telepathy-stream-engine-0.5.15/src/videosink.h 2010-03-22 18:29:20.000000000 +0100
@@ -1,7 +1,7 @@
#ifndef __TP_STREAM_ENGINE_VIDEO_SINK_H__
#define __TP_STREAM_ENGINE_VIDEO_SINK_H__
-#include
+#include
G_BEGIN_DECLS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-stream-engine-0.5.14/src/videostream.c new/telepathy-stream-engine-0.5.15/src/videostream.c
--- old/telepathy-stream-engine-0.5.14/src/videostream.c 2010-02-05 11:20:04.000000000 +0100
+++ new/telepathy-stream-engine-0.5.15/src/videostream.c 2010-03-22 18:50:06.000000000 +0100
@@ -22,6 +22,8 @@
#include "config.h"
#endif
+#include "videostream.h"
+
#include
#include
@@ -29,8 +31,8 @@
#include
#include
+#include
-#include "videostream.h"
#include "tp-stream-engine.h"
#include "tp-stream-engine-signals-marshal.h"
#include "util.h"
@@ -60,7 +62,11 @@
GstElement *sink;
- guint bitrate;
+ gboolean manual_keyframes;
+ volatile gint bitrate;
+ volatile gint mtu;
+
+ FsElementAddedNotifier *notifier;
GMutex *mutex;
@@ -77,6 +83,7 @@
{
RECEIVING,
RESOLUTION_CHANGED,
+ SINK_ADDED_SIGNAL,
SIGNAL_COUNT
};
@@ -112,6 +119,11 @@
GValue *value,
GParamSpec *pspec);
+static void _element_added (FsElementAddedNotifier *notifier,
+ GstBin *conference,
+ GstElement *element,
+ TpStreamEngineVideoStream *self);
+
static void
tp_stream_engine_video_stream_init (TpStreamEngineVideoStream *self)
@@ -125,6 +137,11 @@
self->priv = priv;
self->priv->mutex = g_mutex_new ();
+
+ self->priv->notifier = fs_element_added_notifier_new ();
+
+ g_signal_connect (self->priv->notifier, "element-added",
+ G_CALLBACK (_element_added), self);
}
@@ -223,63 +240,111 @@
NULL)));
}
-static void
-iterate_pads_and_set_bitrate (gpointer data, gpointer user_data)
+static gboolean
+is_in_send_codecbin (GstElement *element, GstElement *ultimate_parent,
+ guint session_id)
{
- GstPad *pad = data;
- GstPad *peer = NULL;
- TpStreamEngineVideoStream *self = user_data;
- GstElement *peerparent = NULL;
+ gint tmp_session_id, tmp_codec_id;
+ gchar *name;
+ gboolean valid = FALSE;
+ GstElement *parent;
+ gboolean rv;
- peer = gst_pad_get_peer (pad);
- if (!peer)
- goto out;
+ if (element == ultimate_parent)
+ return FALSE;
- peerparent = gst_pad_get_parent_element (pad);
+ name = gst_element_get_name (element);
+ if (name && sscanf (name, "send_%d_%d", &tmp_session_id, &tmp_codec_id) == 2)
+ valid = TRUE;
+ g_free (name);
- if (!peerparent)
- goto out;
+ if (valid && session_id == tmp_session_id)
+ return TRUE;
- if (g_object_has_property (G_OBJECT (peerparent), "bitrate"))
- {
- DEBUG (self, "Setting bitrate %u on %s",
- self->priv->bitrate, GST_OBJECT_NAME (peerparent));
- g_object_set (peerparent, "bitrate", self->priv->bitrate, NULL);
- }
- else
+ parent = (GstElement*) gst_element_get_parent (element);
+ if (!parent)
+ return FALSE;
+ rv = is_in_send_codecbin (parent, ultimate_parent, session_id);
+
+ gst_object_unref (parent);
+
+ return rv;
+}
+
+static void
+_element_added (FsElementAddedNotifier *notifier,
+ GstBin *bin, GstElement *element, TpStreamEngineVideoStream *self)
+{
+ gint bitrate = g_atomic_int_get (&self->priv->bitrate);
+ gint mtu = g_atomic_int_get (&self->priv->mtu);
+
+ if (G_UNLIKELY (
+ (bitrate && g_object_has_property (G_OBJECT (element), "bitrate")) ||
+ (mtu && g_object_has_property (G_OBJECT (element), "mtu")) ||
+ (self->priv->manual_keyframes &&
+ g_object_has_property (G_OBJECT (element), "keyframe-interval"))))
{
- GstIterator *iter = gst_pad_iterate_internal_links (peer);
+ FsSession *fssession;
+ GstElement *conf;
+ guint id;
+
+ g_object_get (self->priv->stream, "farsight-session", &fssession,
+ "farsight-conference", &conf, NULL);
- while (
- gst_iterator_foreach (iter, iterate_pads_and_set_bitrate, self) ==
- GST_ITERATOR_RESYNC)
- gst_iterator_resync (iter);
+ g_object_get (fssession, "id", &id, NULL);
- gst_iterator_free (iter);
+ if (is_in_send_codecbin (element, GST_ELEMENT (conf), id))
+ {
+ if (bitrate && g_object_has_property (G_OBJECT (element), "bitrate"))
+ {
+ g_object_set (element, "bitrate", bitrate, NULL);
+ DEBUG (self, "Set bitrate %u on encoder", bitrate);
+ }
+ if (mtu && g_object_has_property (G_OBJECT (element), "mtu"))
+ {
+ g_object_set (element, "mtu", mtu, NULL);
+ DEBUG (self, "Set MTU %u on payloader", mtu);
+ }
+ if (self->priv->manual_keyframes &&
+ g_object_has_property (G_OBJECT (element), "keyframe-interval"))
+ {
+ g_object_set (element, "keyframe-interval", 600, NULL);
+ DEBUG (self, "Disabled automatic keyframes");
+ }
+ }
+
+ g_object_unref (fssession);
}
+}
+
+static void
+tp_stream_engine_video_stream_update_element_properties (
+ TpStreamEngineVideoStream *self)
+{
+ GstBin *conf;
- out:
- if (peerparent)
- gst_object_unref (peerparent);
- if (peer)
- gst_object_unref (peer);
- gst_object_unref (pad);
+ g_object_get (self->priv->stream, "farsight-conference", &conf, NULL);
+
+ fs_element_added_notifier_remove (self->priv->notifier, conf);
+
+ if (g_atomic_int_get (&self->priv->bitrate) ||
+ g_atomic_int_get (&self->priv->mtu) ||
+ self->priv->manual_keyframes)
+ fs_element_added_notifier_add (self->priv->notifier, conf);
+
+ gst_object_unref (conf);
}
static void
tp_stream_engine_video_stream_set_bitrate (TpStreamEngineVideoStream *self,
guint bitrate)
{
- if (self->priv->bitrate == bitrate)
+ if (g_atomic_int_get (&self->priv->bitrate) == bitrate)
return;
- self->priv->bitrate = bitrate;
-
- if (bitrate == 0)
- return;
+ g_atomic_int_set (&self->priv->bitrate, bitrate);
- if (self->priv->pad)
- iterate_pads_and_set_bitrate (gst_object_ref (self->priv->pad), self);
+ tp_stream_engine_video_stream_update_element_properties (self);
}
@@ -295,11 +360,43 @@
}
static void
-video_resolution_changed (TpProxy *proxy, guint width, guint height,
- gpointer user_data, GObject *weak_object)
+tp_stream_engine_video_stream_set_mtu (TpStreamEngineVideoStream *self,
+ guint mtu)
+{
+ if (g_atomic_int_get (&self->priv->mtu) == mtu)
+ return;
+
+ g_atomic_int_set (&self->priv->mtu, mtu);
+
+ tp_stream_engine_video_stream_update_element_properties (self);
+}
+
+
+static void
+mtu_changed (TpProxy *proxy, guint mtu, gpointer user_data,
+ GObject *weak_object)
{
TpStreamEngineVideoStream *self = TP_STREAM_ENGINE_VIDEO_STREAM (weak_object);
+ DEBUG (self, "MTUChanged: %u", mtu);
+
+ tp_stream_engine_video_stream_set_mtu (self, mtu);
+}
+
+static void
+tp_stream_engine_video_stream_set_manual_keyframes (
+ TpStreamEngineVideoStream *self)
+{
+ self->priv->manual_keyframes = TRUE;
+
+ tp_stream_engine_video_stream_update_element_properties (self);
+}
+
+
+static void
+video_resolution_changed_real (TpStreamEngineVideoStream *self,
+ guint width, guint height)
+{
DEBUG (self, "ResolutionChanged: %u x %u", width, height);
if (width != self->width || height != self->height)
@@ -309,12 +406,42 @@
g_signal_emit (self, signals[RESOLUTION_CHANGED], 0);
}
}
+
+static void
+video_resolution_changed (TpProxy *proxy, const GValueArray *arg_resolution,
+ gpointer user_data, GObject *weak_object)
+{
+ TpStreamEngineVideoStream *self = TP_STREAM_ENGINE_VIDEO_STREAM (weak_object);
+ GValue *val_width, *val_height;
+
+ if (arg_resolution->n_values != 2)
+ {
+ DEBUG (self,
+ "VideoResolutionChanged argument does not have two members");
+ return;
+ }
+
+ val_width = g_value_array_get_nth (arg_resolution, 0);
+ val_height = g_value_array_get_nth (arg_resolution, 1);
+
+ if (!G_VALUE_HOLDS_UINT (val_width) || !G_VALUE_HOLDS_UINT (val_height))
+ {
+ DEBUG (self, "VideoResolutionChanged arguments are not uints");
+ return;
+ }
+
+ video_resolution_changed_real (self, g_value_get_uint (val_width),
+ g_value_get_uint (val_height));
+
+}
static void
videocontrol_get_all_properties_cb (TpProxy *proxy, GHashTable *out_properties,
const GError *error, gpointer user_data, GObject *weak_object)
{
TpStreamEngineVideoStream *self = TP_STREAM_ENGINE_VIDEO_STREAM (weak_object);
guint32 bitrate;
+ guint32 mtu;
+ gboolean manual_keyframes;
gboolean valid;
GValueArray *array;
@@ -328,6 +455,13 @@
tp_stream_engine_video_stream_set_bitrate (self, bitrate);
}
+ mtu = tp_asv_get_uint32 (out_properties, "MTU", &valid);
+ if (valid)
+ {
+ DEBUG (self, "Got initial mtu: %u", mtu);
+ tp_stream_engine_video_stream_set_mtu (self, mtu);
+ }
+
array = tp_asv_get_boxed (out_properties, "VideoResolution",
STREAM_ENGINE_STRUCT_TYPE_VIDEO_RESOLUTION);
if (array)
@@ -337,8 +471,17 @@
DEBUG (self, "Got initial resolution: %u x %u", width, height);
- video_resolution_changed (proxy, width, height, user_data, weak_object);
+ video_resolution_changed_real (self, width, height);
}
+
+ manual_keyframes = tp_asv_get_boolean (out_properties, "ManualKeyframes", &valid);
+ if (valid)
+ {
+ DEBUG (self, "Keyframes will only come when manually requested");
+ self->priv->manual_keyframes = TRUE;
+ tp_stream_engine_video_stream_update_element_properties (self);
+ }
+
}
@@ -351,6 +494,7 @@
TpStreamEngineVideoStream *self = NULL;
GstPad *sinkpad;
TpProxy *proxy;
+ GError *error = NULL;
obj = G_OBJECT_CLASS (tp_stream_engine_video_stream_parent_class)->constructor (type, n_props, props);
@@ -360,8 +504,14 @@
tp_proxy_add_interface_by_id (proxy,
STREAM_ENGINE_IFACE_QUARK_STREAMHANDLER_INTERFACE_VIDEO_CONTROL);
- stream_engine_cli_streamhandler_interface_video_control_connect_to_request_keyframe (proxy, request_keyframe, NULL, NULL, G_OBJECT (self), NULL);
- stream_engine_cli_streamhandler_interface_video_control_connect_to_bitrate_changed (proxy, bitrate_changed, NULL, NULL, G_OBJECT (self), NULL);
+ stream_engine_cli_streamhandler_interface_video_control_connect_to_request_keyframe (proxy, request_keyframe, NULL, NULL, G_OBJECT (self), &error);
+ g_assert (error == NULL);
+ stream_engine_cli_streamhandler_interface_video_control_connect_to_bitrate_changed (proxy, bitrate_changed, NULL, NULL, G_OBJECT (self), &error);
+ g_assert (error == NULL);
+ stream_engine_cli_streamhandler_interface_video_control_connect_to_mtu_changed (proxy, mtu_changed, NULL, NULL, G_OBJECT (self), &error);
+ g_assert (error == NULL);
+ stream_engine_cli_streamhandler_interface_video_control_connect_to_video_resolution_changed (proxy, video_resolution_changed, NULL, NULL, G_OBJECT (self), &error);
+ g_assert (error == NULL);
tp_cli_dbus_properties_call_get_all (proxy, -1,
STREAM_ENGINE_IFACE_STREAMHANDLER_INTERFACE_VIDEO_CONTROL,
videocontrol_get_all_properties_cb, NULL, NULL, G_OBJECT (self));
@@ -404,6 +554,12 @@
self->priv->src_pad_added_handler_id = 0;
}
+ if (self->priv->notifier)
+ {
+ g_object_unref (self->priv->notifier);
+ self->priv->notifier = NULL;
+ }
+
g_mutex_lock (self->priv->mutex);
if (self->priv->receiving_probe_id)
{
@@ -566,6 +722,14 @@
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
+
+ signals[SINK_ADDED_SIGNAL] = g_signal_new ("sink-added",
+ G_OBJECT_CLASS_TYPE (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1, G_TYPE_OBJECT);
}
@@ -627,6 +791,7 @@
g_warning ("Could not start sink");
return;
}
+
}
funnel = gst_bin_get_by_name (GST_BIN (self->priv->sink), "funnel");
@@ -640,6 +805,7 @@
goto error;
}
+ g_signal_emit (self, signals[SINK_ADDED_SIGNAL], 0, funnel);
sinkpad = gst_element_get_request_pad (funnel, "sink%d");
if (!sinkpad)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org