1cdf0e10cSrcweir /*************************************************************************
2cdf0e10cSrcweir  *
3cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4cdf0e10cSrcweir  *
5cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6cdf0e10cSrcweir  *
7cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8cdf0e10cSrcweir  *
9cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10cdf0e10cSrcweir  *
11cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14cdf0e10cSrcweir  *
15cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20cdf0e10cSrcweir  *
21cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25cdf0e10cSrcweir  *
26cdf0e10cSrcweir  ************************************************************************/
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #ifndef _FRAMEGRABBER_HXX
29cdf0e10cSrcweir #define _FRAMEGRABBER_HXX
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include "gstplayer.hxx"
32cdf0e10cSrcweir #include <gdk-pixbuf/gdk-pixbuf.h>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir #ifndef _COM_SUN_STAR_MEDIA_XFRAMEGRABBER_HDL_
35cdf0e10cSrcweir #include "com/sun/star/media/XFrameGrabber.hdl"
36cdf0e10cSrcweir #endif
37cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
38cdf0e10cSrcweir 
39cdf0e10cSrcweir namespace avmedia { namespace gst {
40cdf0e10cSrcweir 
41cdf0e10cSrcweir // ----------------
42cdf0e10cSrcweir // - FrameGrabber -
43cdf0e10cSrcweir // ----------------
44cdf0e10cSrcweir 
45*e3251387SMichael Stahl typedef ::cppu::ImplInheritanceHelper1
46*e3251387SMichael Stahl <    Player
47*e3251387SMichael Stahl ,   ::com::sun::star::media::XFrameGrabber
48*e3251387SMichael Stahl > FrameGrabber_BASE;
49*e3251387SMichael Stahl 
50*e3251387SMichael Stahl class FrameGrabber
51*e3251387SMichael Stahl     : public FrameGrabber_BASE
52cdf0e10cSrcweir {
53cdf0e10cSrcweir public:
54cdf0e10cSrcweir 
55cdf0e10cSrcweir     // static create method instead of public Ctor
56cdf0e10cSrcweir     static FrameGrabber* create( const GString* pUri );
57cdf0e10cSrcweir 
58cdf0e10cSrcweir     ~FrameGrabber();
59cdf0e10cSrcweir 
60cdf0e10cSrcweir     // XFrameGrabber
61cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > SAL_CALL grabFrame( double fMediaTime ) throw (::com::sun::star::uno::RuntimeException);
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     // XServiceInfo
64cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException);
65cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
66cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException);
67cdf0e10cSrcweir 
68cdf0e10cSrcweir protected: FrameGrabber( GString* pURI = NULL );
69cdf0e10cSrcweir 
70cdf0e10cSrcweir     virtual gboolean busCallback( GstBus* pBus,
71cdf0e10cSrcweir                                   GstMessage* pMsg );
72cdf0e10cSrcweir 
73cdf0e10cSrcweir private: FrameGrabber( const FrameGrabber& );
74cdf0e10cSrcweir     FrameGrabber& operator=( const FrameGrabber& );
75cdf0e10cSrcweir 
76cdf0e10cSrcweir     GMutex* mpFrameMutex;
77cdf0e10cSrcweir     GCond* mpFrameCond;
78cdf0e10cSrcweir     GdkPixbuf* mpLastPixbuf;
79cdf0e10cSrcweir     double mfGrabTime;
80cdf0e10cSrcweir     bool mbIsInGrabMode;
81cdf0e10cSrcweir };
82cdf0e10cSrcweir 
83cdf0e10cSrcweir } // namespace gst
84cdf0e10cSrcweir } // namespace avmedia
85cdf0e10cSrcweir 
86cdf0e10cSrcweir #endif // _FRAMEGRABBER_HXX
87