Projects
Essentials
MPlayer
MPlayer-bypass_live_detection.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File MPlayer-bypass_live_detection.patch of Package MPlayer
From d3195ea13f4a9aae546ff996e53681349a1a3cdb Mon Sep 17 00:00:00 2001 From: sherpya <sherpya@netfarm.it> Date: Fri, 14 Jun 2013 05:25:38 +0200 Subject: [PATCH 25/27] mpdemux: live555 async interface From: https://raw.github.com/sherpya/mplayer-be/master/patches/mp/0025-mpdemux-live555-async-interface.patch Adjust live555 interface code for modern versions of live555. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> --- libmpdemux/demux_rtp.cpp | 51 ++++++++++++++++++++++++++++++++---------------- 2 files changed, 35 insertions(+), 22 deletions(-) --- a/configure +++ b/configure @@ -7358,58 +7358,21 @@ fi echores "$_nemesi" 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/> -#endif -#include "BasicUsageEnvironment.hh" -int main(void) { RTSPClient::createNew(*BasicUsageEnvironment::createNew(*BasicTaskScheduler::createNew()), 0, "", 0); return 0; } -EOF - - _live=no - for I in $extra_cflags "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/lib64/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do - _livelibdir=$(echo $I| sed s/-I//) - inc_tmp="-I$_livelibdir/liveMedia/include \ - -I$_livelibdir/UsageEnvironment/include \ - -I$_livelibdir/BasicUsageEnvironment/include \ - -I$_livelibdir/groupsock/include" - ld_tmp="$_livelibdir/liveMedia/libliveMedia.a \ - $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \ - $_livelibdir/UsageEnvironment/libUsageEnvironment.a \ - $_livelibdir/groupsock/libgroupsock.a \ - -lstdc++ $ld_sock" - test -e "$_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a" && - cxx_check $inc_tmp $ld_tmp && - extra_ldflags="$ld_tmp $extra_ldflags" && - extra_cxxflags="$inc_tmp" && - _live=yes && break - done - if test "$_live" != yes ; then - for ld_tmp in "-lliveMedia -lgroupsock -lBasicUsageEnvironment -lUsageEnvironment -lstdc++" "-lliveMedia_pic -lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic -lstdc++" ; do - inc_tmp="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock" - cxx_check $inc_tmp $ld_tmp && _live_dist=yes && break - done - fi +_live=yes +inc_tmp=$($_pkg_config --cflags live555) +ld_tmp=$($_pkg_config --libs live555) +if test -n "$ld_tmp" ; then +extra_ldflags="$extra_ldflags -lstdc++ $ld_tmp" +else +extra_ldflags="$_libdir/live/libliveMedia.a $_libdir/live/libUsageEnvironment.a $_libdir/live/libBasicUsageEnvironment.a $_libdir/live/libgroupsock.a -lstdc++ $extra_ldflags" fi -if test "$_live" = yes && test "$networking" = yes; then - test $_livelibdir && res_comment="using $_livelibdir" - def_live='#define CONFIG_LIVE555 1' - inputmodules="live555 $inputmodules" -elif test "$_live_dist" = yes && test "$networking" = yes; then - res_comment="using distribution version" - _live="yes" - def_live='#define CONFIG_LIVE555 1' - extra_ldflags="$extra_ldflags $ld_tmp" - extra_cxxflags="$inc_tmp" - inputmodules="live555 $inputmodules" +if test -n "$inc_tmp" ; then +extra_cxxflags="$extra_cxxflags $inc_tmp" else - _live=no - def_live='#undef CONFIG_LIVE555' - noinputmodules="live555 $noinputmodules" +extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment/ -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock $extra_cxxflags" fi +def_live='#define CONFIG_LIVE555 1' +inputmodules="live555 $inputmodules" echores "$_live" echocheck "RTMPDump Streaming Media library" --- 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: @@ -118,6 +107,19 @@ static char* openURL_sip(SIPClient* clie 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; @@ -146,13 +148,19 @@ extern "C" demuxer_t* demux_open_rtp(dem 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, @@ -236,8 +244,12 @@ extern "C" demuxer_t* demux_open_rtp(dem 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")) @@ -248,7 +260,11 @@ extern "C" demuxer_t* demux_open_rtp(dem 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 } @@ -637,7 +653,8 @@ static void teardownRTSPorSIPSession(RTP 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(); }
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.