nss: upgrade to release 3.73
[LibreOffice.git] / avmedia / source / gstreamer / gstplayer.hxx
blob4a239ca1d2a6505944bf048985ba6bb28607c3f3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include <osl/conditn.hxx>
23 #include "gstcommon.hxx"
25 #include <com/sun/star/media/XPlayer.hpp>
26 #include <cppuhelper/compbase.hxx>
27 #include <cppuhelper/basemutex.hxx>
29 typedef struct _GstVideoOverlay GstVideoOverlay;
31 namespace avmedia::gstreamer {
34 typedef ::cppu::WeakComponentImplHelper< css::media::XPlayer,
35 css::lang::XServiceInfo > GstPlayer_BASE;
37 class Player final : public ::cppu::BaseMutex,
38 public GstPlayer_BASE
40 public:
42 explicit Player();
43 virtual ~Player() override;
45 void preparePlaybin( const OUString& rURL, GstElement *pSink );
46 bool create( const OUString& rURL );
47 void processMessage( GstMessage *message );
48 GstBusSyncReply processSyncMessage( GstMessage *message );
50 // XPlayer
51 virtual void SAL_CALL start( ) override;
52 virtual void SAL_CALL stop( ) override;
53 virtual sal_Bool SAL_CALL isPlaying( ) override;
54 virtual double SAL_CALL getDuration( ) override;
55 virtual void SAL_CALL setMediaTime( double fTime ) override;
56 virtual double SAL_CALL getMediaTime( ) override;
57 virtual void SAL_CALL setPlaybackLoop( sal_Bool bSet ) override;
58 virtual sal_Bool SAL_CALL isPlaybackLoop( ) override;
59 virtual void SAL_CALL setMute( sal_Bool bSet ) override;
60 virtual sal_Bool SAL_CALL isMute( ) override;
61 virtual void SAL_CALL setVolumeDB( sal_Int16 nVolumeDB ) override;
62 virtual sal_Int16 SAL_CALL getVolumeDB( ) override;
63 virtual css::awt::Size SAL_CALL getPreferredPlayerWindowSize( ) override;
64 virtual css::uno::Reference< css::media::XPlayerWindow > SAL_CALL createPlayerWindow( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
65 virtual css::uno::Reference< css::media::XFrameGrabber > SAL_CALL createFrameGrabber( ) override;
67 // XServiceInfo
68 virtual OUString SAL_CALL getImplementationName( ) override;
69 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
70 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
72 // ::cppu::OComponentHelper
73 virtual void SAL_CALL disposing() final override;
75 private:
76 OUString maURL;
78 // Add elements and pipeline here
79 GstElement* mpPlaybin; // the playbin is also a pipeline
80 GstElement* mpVolumeControl; // the playbin is also a pipeline
81 bool mbUseGtkSink;
82 bool mbFakeVideo;
84 gdouble mnUnmutedVolume;
85 bool mbPlayPending;
86 bool mbMuted;
87 bool mbLooping;
88 bool mbInitialized;
90 void* mpDisplay;
91 tools::Long mnWindowID;
92 GstVideoOverlay* mpXOverlay;
93 gint64 mnDuration;
94 int mnWidth;
95 int mnHeight;
97 css::awt::Rectangle maArea; // Area of the player window.
99 guint mnWatchID;
100 bool mbWatchID;
102 osl::Condition maSizeCondition;
105 } // namespace avmedia::gstreamer
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */