1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
9 * last change: $Author$ $Date$
11 * The Contents of this file are made available subject to
12 * the terms of GNU Lesser General Public License Version 2.1.
15 * GNU Lesser General Public License Version 2.1
16 * =============================================
17 * Copyright 2005 by Sun Microsystems, Inc.
18 * 901 San Antonio Road, Palo Alto, CA 94303, USA
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License version 2.1, as published by the Free Software Foundation.
24 * This library is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 * Lesser General Public License for more details.
29 * You should have received a copy of the GNU Lesser General Public
30 * License along with this library; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
34 ************************************************************************/
39 #include <osl/conditn.h>
40 #include "gstcommon.hxx"
42 #ifndef _COM_SUN_STAR_MEDIA_XPLAYER_HDL_
43 #include "com/sun/star/media/XPlayer.hdl"
46 typedef struct _GstXOverlay GstXOverlay
;
48 namespace avmedia
{ namespace gstreamer
{
54 class Player
: public ::cppu::WeakImplHelper2
< ::com::sun::star::media::XPlayer
,
55 ::com::sun::star::lang::XServiceInfo
>
59 Player( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& rxMgr
);
62 void preparePlaybin( const ::rtl::OUString
& rURL
, bool bFakeVideo
);
63 bool create( const ::rtl::OUString
& rURL
);
64 void processMessage( GstMessage
*message
);
65 GstBusSyncReply
processSyncMessage( GstMessage
*message
);
68 virtual void SAL_CALL
start( ) throw (::com::sun::star::uno::RuntimeException
);
69 virtual void SAL_CALL
stop( ) throw (::com::sun::star::uno::RuntimeException
);
70 virtual sal_Bool SAL_CALL
isPlaying( ) throw (::com::sun::star::uno::RuntimeException
);
71 virtual double SAL_CALL
getDuration( ) throw (::com::sun::star::uno::RuntimeException
);
72 virtual void SAL_CALL
setMediaTime( double fTime
) throw (::com::sun::star::uno::RuntimeException
);
73 virtual double SAL_CALL
getMediaTime( ) throw (::com::sun::star::uno::RuntimeException
);
74 virtual void SAL_CALL
setStopTime( double fTime
) throw (::com::sun::star::uno::RuntimeException
);
75 virtual double SAL_CALL
getStopTime( ) throw (::com::sun::star::uno::RuntimeException
);
76 virtual void SAL_CALL
setRate( double fRate
) throw (::com::sun::star::uno::RuntimeException
);
77 virtual double SAL_CALL
getRate( ) throw (::com::sun::star::uno::RuntimeException
);
78 virtual void SAL_CALL
setPlaybackLoop( sal_Bool bSet
) throw (::com::sun::star::uno::RuntimeException
);
79 virtual sal_Bool SAL_CALL
isPlaybackLoop( ) throw (::com::sun::star::uno::RuntimeException
);
80 virtual void SAL_CALL
setMute( sal_Bool bSet
) throw (::com::sun::star::uno::RuntimeException
);
81 virtual sal_Bool SAL_CALL
isMute( ) throw (::com::sun::star::uno::RuntimeException
);
82 virtual void SAL_CALL
setVolumeDB( sal_Int16 nVolumeDB
) throw (::com::sun::star::uno::RuntimeException
);
83 virtual sal_Int16 SAL_CALL
getVolumeDB( ) throw (::com::sun::star::uno::RuntimeException
);
84 virtual ::com::sun::star::awt::Size SAL_CALL
getPreferredPlayerWindowSize( ) throw (::com::sun::star::uno::RuntimeException
);
85 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::media::XPlayerWindow
> SAL_CALL
createPlayerWindow( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
) throw (::com::sun::star::uno::RuntimeException
);
86 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::media::XFrameGrabber
> SAL_CALL
createFrameGrabber( ) throw (::com::sun::star::uno::RuntimeException
);
89 virtual ::rtl::OUString SAL_CALL
getImplementationName( ) throw (::com::sun::star::uno::RuntimeException
);
90 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
) throw (::com::sun::star::uno::RuntimeException
);
91 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException
);
95 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> mxMgr
;
97 ::rtl::OUString maURL
;
99 // Add elements and pipeline here
100 GstElement
* mpPlaybin
; // the playbin is also a pipeline
101 sal_Bool mbFakeVideo
;
103 gdouble mnUnmutedVolume
;
104 sal_Bool mbPlayPending
;
107 sal_Bool mbInitialized
;
110 GstXOverlay
* mpXOverlay
;
115 oslCondition maSizeCondition
;
118 } // namespace gstreamer
119 } // namespace avmedia
121 #endif // _PLAYER_HXX