diff --git a/linden/indra/cmake/00-Common.cmake b/linden/indra/cmake/00-Common.cmake index c41591f..4f00876 100644 --- a/linden/indra/cmake/00-Common.cmake +++ b/linden/indra/cmake/00-Common.cmake @@ -202,10 +202,11 @@ else (STANDALONE) ELFIO atk-1.0 glib-2.0 - gstreamer-0.10 +# gstreamer-0.10 gtk-2.0 llfreetype2 pango-1.0 + xine ) endif (STANDALONE) diff --git a/linden/indra/cmake/LLMedia.cmake b/linden/indra/cmake/LLMedia.cmake index b7bf11c..c9bc51a 100644 --- a/linden/indra/cmake/LLMedia.cmake +++ b/linden/indra/cmake/LLMedia.cmake @@ -1,7 +1,8 @@ # -*- cmake -*- -include(GStreamer) +#include(GStreamer) include(QuickTime) +include(Xine) set(LLMEDIA_INCLUDE_DIRS ${LIBS_OPEN_DIR}/llmedia @@ -9,7 +10,8 @@ set(LLMEDIA_INCLUDE_DIRS set(LLMEDIA_LIBRARIES llmedia - ${GSTREAMER_LIBRARIES} - ${GSTREAMER_PLUGINS_BASE_LIBRARIES} +# ${GSTREAMER_LIBRARIES} +# ${GSTREAMER_PLUGINS_BASE_LIBRARIES} ${QUICKTIME_LIBRARY} + ${XINE_LIBRARY} ) diff --git a/linden/indra/cmake/Xine.cmake b/linden/indra/cmake/Xine.cmake new file mode 100644 index 0000000..d323ed4 --- /dev/null +++ b/linden/indra/cmake/Xine.cmake @@ -0,0 +1,34 @@ +# -*- cmake -*- + + + +FIND_PATH(XINE_INCLUDE_DIR xine.h + $ENV{XINE_DIR}/include + $ENV{XINE_DIR} + /usr/local/include + /usr/include + + +) + +FIND_LIBRARY(XINE_LIBRARY + NAMES xine + PATHS + $ENV{XINE_DIR}/lib + $ENV{XINE_DIR} + /usr/local/lib + /usr/lib + +) + +SET(XINE_FOUND "NO") +IF(XINE_LIBRARY AND XINE_INCLUDE_DIR) + SET(XINE_FOUND "YES") + set(XINE ON CACHE BOOL "Build with Xine streaming media support.") +ENDIF(XINE_LIBRARY AND XINE_INCLUDE_DIR) + + +if (XINE) + add_definitions(-DLL_XINE_ENABLED=1) + message(STATUS "Building with Xine support") +endif (XINE) \ No newline at end of file diff --git a/linden/indra/llaudio/CMakeLists.txt b/linden/indra/llaudio/CMakeLists.txt index aa15a9d..bb97277 100644 --- a/linden/indra/llaudio/CMakeLists.txt +++ b/linden/indra/llaudio/CMakeLists.txt @@ -24,7 +24,6 @@ include_directories( ${OPENAL_LIB_INCLUDE_DIRS} ${FREEAULT_LIB_INCLUDE_DIRS} ${LLMEDIA_INCLUDE_DIRS} - ${GSTREAMER_INCLUDE_DIRS} ) set(llaudio_SOURCE_FILES diff --git a/linden/indra/llaudio/audioengine.cpp b/linden/indra/llaudio/audioengine.cpp index da9bcba..6f99e12 100644 --- a/linden/indra/llaudio/audioengine.cpp +++ b/linden/indra/llaudio/audioengine.cpp @@ -230,7 +230,10 @@ void LLAudioEngine::pauseInternetStream(int pause) { if(! mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_PAUSE)) { - LL_INFOS("AudioEngine") << "attempting to pause stream failed!" << llendl; + if(! mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_STOP)) + { + LL_INFOS("AudioEngine") << "attempting to pause stream failed!" << llendl; + } } } else { if(! mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_START)) diff --git a/linden/indra/llmedia/CMakeLists.txt b/linden/indra/llmedia/CMakeLists.txt index 026afc1..00d1710 100644 --- a/linden/indra/llmedia/CMakeLists.txt +++ b/linden/indra/llmedia/CMakeLists.txt @@ -3,7 +3,7 @@ project(llmedia) include(00-Common) -include(LLAudio) +#include(LLAudio) include(LLCommon) include(LLImage) include(LLMath) @@ -13,9 +13,10 @@ include(LLWindow) include(Mozlib) include_directories( - ${GSTREAMER_INCLUDE_DIRS} - ${GSTREAMER_PLUGINS_BASE_INCLUDE_DIRS} - ${LLAUDIO_INCLUDE_DIRS} +# ${GSTREAMER_INCLUDE_DIRS} +# ${GSTREAMER_PLUGINS_BASE_INCLUDE_DIRS} + ${XINE_INCLUDE_DIRS} +# ${LLAUDIO_INCLUDE_DIRS} ${LLCOMMON_INCLUDE_DIRS} ${LLIMAGE_INCLUDE_DIRS} ${LLMATH_INCLUDE_DIRS} @@ -29,9 +30,11 @@ set(llmedia_SOURCE_FILES llmediaimplexample2.cpp llmediaimplfactory.cpp llmediamanager.cpp - llmediaimplgstreamer.cpp - llmediaimplgstreamer_syms.cpp - llmediaimplgstreamervidplug.cpp +# llmediaimplgstreamer.cpp +# llmediaimplgstreamer_syms.cpp +# llmediaimplgstreamervidplug.cpp + impmediaimplxine.cpp + ) set(llmedia_HEADER_FILES @@ -46,18 +49,20 @@ set(llmedia_HEADER_FILES llmediaimplregister.h llmediamanager.h llmediaobserver.h - llmediaimplgstreamer.h - llmediaimplgstreamervidplug.h - llmediaimplgstreamer_syms.h +# llmediaimplgstreamer.h +# llmediaimplgstreamervidplug.h +# llmediaimplgstreamer_syms.h + impmediaimplxine.h ) # Work around a bad interaction between broken gstreamer headers and # g++ 4.3's increased strictness. - if (${CXX_VERSION} MATCHES "4.[23]") - set_source_files_properties(llmediaimplgstreamervidplug.cpp PROPERTIES - COMPILE_FLAGS -Wno-error=write-strings) - endif (${CXX_VERSION} MATCHES "4.[23]") +# if (${CXX_VERSION} MATCHES "4.[23]") +# set_source_files_properties(llmediaimplgstreamervidplug.cpp PROPERTIES +# COMPILE_FLAGS -Wno-error=write-strings) +# endif (${CXX_VERSION} MATCHES "4.[23]") + if (MOZLIB) list(APPEND llmedia_SOURCE_FILES llmediaimplllmozlib.cpp) @@ -65,9 +70,12 @@ if (MOZLIB) list(APPEND llmedia_HEADER_FILES llmediaimplllmozlib.h) endif (MOZLIB) + if (QUICKTIME) list(APPEND llmedia_SOURCE_FILES llmediaimplquicktime.cpp) list(APPEND llmedia_HEADER_FILES llmediaimplquicktime.h) + + # We use a bunch of deprecated system APIs. if (DARWIN) diff --git a/linden/indra/llmedia/impmediaimplxine.cpp b/linden/indra/llmedia/impmediaimplxine.cpp new file mode 100644 index 0000000..3ba7432 --- /dev/null +++ b/linden/indra/llmedia/impmediaimplxine.cpp @@ -0,0 +1,574 @@ +/** + * @file impmediaimplgxine.cpp + * @author Armin Weatherwax + * @brief implementation that supports various media through Xine. + * + * $LicenseInfo:firstyear=2009$ + * + * Copyright (c) 2009 Armin Weatherwax + * + * + * + * Imprudence Viewer Source Code + * The source code in this file ("Source Code") is provided to you + * under the terms of the GNU General Public License, version 2.0 + * ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in + * this distribution, or online at + * http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef XINE_ENABLE_EXPERIMENTAL_FEATURES +#define XINE_ENABLE_EXPERIMENTAL_FEATURES +#endif + +#include "impmediaimplxine.h" +#include "llerror.h" +#include "llmediamanager.h" +#include "llmediaimplregister.h" +//TODO: get rid of unused headers +extern "C" { + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +} + + + + +static LLMediaImplRegister sLLMediaImplXineReg( "LLMediaImplXine", new LLMediaImplXineMaker() ); + + + +LLMediaImplXineMaker::LLMediaImplXineMaker() +{ + // Register to handle the scheme + mSchema.push_back( "rtsp" ); + mSchema.push_back( "rtmp" ); + + // Register to handle the category + mMimeTypeCategories.push_back( "video" ); + mMimeTypeCategories.push_back( "audio" ); +} + +/////////////////////////////////////////////////////////////////////////////// +// +LLMediaImplXine::LLMediaImplXine() : + + mediaData ( NULL ), + mTextureFormatPrimary ( LL_MEDIA_RGBA), // according to stream + mTextureFormatType ( LL_MEDIA_UNSIGNED_INT_8_8_8_8_REV ), //according to GL + /* cheat sheet 4a5ea9 + const int LL_MEDIA_UNSIGNED_BYTE = 0x1401; + const int LL_MEDIA_RGB = 0x1907; + const int LL_MEDIA_RGBA = 0x1908; + const int LL_MEDIA_RGB8 = 0x8051; + const int LL_MEDIA_UNSIGNED_INT_8_8_8_8 = 0x8035; + const int LL_MEDIA_UNSIGNED_INT_8_8_8_8_REV = 0x8367; + const int LL_MEDIA_BGR = 0x80E0; + const int LL_MEDIA_BGRA = 0x80E1; + */ + + xine ( 0 ), + stream ( 0 ), + vo_port ( 0 ), + ao_port ( 0 ), + m_event_queue ( 0 ), + + m_hasvideo ( 0 ), + m_hasaudio ( 0 ), + m_playing (false), + m_framepending (false), + m_spamme (false) + + + +{ + char configfile[2048]; + llinfos << " constr LLMediaImplXine()" << llendl; + xine = xine_new(); + xine_config_load(xine, configfile); + xine_init(xine); + + + // opening xine output ports + + vo_port = xine_open_video_driver(xine,NULL, XINE_VISUAL_TYPE_NONE, NULL); //standard + ao_port = xine_open_audio_driver(xine , NULL, NULL);//standard + + //vo_port = xine_new_framegrab_video_port(xine);// experimental + //ao_port = xine_new_framegrab_audio_port(xine);// framegrab audio ... not /me though + + // open a xine stream connected to these ports + stream = xine_stream_new(xine, ao_port, vo_port); + + // hook our event handler into the streams events + + m_event_queue = xine_event_new_queue(stream); + xine_event_create_listener_thread(m_event_queue, event_listener, this); +} + +/////////////////////////////////////////////////////////////////////////////// +// +LLMediaImplXine::~LLMediaImplXine() +{ + llinfos << " ~LLMediaImplXine()" << llendl; + if (m_framepending) + xine_free_video_frame (vo_port,m_next_video_frame); //or freeze + if (mediaData) + { + delete[] mediaData; + mediaData = NULL; + } + xine_close(stream); + xine_dispose(stream); + xine_event_dispose_queue(m_event_queue); + xine_close_video_driver(xine,vo_port); + xine_close_audio_driver(xine,ao_port); + xine_exit(xine); + + +} + +// virtual +int LLMediaImplXine::getTextureFormatPrimary() const +{ + return mTextureFormatPrimary; +} + +// virtual +int LLMediaImplXine::getTextureFormatType() const +{ + return mTextureFormatType; +} + + +//////////////////////////////////////////////////////////////////////////////// +// (static) super-uninitialization - called once at application closedown +bool LLMediaImplXine::closedown() +{ + llinfos << "LLMediaImplXine::closedown()" << llendl; + return true; +} + +//////////////////////////////////////////////////////////////////////////////// +// (static) super-initialization - called once at application startup +bool LLMediaImplXine::startup( LLMediaManagerData* init_data ) +{ + llinfos << "LLMediaImplXine::startup()" << llendl; + return true; +} + + +//////////////////////////////////////////////////////////////////////////////// +// (static) private +void LLMediaImplXine::event_listener(void *user_data, const xine_event_t *event) + +{ + LLMediaImplXine *impl = (LLMediaImplXine*)user_data; + + switch(event->type) { + case XINE_EVENT_UI_PLAYBACK_FINISHED: + llinfos << "Xine::event_listener XINE_EVENT_UI_PLAYBACK_FINISHED:" << llendl; + impl->addCommand(LLMediaBase::COMMAND_STOP); + break; + + case XINE_EVENT_PROGRESS: + { + xine_progress_data_t *pevent = (xine_progress_data_t *) event->data; + llinfos << "Xine::event_listener XINE_EVENT_PROGRESS: " << pevent->description + << " " << pevent->percent <<" "<< llendl; + + } + break; + + + } +} + +//////////////////////////////////////////////////////////////////////////////// +// private +bool LLMediaImplXine::load() +{ + int ret=0; + + llinfos << "LLMediaImplXine::load()"< width; + int h = m_next_video_frame -> height; + if (w != getMediaWidth() || h != getMediaHeight()) + { + m_spamme = true; + setMediaSize(w, h); //if you don't you don't get media + } + if (m_spamme) + { + m_spamme = false; + int cs = m_next_video_frame -> colorspace; + llinfos << "colorspace: " << cs << llendl; + llinfos << "width: " << w << llendl; + llinfos << "height: " << h << llendl; + double aspra = m_next_video_frame -> aspect_ratio; + llinfos << "aspect_ratio: " << aspra << llendl; + int poss = m_next_video_frame -> pos_stream; + llinfos << "pos_stream: " << poss << llendl; + } + + + if (!mediaData) + mediaData = new unsigned char[w * h * 4]; + + YV12_to_RGBA(mediaData);// todo: do it faster + xine_free_video_frame (vo_port,m_next_video_frame); //&tmp); + m_framepending=false; + LLMediaEvent event( this ); + mEventEmitter.update( &LLMediaObserver::onMediaContentsChange, event ); + } + else + { + if (m_spamme) + { + llinfos << "no video frame"<< llendl; + m_spamme = false; + } + } + } + else + { + if (m_hasaudio) + { + // const char* artist = xine_get_meta_info(stream,XINE_META_INFO_ARTIST); + // const char* title = xine_get_meta_info(stream,XINE_META_INFO_TITLE); + // + } + } + + } + + return true; +} + + + +/////////////////////////////////////////////////////////////////////////////// +// virtual +unsigned char* LLMediaImplXine::getMediaData() +{ + return mediaData; +} + + +//////////////////////////////////////////////////////////////////////////////// +// virtual +std::string LLMediaImplXine::getVersion() +{ + std::string version_string = + "[" + sLLMediaImplXineReg.getImplName() + "] -(experimental) Xine " + XINE_VERSION; + return version_string; +} + +/////////////////////////////////////////////////////////////////////////////// +// virtual +bool LLMediaImplXine::setVolume(float volume) //volume 0 ... 1 +{ + // float xinevol = xine_get_param(stream, XINE_PARAM_AUDIO_VOLUME);//xinevol 0..100 + // SPAM //llinfos<< "MediaImpl " << "setVolume(" << volume << ") ; xinevol:" << xinevol << llendl; + + xine_set_param(stream, XINE_PARAM_AUDIO_VOLUME, volume*100); //TODO: respect platform volume + + return true; + +} + +/////////////////////////////////////////////////////////////////////////////// +// virtual +bool LLMediaImplXine::seek(double time) +{ + //TODO + + return true; +} + +void LLMediaImplXine::YV12_to_RGBA(unsigned char* mediaData) +{ + int c, d, e, r, g, b; + + int w_Y = m_next_video_frame->width; + int h_Y = m_next_video_frame->height; + int offset = w_Y % 8 == 0 ? 0 : 8 - (w_Y % 8); + int offset_uv = (w_Y / 2) % 8 == 0 ? 0 : 8 - ((w_Y / 2) % 8); + int true_w_Y = w_Y + offset; + + int w_UV = w_Y >> 1; + int true_w_UV = (w_Y >> 1) + offset_uv; + + int size_Y = true_w_Y * h_Y; + int size_UV = true_w_UV * h_Y / 2; + + int l_x=0; + int l_y=0; + int one_zero = 0; + + + uint8_t * addr_Y = m_next_video_frame->data; + uint8_t * addr_V = addr_Y + size_Y; + uint8_t * addr_U = addr_V + size_UV; + // for ( int y = 0; y < h_Y ;y++ ) // /me's singing "up- side- down ..." + for ( int y = (h_Y-1); y > 0 ;y-- ) + { + + if ( y & 1 ) + { + addr_U -= w_UV; + addr_V -= w_UV; + } + + l_y = y*w_Y; + for ( int x = 0; x < w_Y; x++ ) + { + c = *( addr_Y++ ) - 16; + d = *addr_U - 128; + e = *addr_V - 128; + r = (298 * c + 409 * e + 128) >> 8; + g = (298 * c - 100 * d - 208 * e + 128) >> 8; + b = (298 * c + 516 * d + 128) >> 8; + + if (r < 0) r = 0; + else if (r > 255) r = 255; + if (g < 0) g = 0; + else if (g > 255) g = 255; + if (b < 0) b = 0; + else if (b > 255) b = 255; + + l_x=4*(l_y+x); + mediaData[ l_x ] = r; + mediaData[ l_x +1 ] = g; + mediaData[ l_x +2 ] = b; + mediaData[ l_x +3 ] = 0; + + one_zero = x & 1; + addr_U += one_zero; + addr_V += one_zero; + } + addr_Y += offset; + if ( y & 3 == 3 ) + { + addr_U += offset_uv; + addr_V += offset_uv; + } + } +} + diff --git a/linden/indra/llmedia/impmediaimplxine.h b/linden/indra/llmedia/impmediaimplxine.h new file mode 100644 index 0000000..62966f0 --- /dev/null +++ b/linden/indra/llmedia/impmediaimplxine.h @@ -0,0 +1,143 @@ +/** + * @file impmediaimplgxine.h + * @author Armin Weatherwax + * @brief implementation that supports various media through Xine. + * + * $LicenseInfo:firstyear=2009$ + * + * Copyright (c) 2009 Armin Weatherwax + * + * + * + * Imprudence Viewer Source Code + * The source code in this file ("Source Code") is provided to you + * under the terms of the GNU General Public License, version 2.0 + * ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in + * this distribution, or online at + * http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + + +#ifndef XINE_ENABLE_EXPERIMENTAL_FEATURES +#define XINE_ENABLE_EXPERIMENTAL_FEATURES +#endif + +#define impmediaimplxine_h + +#include "llmediaimplcommon.h" +#include "llmediaimplfactory.h" + + + +extern "C" { +#include +#include +#include +#include +#include +} + + +class LLMediaManagerData; +class LLMediaImplMaker; + +/////////////////////////////////////////////////////////////////////////// + + + //bool sizeChanged(); + + + + +class LLMediaImplXine: + public LLMediaImplCommon + + +{ + public: + LLMediaImplXine (); + virtual ~LLMediaImplXine (); + + //////////////////////////////////////////////////////// + // implementation of the media public interface + + + static bool startup( LLMediaManagerData* init_data ); + static bool closedown(); + + /* virtual */ std::string getVersion(); + /* virtual */ bool navigateTo( const std::string mrl ); + /* virtual */ bool updateMedia(); + /* virtual */ unsigned char* getMediaData(); + /* virtual */ int getTextureFormatPrimary() const; + /* virtual */ int getTextureFormatType() const; + + /* virtual */ bool seek( double time ); //TODO; returns true atm + /* virtual */ bool setVolume( float volume ); + + private: + + static void event_listener(void *user_data, const xine_event_t *event); + void YV12_to_RGBA (unsigned char* mediaData); + + bool load(); + bool unload(); + bool pause(); + bool stop(); + bool play(); + + unsigned char* mediaData; + + int mTextureFormatPrimary; + int mTextureFormatType; + + + + //xine + xine_t *xine; + xine_stream_t *stream; + xine_video_port_t *vo_port; + xine_audio_port_t *ao_port; + xine_event_queue_t *m_event_queue; + xine_video_frame_t *m_next_video_frame; + //xine_audio_frame_t *m_next_audio_frame; //not used here + + std::string m_mrl; + uint32_t m_hasvideo; + uint32_t m_hasaudio; + bool m_playing; + bool m_framepending; + bool m_spamme; + + +}; + +class LLMediaImplXineMaker : public LLMediaImplMaker +{ +public: + LLMediaImplXineMaker(); + LLMediaImplXine* create() + { + return new LLMediaImplXine(); + } + +}; + + + + + diff --git a/linden/indra/llmedia/llmediamanager.cpp b/linden/indra/llmedia/llmediamanager.cpp index 5394b62..37380f4 100644 --- a/linden/indra/llmedia/llmediamanager.cpp +++ b/linden/indra/llmedia/llmediamanager.cpp @@ -35,7 +35,9 @@ #include "llmediaimplexample1.h" #include "llmediaimplexample2.h" #include "llmediaimplquicktime.h" -#include "llmediaimplgstreamer.h" +//#include "llmediaimplgstreamer.h" +#include "impmediaimplxine.h" + #if LL_LLMOZLIB_ENABLED # include "llmediaimplllmozlib.h" #endif @@ -91,9 +93,13 @@ void LLMediaManager::initClass( LLMediaManagerData* init_data ) #endif // LL_QUICKTIME_ENABLED ///#if LL_GSTREAMER_ENABLED - LL_DEBUGS("MediaManager") << "LLMediaManager::initClass: starting gstreamer" << LL_ENDL; - LLMediaImplGStreamer::startup( init_data ); +// LL_DEBUGS("MediaManager") << "LLMediaManager::initClass: starting gstreamer" << LL_ENDL; +// LLMediaImplGStreamer::startup( init_data ); ///#endif // LL_GSTREAMER_ENABLED + + LL_DEBUGS("MediaManager") << "LLMediaManager::initClass: starting xine." << LL_ENDL; + LLMediaImplXine::startup( init_data ); + } //////////////////////////////////////////////////////////////////////////////// @@ -134,7 +140,7 @@ void LLMediaManager::cleanupClass() #endif // LL_QUICKTIME_ENABLED ///#if LL_GSTREAMER_ENABLED - LLMediaImplGStreamer::closedown(); +// LLMediaImplGStreamer::closedown(); ///#endif // LL_QUICKTIME_ENABLED if ( sInstance ) diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index 4024fdd..e7fc6c5 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt @@ -56,7 +56,8 @@ include_directories( ${LLXML_INCLUDE_DIRS} ${LSCRIPT_INCLUDE_DIRS} ${LSCRIPT_INCLUDE_DIRS}/lscript_compile - ${GSTREAMER_INCLUDE_DIRS} +# ${GSTREAMER_INCLUDE_DIRS} + ${XINE_INCLUDE_DIRS} ) set(viewer_SOURCE_FILES diff --git a/linden/indra/newview/llmediaremotectrl.cpp b/linden/indra/newview/llmediaremotectrl.cpp index 1b337ab..7a93334 100644 --- a/linden/indra/newview/llmediaremotectrl.cpp +++ b/linden/indra/newview/llmediaremotectrl.cpp @@ -83,9 +83,9 @@ BOOL LLMediaRemoteCtrl::postBuild() childSetAction("media_play",LLOverlayBar::toggleMediaPlay,this); childSetAction("music_play",LLOverlayBar::toggleMusicPlay,this); childSetAction("media_stop",LLOverlayBar::mediaStop,this); - childSetAction("music_stop",LLOverlayBar::toggleMusicPlay,this); + childSetAction("music_stop",LLOverlayBar::musicStop,this); childSetAction("media_pause",LLOverlayBar::toggleMediaPlay,this); - childSetAction("music_pause",LLOverlayBar::toggleMusicPlay,this); + childSetAction("music_pause",LLOverlayBar::musicPause,this); childSetAction("expand", onClickExpandBtn, this); return TRUE; diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp index 1087fd8..7be1a2d 100644 --- a/linden/indra/newview/lloverlaybar.cpp +++ b/linden/indra/newview/lloverlaybar.cpp @@ -44,6 +44,7 @@ #include "llfocusmgr.h" #include "llimview.h" #include "llmediaremotectrl.h" + #include "llpanelaudiovolume.h" #include "llparcel.h" #include "lltextbox.h" @@ -384,21 +385,29 @@ void LLOverlayBar::toggleMusicPlay(void*) } } } +} +void LLOverlayBar::musicPause(void*) +{ + + //else //{ - // gOverlayBar->mMusicState = PAUSED; // desired state - // if (gAudiop) - // { - // gAudiop->pauseInternetStream(1); - // } - //} - else + gOverlayBar->mMusicState = PAUSED; // desired state + if (gAudiop) { + gAudiop->pauseInternetStream(1); + } + //} +} +void LLOverlayBar::musicStop(void*) +{ + + gOverlayBar->mMusicState = STOPPED; // desired state if (gAudiop) { gAudiop->stopInternetStream(); } - } + }