1*9ea84ac5SAndrew Rist /**************************************************************
2*9ea84ac5SAndrew Rist  *
3*9ea84ac5SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*9ea84ac5SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*9ea84ac5SAndrew Rist  * distributed with this work for additional information
6*9ea84ac5SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*9ea84ac5SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*9ea84ac5SAndrew Rist  * "License"); you may not use this file except in compliance
9*9ea84ac5SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*9ea84ac5SAndrew Rist  *
11*9ea84ac5SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*9ea84ac5SAndrew Rist  *
13*9ea84ac5SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*9ea84ac5SAndrew Rist  * software distributed under the License is distributed on an
15*9ea84ac5SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9ea84ac5SAndrew Rist  * KIND, either express or implied.  See the License for the
17*9ea84ac5SAndrew Rist  * specific language governing permissions and limitations
18*9ea84ac5SAndrew Rist  * under the License.
19*9ea84ac5SAndrew Rist  *
20*9ea84ac5SAndrew Rist  *************************************************************/
21*9ea84ac5SAndrew Rist 
22*9ea84ac5SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _FRAMEGRABBER_HXX
25cdf0e10cSrcweir #define _FRAMEGRABBER_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "gstplayer.hxx"
28cdf0e10cSrcweir #include <gdk-pixbuf/gdk-pixbuf.h>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #ifndef _COM_SUN_STAR_MEDIA_XFRAMEGRABBER_HDL_
31cdf0e10cSrcweir #include "com/sun/star/media/XFrameGrabber.hdl"
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir namespace avmedia { namespace gst {
36cdf0e10cSrcweir 
37cdf0e10cSrcweir // ----------------
38cdf0e10cSrcweir // - FrameGrabber -
39cdf0e10cSrcweir // ----------------
40cdf0e10cSrcweir 
41e3251387SMichael Stahl typedef ::cppu::ImplInheritanceHelper1
42e3251387SMichael Stahl <    Player
43e3251387SMichael Stahl ,   ::com::sun::star::media::XFrameGrabber
44e3251387SMichael Stahl > FrameGrabber_BASE;
45e3251387SMichael Stahl 
46e3251387SMichael Stahl class FrameGrabber
47e3251387SMichael Stahl     : public FrameGrabber_BASE
48cdf0e10cSrcweir {
49cdf0e10cSrcweir public:
50cdf0e10cSrcweir 
51cdf0e10cSrcweir     // static create method instead of public Ctor
52cdf0e10cSrcweir     static FrameGrabber* create( const GString* pUri );
53cdf0e10cSrcweir 
54cdf0e10cSrcweir     ~FrameGrabber();
55cdf0e10cSrcweir 
56cdf0e10cSrcweir     // XFrameGrabber
57cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > SAL_CALL grabFrame( double fMediaTime ) throw (::com::sun::star::uno::RuntimeException);
58cdf0e10cSrcweir 
59cdf0e10cSrcweir     // XServiceInfo
60cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException);
61cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
62cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException);
63cdf0e10cSrcweir 
64cdf0e10cSrcweir protected: FrameGrabber( GString* pURI = NULL );
65cdf0e10cSrcweir 
66cdf0e10cSrcweir     virtual gboolean busCallback( GstBus* pBus,
67cdf0e10cSrcweir                                   GstMessage* pMsg );
68cdf0e10cSrcweir 
69cdf0e10cSrcweir private: FrameGrabber( const FrameGrabber& );
70cdf0e10cSrcweir     FrameGrabber& operator=( const FrameGrabber& );
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     GMutex* mpFrameMutex;
73cdf0e10cSrcweir     GCond* mpFrameCond;
74cdf0e10cSrcweir     GdkPixbuf* mpLastPixbuf;
75cdf0e10cSrcweir     double mfGrabTime;
76cdf0e10cSrcweir     bool mbIsInGrabMode;
77cdf0e10cSrcweir };
78cdf0e10cSrcweir 
79cdf0e10cSrcweir } // namespace gst
80cdf0e10cSrcweir } // namespace avmedia
81cdf0e10cSrcweir 
82cdf0e10cSrcweir #endif // _FRAMEGRABBER_HXX
83