From 428b32da98c9343b3f02d7da66c4af232b1c4376 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sun, 5 Apr 2009 02:22:49 -0500 Subject: Added LLGstPlayThread class. --- ChangeLog.txt | 10 ++++++ linden/indra/llmedia/CMakeLists.txt | 2 ++ linden/indra/llmedia/llgstplaythread.cpp | 54 ++++++++++++++++++++++++++++ linden/indra/llmedia/llgstplaythread.h | 62 ++++++++++++++++++++++++++++++++ 4 files changed, 128 insertions(+) create mode 100644 linden/indra/llmedia/llgstplaythread.cpp create mode 100644 linden/indra/llmedia/llgstplaythread.h diff --git a/ChangeLog.txt b/ChangeLog.txt index 6e89a48..d7c4a43 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,13 @@ +2009-04-05 Jacek Antonelli + + * linden/indra/llmedia/llgstplaythread.cpp: + Added LLGstPlayThread class. + * linden/indra/llmedia/llgstplaythread.h: + Ditto. + * linden/indra/llmedia/CMakeLists.txt: + Ditto. + + 2009-04-04 Jacek Antonelli * linden/indra/llmedia/llmediaimplgstreamer.cpp: diff --git a/linden/indra/llmedia/CMakeLists.txt b/linden/indra/llmedia/CMakeLists.txt index 0440153..0e5b261 100644 --- a/linden/indra/llmedia/CMakeLists.txt +++ b/linden/indra/llmedia/CMakeLists.txt @@ -31,6 +31,7 @@ set(llmedia_SOURCE_FILES llmediamanager.cpp llmediaimplgstreamer.cpp llmediaimplgstreamervidplug.cpp + llgstplaythread.cpp ) set(llmedia_HEADER_FILES @@ -47,6 +48,7 @@ set(llmedia_HEADER_FILES llmediaobserver.h llmediaimplgstreamer.h llmediaimplgstreamervidplug.h + llgstplaythread.h ) # Work around a bad interaction between broken gstreamer headers and diff --git a/linden/indra/llmedia/llgstplaythread.cpp b/linden/indra/llmedia/llgstplaythread.cpp new file mode 100644 index 0000000..152f9d9 --- /dev/null +++ b/linden/indra/llmedia/llgstplaythread.cpp @@ -0,0 +1,54 @@ +/** + * @file llgstplaythread.cpp + * @author Jacek Antonelli + * @brief GStreamer playback management thread class + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Jacek Antonelli + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. 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 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * $/LicenseInfo$ + */ + +#include "llgstplaythread.h" +#include "llmediaimplgstreamer.h" + +LLGstPlayThread:: +LLGstPlayThread( LLMediaImplCommon *impl, + const std::string& name, apr_pool_t *poolp ): + LLThread( name, poolp ), + mMediaImpl( impl ) +{ +} + + +LLGstPlayThread::~LLGstPlayThread() +{ +} + + +// virtual +void LLGstPlayThread::run() +{ + ((LLMediaImplGStreamer *)mMediaImpl)->startPlay(); +} diff --git a/linden/indra/llmedia/llgstplaythread.h b/linden/indra/llmedia/llgstplaythread.h new file mode 100644 index 0000000..c3c36a7 --- /dev/null +++ b/linden/indra/llmedia/llgstplaythread.h @@ -0,0 +1,62 @@ +/** + * @file llgstplaythread.h + * @author Jacek Antonelli + * @brief GStreamer playback management thread class + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Jacek Antonelli + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. 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 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * $/LicenseInfo$ + */ + + +#ifndef LL_LLGSTPLAYTHREAD_H +#define LL_LLGSTPLAYTHREAD_H + +#include "linden_common.h" + +#include "llthread.h" +#include "llmediaimplcommon.h" + +class LLGstPlayThread: public LLThread +{ + public: + + LLGstPlayThread( LLMediaImplCommon *impl, + const std::string& name, apr_pool_t *poolp ); + + ~LLGstPlayThread(); + + virtual void run(); + + private: + + // Actually, this will really only be an LLMediaImplGStreamer. + // But we have to jump through some hoops to mutual pointer-holding. + // There may be a better way, but I don't have the motivation to find it. + LLMediaImplCommon *mMediaImpl; +}; + + +#endif // LL_LLGSTPLAYTHREAD_H -- cgit v1.1