[packages/mplayer] - old live patch replaced by live555-async patch from mplayer ml (port to async RTSPClient interface

qboosh qboosh at pld-linux.org
Sun Nov 3 13:24:15 CET 2013


commit 1ee1ef52f14ba977481004fa63b11d57ca2736b7
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Nov 3 13:24:21 2013 +0100

    - old live patch replaced by live555-async patch from mplayer ml (port to async RTSPClient interface)

 mplayer-live.patch          |  10 ----
 mplayer-live555-async.patch | 110 ++++++++++++++++++++++++++++++++++++++++++++
 mplayer.spec                |   6 +--
 3 files changed, 112 insertions(+), 14 deletions(-)
---
diff --git a/mplayer.spec b/mplayer.spec
index ee4aa86..6d5a5a3 100644
--- a/mplayer.spec
+++ b/mplayer.spec
@@ -146,7 +146,7 @@ Patch11:	%{name}-altivec.patch
 Patch12:	%{name}-check-byteswap.patch
 Patch13:	%{name}-visibility-hidden-fix.patch
 Patch14:	%{name}-ffmpeg.patch
-Patch15:	%{name}-live.patch
+Patch15:	%{name}-live555-async.patch
 Patch16:	%{name}-libcdio.patch
 Patch17:	%{name}-gsm.patch
 Patch18:	%{name}-openjpeg.patch
@@ -234,9 +234,7 @@ BuildRequires:	libvpx-devel
 %{?with_x264:BuildRequires:	libx264-devel >= 0.1.3}
 BuildRequires:	libxslt-progs
 %{?with_lirc:BuildRequires:	lirc-devel}
-%{?with_live:BuildRequires:	live-devel >= 2:2006.03.03}
-# "synchronous" RTSPClient interface removed finally in 2013.05.30
-%{?with_live:BuildRequires:	live-devel < 2:2013.05.30}
+%{?with_live:BuildRequires:	live-devel >= 2:2011.01.10}
 %{?with_lzo:BuildRequires:	lzo-devel >= 2.0}
 %{?with_nas:BuildRequires:	nas-devel}
 BuildRequires:	ncurses-devel
diff --git a/mplayer-live.patch b/mplayer-live.patch
deleted file mode 100644
index 7ce9fba..0000000
--- a/mplayer-live.patch
+++ /dev/null
@@ -1,10 +0,0 @@
-+++ MPlayer-1.1/configure.orig	2013-01-28 21:25:18.354520436 +0100
---- MPlayer-1.1/configure	2013-01-30 20:06:23.334350773 +0100
-@@ -6686,6 +6686,7 @@
- echocheck "LIVE555 Streaming Media libraries"
- if test "$_live" = auto  && test "$networking" = yes ; then
-   cat > $TMPCPP << EOF
-+#define RTSPCLIENT_SYNCHRONOUS_INTERFACE 1
- #include <liveMedia.hh>
- #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
- #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
diff --git a/mplayer-live555-async.patch b/mplayer-live555-async.patch
new file mode 100644
index 0000000..b847d78
--- /dev/null
+++ b/mplayer-live555-async.patch
@@ -0,0 +1,110 @@
+origin: https://patches.libav.org/patch/39102/raw/
+diff --git a/libmpdemux/demux_rtp.cpp b/libmpdemux/demux_rtp.cpp
+index 018327c..4fa7efe 100644
+--- a/libmpdemux/demux_rtp.cpp
++++ b/libmpdemux/demux_rtp.cpp
+@@ -19,8 +19,6 @@
+  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+  */
+ 
+-#define RTSPCLIENT_SYNCHRONOUS_INTERFACE 1
+-
+ extern "C" {
+ // on MinGW, we must include windows.h before the things it conflicts
+ #ifdef __MINGW32__    // with.  they are each protected from
+@@ -94,15 +92,6 @@ struct RTPState {
+ 
+ extern "C" char* network_username;
+ extern "C" char* network_password;
+-static char* openURL_rtsp(RTSPClient* client, char const* url) {
+-  // If we were given a user name (and optional password), then use them:
+-  if (network_username != NULL) {
+-    char const* password = network_password == NULL ? "" : network_password;
+-    return client->describeWithPassword(url, network_username, password);
+-  } else {
+-    return client->describeURL(url);
+-  }
+-}
+ 
+ static char* openURL_sip(SIPClient* client, char const* url) {
+   // If we were given a user name (and optional password), then use them:
+@@ -126,6 +115,19 @@ int rtsp_transport_http = 0;
+ extern AVCodecContext *avcctx;
+ #endif
+ 
++static char fWatchVariableForSyncInterface;
++static char* fResultString;
++static int fResultCode;
++
++static void responseHandlerForSyncInterface(RTSPClient* rtspClient, int responseCode, char* responseString) {
++  // Set result values:
++  fResultCode = responseCode;
++  fResultString = responseString;
++
++  // Signal a break from the event loop (thereby returning from the blocking command):
++  fWatchVariableForSyncInterface = ~0;
++}
++
+ extern "C" int audio_id, video_id, dvdsub_id;
+ extern "C" demuxer_t* demux_open_rtp(demuxer_t* demuxer) {
+   Boolean success = False;
+@@ -154,13 +156,19 @@ extern "C" demuxer_t* demux_open_rtp(demuxer_t* demuxer) {
+ 	  rtsp_transport_http = demuxer->stream->streaming_ctrl->url->port;
+ 	  rtsp_transport_tcp = 1;
+ 	}
+-	rtspClient = RTSPClient::createNew(*env, verbose, "MPlayer", rtsp_transport_http);
++	rtspClient = RTSPClient::createNew(*env, url, verbose, "MPlayer", rtsp_transport_http);
+ 	if (rtspClient == NULL) {
+ 	  fprintf(stderr, "Failed to create RTSP client: %s\n",
+ 		  env->getResultMsg());
+ 	  break;
+ 	}
+-	sdpDescription = openURL_rtsp(rtspClient, url);
++	fWatchVariableForSyncInterface = 0;
++	rtspClient->sendDescribeCommand(responseHandlerForSyncInterface);
++	env->taskScheduler().doEventLoop(&fWatchVariableForSyncInterface);
++	if (fResultCode == 0)
++	    sdpDescription = fResultString;
++	else
++	    delete[] fResultString;
+       } else { // SIP
+ 	unsigned char desiredAudioType = 0; // PCMU (use 3 for GSM)
+ 	sipClient = SIPClient::createNew(*env, desiredAudioType, NULL,
+@@ -244,8 +252,12 @@ extern "C" demuxer_t* demux_open_rtp(demuxer_t* demuxer) {
+ 
+ 	if (rtspClient != NULL) {
+ 	  // Issue a RTSP "SETUP" command on the chosen subsession:
+-	  if (!rtspClient->setupMediaSubsession(*subsession, False,
+-						rtsp_transport_tcp)) break;
++	  fWatchVariableForSyncInterface = 0;
++	  rtspClient->sendSetupCommand(*subsession, responseHandlerForSyncInterface, False, rtsp_transport_tcp);
++	  env->taskScheduler().doEventLoop(&fWatchVariableForSyncInterface);
++	  delete[] fResultString;
++	  if (fResultCode != 0) break;
++
+ 	  if (!strcmp(subsession->mediumName(), "audio"))
+ 	    audiofound = 1;
+ 	  if (!strcmp(subsession->mediumName(), "video"))
+@@ -256,7 +268,11 @@ extern "C" demuxer_t* demux_open_rtp(demuxer_t* demuxer) {
+ 
+     if (rtspClient != NULL) {
+       // Issue a RTSP aggregate "PLAY" command on the whole session:
+-      if (!rtspClient->playMediaSession(*mediaSession)) break;
++      fWatchVariableForSyncInterface = 0;
++      rtspClient->sendPlayCommand(*mediaSession, responseHandlerForSyncInterface);
++      env->taskScheduler().doEventLoop(&fWatchVariableForSyncInterface);
++      delete[] fResultString;
++      if (fResultCode != 0) break;
+     } else if (sipClient != NULL) {
+       sipClient->sendACK(); // to start the stream flowing
+     }
+@@ -645,7 +661,8 @@ static void teardownRTSPorSIPSession(RTPState* rtpState) {
+   MediaSession* mediaSession = rtpState->mediaSession;
+   if (mediaSession == NULL) return;
+   if (rtpState->rtspClient != NULL) {
+-    rtpState->rtspClient->teardownMediaSession(*mediaSession);
++    fWatchVariableForSyncInterface = 0;
++    rtpState->rtspClient->sendTeardownCommand(*mediaSession, NULL);
+   } else if (rtpState->sipClient != NULL) {
+     rtpState->sipClient->sendBYE();
+   }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mplayer.git/commitdiff/1ee1ef52f14ba977481004fa63b11d57ca2736b7



More information about the pld-cvs-commit mailing list