diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2011-10-11 14:55:29 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2011-10-11 16:14:07 -0400 |
commit | e33572c56e93ad1a0f644047f30fc23ab5e01372 (patch) | |
tree | 2347860066da7fa0c91df89dc86a06e4e012236c /examples | |
parent | 449a53f65146448d70f761cc1257171702c83db4 (diff) | |
download | farstream-e33572c56e93ad1a0f644047f30fc23ab5e01372.tar.gz |
Rename Farsight 2 to Farstream
Diffstat (limited to 'examples')
-rw-r--r-- | examples/commandline/Makefile.am | 6 | ||||
-rw-r--r-- | examples/commandline/simple-call-shm.c | 20 | ||||
-rw-r--r-- | examples/commandline/simple-call.c | 20 | ||||
-rw-r--r-- | examples/gui/Makefile.am | 12 | ||||
-rw-r--r-- | examples/gui/fs-gui-dtmf.ui (renamed from examples/gui/fs2-gui-dtmf.ui) | 0 | ||||
-rw-r--r-- | examples/gui/fs-gui-main-window.ui (renamed from examples/gui/fs2-gui-main-window.ui) | 0 | ||||
-rw-r--r-- | examples/gui/fs-gui-startup.ui (renamed from examples/gui/fs2-gui-startup.ui) | 0 | ||||
-rwxr-xr-x | examples/gui/fs-gui.py (renamed from examples/gui/fs2-gui.py) | 92 | ||||
-rw-r--r-- | examples/gui/fs_gui_net.py (renamed from examples/gui/fs2_gui_net.py) | 20 |
9 files changed, 85 insertions, 85 deletions
diff --git a/examples/commandline/Makefile.am b/examples/commandline/Makefile.am index f1cfa994..bc31a4e2 100644 --- a/examples/commandline/Makefile.am +++ b/examples/commandline/Makefile.am @@ -4,13 +4,13 @@ noinst_PROGRAMS = simple-call simple-call-shm AM_CFLAGS = \ -I$(top_srcdir)/gst/fsrtpconference/ \ - $(FS2_INTERNAL_CFLAGS) \ - $(FS2_CFLAGS) \ + $(FS_INTERNAL_CFLAGS) \ + $(FS_CFLAGS) \ $(GST_CFLAGS) \ $(CFLAGS) LDADD = \ - $(top_builddir)/gst-libs/gst/farsight/libgstfarsight-0.10.la \ + $(top_builddir)/gst-libs/gst/farstream/libgstfarstream-0.10.la \ $(GST_LIBS) diff --git a/examples/commandline/simple-call-shm.c b/examples/commandline/simple-call-shm.c index 325c912d..f9fcb517 100644 --- a/examples/commandline/simple-call-shm.c +++ b/examples/commandline/simple-call-shm.c @@ -1,4 +1,4 @@ -/* Farsight 2 ad-hoc test for simple calls. +/* Farstream ad-hoc test for simple calls. * * Copyright (C) 2008 Collabora, Nokia * @author: Olivier Crete <olivier.crete@collabora.co.uk> @@ -21,7 +21,7 @@ /* * WARNING: * - * Do not use this as an example of a proper use of farsight, it assumes that + * Do not use this as an example of a proper use of farstream, it assumes that * both ends have the EXACT same list of codec installed in the EXACT same order */ @@ -34,7 +34,7 @@ #include <gio/gunixinputstream.h> #include <gst/gst.h> -#include <gst/farsight/fs-conference.h> +#include <gst/farstream/fs-conference.h> #define DEFAULT_AUDIOSRC "audiotestsrc is-live=1 ! audio/x-raw-int, rate=8000 ! identity" #define DEFAULT_AUDIOSINK "alsasink sync=false async=false" @@ -201,7 +201,7 @@ async_bus_cb (GstBus *bus, GstMessage *message, gpointer user_data) { const GstStructure *s = gst_message_get_structure (message); - if (gst_structure_has_name (s, "farsight-error")) + if (gst_structure_has_name (s, "farstream-error")) { gint error; const gchar *error_msg = gst_structure_get_string (s, "error-msg"); @@ -211,13 +211,13 @@ async_bus_cb (GstBus *bus, GstMessage *message, gpointer user_data) &error)); if (FS_ERROR_IS_FATAL (error)) - g_error ("Farsight fatal error: %d %s %s", error, error_msg, + g_error ("Farstream fatal error: %d %s %s", error, error_msg, debug_msg); else - g_warning ("Farsight non-fatal error: %d %s %s", error, error_msg, + g_warning ("Farstream non-fatal error: %d %s %s", error, error_msg, debug_msg); } - else if (gst_structure_has_name (s, "farsight-new-local-candidate")) + else if (gst_structure_has_name (s, "farstream-new-local-candidate")) { const GValue *val = gst_structure_get_value (s, "candidate"); FsCandidate *cand = NULL; @@ -229,11 +229,11 @@ async_bus_cb (GstBus *bus, GstMessage *message, gpointer user_data) g_print ("You can press ENTER on the other side\n"); } else if (gst_structure_has_name (s, - "farsight-local-candidates-prepared")) + "farstream-local-candidates-prepared")) { g_print ("Local candidates prepared\n"); } - else if (gst_structure_has_name (s, "farsight-recv-codecs-changed")) + else if (gst_structure_has_name (s, "farstream-recv-codecs-changed")) { const GValue *val = gst_structure_get_value (s, "codecs"); GList *codecs = NULL; @@ -250,7 +250,7 @@ async_bus_cb (GstBus *bus, GstMessage *message, gpointer user_data) g_free (tmp); } } - else if (gst_structure_has_name (s, "farsight-send-codec-changed")) + else if (gst_structure_has_name (s, "farstream-send-codec-changed")) { const GValue *val = gst_structure_get_value (s, "codec"); FsCodec *codec = NULL; diff --git a/examples/commandline/simple-call.c b/examples/commandline/simple-call.c index 2d6a154a..50a408d3 100644 --- a/examples/commandline/simple-call.c +++ b/examples/commandline/simple-call.c @@ -1,4 +1,4 @@ -/* Farsight 2 ad-hoc test for simple calls. +/* Farstream ad-hoc test for simple calls. * * Copyright (C) 2008 Collabora, Nokia * @author: Olivier Crete <olivier.crete@collabora.co.uk> @@ -21,7 +21,7 @@ /* * WARNING: * - * Do not use this as an example of a proper use of farsight, it assumes that + * Do not use this as an example of a proper use of farstream, it assumes that * both ends have the EXACT same list of codec installed in the EXACT same order */ @@ -30,7 +30,7 @@ #include <glib.h> #include <gst/gst.h> -#include <gst/farsight/fs-conference.h> +#include <gst/farstream/fs-conference.h> #define DEFAULT_AUDIOSRC "alsasrc" #define DEFAULT_AUDIOSINK "audioconvert ! audioresample ! audioconvert ! alsasink" @@ -202,7 +202,7 @@ async_bus_cb (GstBus *bus, GstMessage *message, gpointer user_data) { const GstStructure *s = gst_message_get_structure (message); - if (gst_structure_has_name (s, "farsight-error")) + if (gst_structure_has_name (s, "farstream-error")) { gint error; const gchar *error_msg = gst_structure_get_string (s, "error-msg"); @@ -211,11 +211,11 @@ async_bus_cb (GstBus *bus, GstMessage *message, gpointer user_data) &error)); if (FS_ERROR_IS_FATAL (error)) - g_error ("Farsight fatal error: %d %s", error, error_msg); + g_error ("Farstream fatal error: %d %s", error, error_msg); else - g_warning ("Farsight non-fatal error: %d %s", error, error_msg); + g_warning ("Farstream non-fatal error: %d %s", error, error_msg); } - else if (gst_structure_has_name (s, "farsight-new-local-candidate")) + else if (gst_structure_has_name (s, "farstream-new-local-candidate")) { const GValue *val = gst_structure_get_value (s, "candidate"); FsCandidate *cand = NULL; @@ -226,11 +226,11 @@ async_bus_cb (GstBus *bus, GstMessage *message, gpointer user_data) g_print ("New candidate: %s %d\n", cand->ip, cand->port); } else if (gst_structure_has_name (s, - "farsight-local-candidates-prepared")) + "farstream-local-candidates-prepared")) { g_print ("Local candidates prepared\n"); } - else if (gst_structure_has_name (s, "farsight-recv-codecs-changed")) + else if (gst_structure_has_name (s, "farstream-recv-codecs-changed")) { const GValue *val = gst_structure_get_value (s, "codecs"); GList *codecs = NULL; @@ -247,7 +247,7 @@ async_bus_cb (GstBus *bus, GstMessage *message, gpointer user_data) g_free (tmp); } } - else if (gst_structure_has_name (s, "farsight-send-codec-changed")) + else if (gst_structure_has_name (s, "farstream-send-codec-changed")) { const GValue *val = gst_structure_get_value (s, "codec"); FsCodec *codec = NULL; diff --git a/examples/gui/Makefile.am b/examples/gui/Makefile.am index d2256e84..80397ef2 100644 --- a/examples/gui/Makefile.am +++ b/examples/gui/Makefile.am @@ -1,7 +1,7 @@ EXTRA_DIST = \ - fs2_gui_net.py \ - fs2-gui.py \ - fs2-gui-dtmf.ui \ - fs2-gui-main-window.ui \ - fs2-gui-startup.ui \ - fs2-gui-user-frame.ui + fs_gui_net.py \ + fs-gui.py \ + fs-gui-dtmf.ui \ + fs-gui-main-window.ui \ + fs-gui-startup.ui \ + fs-gui-user-frame.ui diff --git a/examples/gui/fs2-gui-dtmf.ui b/examples/gui/fs-gui-dtmf.ui index 9235964e..9235964e 100644 --- a/examples/gui/fs2-gui-dtmf.ui +++ b/examples/gui/fs-gui-dtmf.ui diff --git a/examples/gui/fs2-gui-main-window.ui b/examples/gui/fs-gui-main-window.ui index 977c478c..977c478c 100644 --- a/examples/gui/fs2-gui-main-window.ui +++ b/examples/gui/fs-gui-main-window.ui diff --git a/examples/gui/fs2-gui-startup.ui b/examples/gui/fs-gui-startup.ui index a03c3fde..a03c3fde 100644 --- a/examples/gui/fs2-gui-startup.ui +++ b/examples/gui/fs-gui-startup.ui diff --git a/examples/gui/fs2-gui.py b/examples/gui/fs-gui.py index c6bda853..610592bb 100755 --- a/examples/gui/fs2-gui.py +++ b/examples/gui/fs-gui.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Farsight 2 demo GUI program +# Farstream demo GUI program # # Copyright (C) 2007 Collabora, Nokia # @author: Olivier Crete <olivier.crete@collabora.co.uk> @@ -44,18 +44,18 @@ try: except ImportError, e: raise SystemExit("Gst-Python couldn't be found! (%s)" % (e[0])) try: - import farsight + import farstream except: try: sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python', '.libs')) - import farsight + import farstream except ImportError, e: - raise SystemExit("Farsight couldn't be found! (%s)" % (e[0])) + raise SystemExit("Farstream couldn't be found! (%s)" % (e[0])) -from fs2_gui_net import FsUIClient, FsUIListener, FsUIServer +from fs_gui_net import FsUIClient, FsUIListener, FsUIServer CAMERA=False @@ -67,7 +67,7 @@ SERVER=2 TRANSMITTER="nice" -builderprefix = os.path.join(os.path.dirname(__file__),"fs2-gui-") +builderprefix = os.path.join(os.path.dirname(__file__),"fs-gui-") def make_video_sink(pipeline, xid, name, async=True): @@ -101,7 +101,7 @@ class FsUIPipeline: def __init__(self, elementname="fsrtpconference"): self.pipeline = gst.Pipeline() signal.signal(signal.SIGINT, self.int_handler) - self.notifier = farsight.ElementAddedNotifier() + self.notifier = farstream.ElementAddedNotifier() self.notifier.connect("element-added", self.element_added_cb) self.notifier.add(self.pipeline) self.pipeline.get_bus().set_sync_handler(self.sync_handler) @@ -146,33 +146,33 @@ class FsUIPipeline: elif message.type == gst.MESSAGE_ELEMENT: if message.structure.has_name("dtmf-event"): print "dtmf-event: %d" % message.structure["number"] - elif message.structure.has_name("farsight-local-candidates-prepared"): + elif message.structure.has_name("farstream-local-candidates-prepared"): message.structure["stream"].uistream.local_candidates_prepared() - elif message.structure.has_name("farsight-new-local-candidate"): + elif message.structure.has_name("farstream-new-local-candidate"): message.structure["stream"].uistream.new_local_candidate( message.structure["candidate"]) - elif message.structure.has_name("farsight-codecs-changed"): + elif message.structure.has_name("farstream-codecs-changed"): print message.src.get_name(), ": ", message.structure.get_name() message.structure["session"].uisession.codecs_changed() if AUDIO and message.structure["session"] == self.audiosession.fssession: self.codecs_changed_audio() if VIDEO and message.structure["session"] == self.videosession.fssession: self.codecs_changed_video() - elif message.structure.has_name("farsight-send-codec-changed"): + elif message.structure.has_name("farstream-send-codec-changed"): print message.src.get_name(), ": ", message.structure.get_name() print "send codec changed: " + message.structure["codec"].to_string() if AUDIO and message.structure["session"] == self.audiosession.fssession: self.codecs_changed_audio() if VIDEO and message.structure["session"] == self.videosession.fssession: self.codecs_changed_video() - elif message.structure.has_name("farsight-recv-codecs-changed"): + elif message.structure.has_name("farstream-recv-codecs-changed"): print message.src.get_name(), ": ", message.structure.get_name() message.structure["stream"].uistream.recv_codecs_changed( \ message.structure["codecs"]) - elif message.structure.has_name("farsight-error"): + elif message.structure.has_name("farstream-error"): print "Async error ("+ str(message.structure["error-no"]) +"): " + message.structure["error-msg"] else: print message.src.get_name(), ": ", message.structure.get_name() @@ -302,7 +302,7 @@ class FsUIVideoSource(FsUISource): "A Video source" def get_type(self): - return farsight.MEDIA_TYPE_VIDEO + return farstream.MEDIA_TYPE_VIDEO def make_source(self): bin = gst.Bin() @@ -338,7 +338,7 @@ class FsUIAudioSource(FsUISource): "An audio source" def get_type(self): - return farsight.MEDIA_TYPE_AUDIO + return farstream.MEDIA_TYPE_AUDIO def make_source(self): source = gst.element_factory_make("audiotestsrc") @@ -359,48 +359,48 @@ class FsUISession: self.streams = [] self.fssession = conference.new_session(source.get_type()) self.fssession.uisession = self - if source.get_type() == farsight.MEDIA_TYPE_VIDEO: + if source.get_type() == farstream.MEDIA_TYPE_VIDEO: # We prefer H263-1998 because we know it works # We don't know if the others do work # We know H264 doesn't work for now or anything else # that needs to send config data self.fssession.set_codec_preferences( [ \ - farsight.Codec(farsight.CODEC_ID_ANY, + farstream.Codec(farstream.CODEC_ID_ANY, "THEORA", - farsight.MEDIA_TYPE_VIDEO, + farstream.MEDIA_TYPE_VIDEO, 90000), - farsight.Codec(farsight.CODEC_ID_ANY, + farstream.Codec(farstream.CODEC_ID_ANY, "H264", - farsight.MEDIA_TYPE_VIDEO, + farstream.MEDIA_TYPE_VIDEO, 0), - farsight.Codec(farsight.CODEC_ID_ANY, + farstream.Codec(farstream.CODEC_ID_ANY, "H263-1998", - farsight.MEDIA_TYPE_VIDEO, + farstream.MEDIA_TYPE_VIDEO, 0), - farsight.Codec(farsight.CODEC_ID_ANY, + farstream.Codec(farstream.CODEC_ID_ANY, "H263", - farsight.MEDIA_TYPE_VIDEO, + farstream.MEDIA_TYPE_VIDEO, 0) ]) - elif source.get_type() == farsight.MEDIA_TYPE_AUDIO: + elif source.get_type() == farstream.MEDIA_TYPE_AUDIO: self.fssession.set_codec_preferences( [ \ - farsight.Codec(farsight.CODEC_ID_ANY, + farstream.Codec(farstream.CODEC_ID_ANY, "PCMA", - farsight.MEDIA_TYPE_AUDIO, + farstream.MEDIA_TYPE_AUDIO, 0), - farsight.Codec(farsight.CODEC_ID_ANY, + farstream.Codec(farstream.CODEC_ID_ANY, "PCMU", - farsight.MEDIA_TYPE_AUDIO, + farstream.MEDIA_TYPE_AUDIO, 0), # The gst speexenc element breaks timestamps - farsight.Codec(farsight.CODEC_ID_DISABLE, + farstream.Codec(farstream.CODEC_ID_DISABLE, "SPEEX", - farsight.MEDIA_TYPE_AUDIO, + farstream.MEDIA_TYPE_AUDIO, 16000), # Sadly, vorbis is not currently compatible with live streaming :-( - farsight.Codec(farsight.CODEC_ID_DISABLE, + farstream.Codec(farstream.CODEC_ID_DISABLE, "VORBIS", - farsight.MEDIA_TYPE_AUDIO, + farstream.MEDIA_TYPE_AUDIO, 0), ]) @@ -418,14 +418,14 @@ class FsUISession: transmitter_params = {} # If its video, we start at port 9078, to make it more easy # to differentiate it in a tcpdump log - if self.source.get_type() == farsight.MEDIA_TYPE_VIDEO and \ + if self.source.get_type() == farstream.MEDIA_TYPE_VIDEO and \ TRANSMITTER == "rawudp": - cand = farsight.Candidate() - cand.component_id = farsight.COMPONENT_RTP + cand = farstream.Candidate() + cand.component_id = farstream.COMPONENT_RTP cand.port = 9078 transmitter_params["preferred-local-candidates"] = [cand] realstream = self.fssession.new_stream(participant.fsparticipant, - farsight.DIRECTION_BOTH, + farstream.DIRECTION_BOTH, TRANSMITTER, transmitter_params) stream = FsUIStream(id, self, participant, realstream) self.streams.append(weakref.ref(stream, self.__stream_finalized)) @@ -433,9 +433,9 @@ class FsUISession: def dtmf_start(self, event, method): if (event == "*"): - event = farsight.DTMF_EVENT_STAR + event = farstream.DTMF_EVENT_STAR elif (event == "#"): - event = farsight.DTMF_EVENT_POUND + event = farstream.DTMF_EVENT_POUND else: event = int(event) self.fssession.start_telephony_event(event, 2, method) @@ -490,7 +490,7 @@ class FsUIStream: self.connect.send_candidate(self.participant.id, self.id, candidate) def __src_pad_added(self, stream, pad, codec): "Callback from FsStream" - if self.session.source.get_type() == farsight.MEDIA_TYPE_VIDEO: + if self.session.source.get_type() == farstream.MEDIA_TYPE_VIDEO: self.participant.link_video_sink(pad) else: self.participant.pipeline.link_audio_sink(pad) @@ -586,13 +586,13 @@ class FsUIParticipant: self.make_widget() self.streams = {} if VIDEO: - self.streams[int(farsight.MEDIA_TYPE_VIDEO)] = \ + self.streams[int(farstream.MEDIA_TYPE_VIDEO)] = \ pipeline.videosession.new_stream( - int(farsight.MEDIA_TYPE_VIDEO), self) + int(farstream.MEDIA_TYPE_VIDEO), self) if AUDIO: - self.streams[int(farsight.MEDIA_TYPE_AUDIO)] = \ + self.streams[int(farstream.MEDIA_TYPE_AUDIO)] = \ pipeline.audiosession.new_stream( - int(farsight.MEDIA_TYPE_AUDIO), self) + int(farstream.MEDIA_TYPE_AUDIO), self) def candidate(self, media, candidate): "Callback for the network object." @@ -861,9 +861,9 @@ class FsMainUI: def dtmf_start(self, button): if (self.dtmf_builder.get_object("dtmf_as_event").get_active()): - self.dtmf_last_method = farsight.DTMF_METHOD_RTP_RFC4733 + self.dtmf_last_method = farstream.DTMF_METHOD_RTP_RFC4733 elif (self.dtmf_builder.get_object("dtmf_as_sound").get_active()): - self.dtmf_last_method = farsight.DTMF_METHOD_IN_BAND + self.dtmf_last_method = farstream.DTMF_METHOD_IN_BAND else: print "Invalid DTMF Method" return diff --git a/examples/gui/fs2_gui_net.py b/examples/gui/fs_gui_net.py index c834d77a..028d1bae 100644 --- a/examples/gui/fs2_gui_net.py +++ b/examples/gui/fs_gui_net.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Farsight 2 simple network signalling library for the demo GUI +# Farstream simple network signalling library for the demo GUI # # Copyright (C) 2007 Collabora, Nokia # @author: Olivier Crete <olivier.crete@collabora.co.uk> @@ -21,7 +21,7 @@ # # -# This is the signalling code used by fs2-gui.py +# This is the signalling code used by fs-gui.py # import sys, os, pwd, os.path @@ -38,11 +38,11 @@ except ImportError, e: raise SystemExit("Gst-Python couldn't be found! (%s)" % (e[0])) try: - import farsight + import farstream except: sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python', '.libs')) - import farsight + import farstream import gobject @@ -181,7 +181,7 @@ class FsUIConnect: candidate.password)) def __candidate_from_string(self, string): - candidate = farsight.Candidate() + candidate = farstream.Candidate() (candidate.foundation, component_id, candidate.ip, @@ -222,7 +222,7 @@ class FsUIConnect: for substring in string.split("\n"): (start,end) = substring.split("|") (id, encoding_name, media_type, clock_rate, channels) = start.split(" ") - codec = farsight.Codec(int(id), encoding_name, int(media_type), + codec = farstream.Codec(int(id), encoding_name, int(media_type), int(clock_rate)) codec.channels = int(channels) if len(end): @@ -381,7 +381,7 @@ if __name__ == "__main__": self.pid = pid self.id = id self.connect = connect - candidate = farsight.Candidate() + candidate = farstream.Candidate() candidate.component_id = 1 connect.send_candidate(self.pid, self.id, candidate) connect.send_candidates_done(self.pid, self.id) @@ -392,7 +392,7 @@ if __name__ == "__main__": def codecs(self, codecs): if self.connect.myid != 1: self.connect.send_codecs(1, self.id, - [farsight.Codec(self.connect.myid, + [farstream.Codec(self.connect.myid, "codec-name", self.pid, self.id)]) @@ -400,12 +400,12 @@ if __name__ == "__main__": def send_local_codecs(self): print "Send local codecs to %s for media %s" % (self.pid, self.id) self.connect.send_codecs(self.pid, self.id, - [farsight.Codec(self.connect.myid, + [farstream.Codec(self.connect.myid, "local_codec", self.pid, self.id)]) def get_codecs(self): - return [farsight.Codec(self.connect.myid, + return [farstream.Codec(self.connect.myid, "nego-codecs", self.pid, self.id)] |