2 * Copyright (c) 2000-2008, Ingo Weinhold <ingo_weinhold@gmx.de>,
3 * Copyright (c) 2000-2008, Stephan Aßmus <superstippi@gmx.de>,
4 * All Rights Reserved. Distributed under the terms of the MIT license.
10 #include <MediaNode.h>
12 #include "PlaybackManager.h"
24 class NodeManager
: public PlaybackManager
{
27 virtual ~NodeManager();
29 // must be implemented in derived classes
30 virtual VideoTarget
* CreateVideoTarget() = 0;
31 virtual VideoSupplier
* CreateVideoSupplier() = 0;
32 virtual AudioSupplier
* CreateAudioSupplier() = 0;
41 status_t
Init(BRect videoBounds
, float videoFrameRate
,
42 color_space preferredVideoFormat
,
43 float audioFrameRate
, uint32 audioChannels
,
44 int32 loopingMode
, bool loopingEnabled
,
45 float speed
, uint32 enabledNodes
,
48 // only call this if the
49 // media_server has died!
50 status_t
CleanupNodes();
52 status_t
FormatChanged(BRect videoBounds
,
54 color_space preferredVideoFormat
,
55 float audioFrameRate
, uint32 audioChannels
,
60 virtual void SetPlayMode(int32 mode
,
61 bool continuePlaying
= true);
63 virtual bigtime_t
RealTimeForTime(bigtime_t time
) const;
64 virtual bigtime_t
TimeForRealTime(bigtime_t time
) const;
66 virtual void SetCurrentAudioTime(bigtime_t time
);
68 void SetVideoBounds(BRect bounds
);
69 virtual BRect
VideoBounds() const;
71 void SetVideoTarget(VideoTarget
* vcTarget
);
72 VideoTarget
* GetVideoTarget() const;
74 virtual void SetVolume(float percent
);
76 void SetPeakListener(BHandler
* handler
);
79 status_t
_SetUpNodes(color_space preferredVideoFormat
,
80 uint32 enabledNodes
, bool useOverlays
,
82 uint32 audioChannels
);
83 status_t
_SetUpVideoNodes(
84 color_space preferredVideoFormat
,
86 status_t
_SetUpAudioNodes(float audioFrameRate
,
87 uint32 audioChannels
);
88 status_t
_TearDownNodes(bool disconnect
= true);
89 status_t
_StartNodes();
99 media_destination destination
;
105 BMediaRoster
* fMediaRoster
;
108 AudioProducer
* fAudioProducer
;
109 VideoConsumer
* fVideoConsumer
;
110 VideoProducer
* fVideoProducer
;
111 media_node fTimeSource
;
113 Connection fAudioConnection
;
114 Connection fVideoConnection
;
116 bigtime_t fPerformanceTimeBase
;
120 VideoTarget
* fVideoTarget
;
121 AudioSupplier
* fAudioSupplier
;
122 VideoSupplier
* fVideoSupplier
;
125 BHandler
* fPeakListener
;
129 #endif // NODE_MANAGER_H