2 * Copyright (C) 2006 Marcus Overhagen <marcus@overhagen.de>. All rights reserved.
3 * Copyright (C) 2008 Maurice Kalinowski <haiku@kaldience.com>. All rights reserved.
5 * Distributed under the terms of the MIT License.
7 #ifndef __VIDEO_NODE_H_
8 #define __VIDEO_NODE_H_
11 #include <BufferConsumer.h>
12 #include <MediaEventLooper.h>
22 class VideoNode
: public BMediaEventLooper
, public BBufferConsumer
25 VideoNode(const char *name
);
26 VideoNode(const char *name
, BMediaAddOn
* addon
, int32 id
);
29 void SetOverlayEnabled(bool yesno
);
30 bool IsOverlayActive();
37 BMediaAddOn
* AddOn(int32
*internal_id
) const;
39 void NodeRegistered();
41 void BufferReceived(BBuffer
* buffer
);
43 status_t
GetNextInput(int32
*cookie
, media_input
*out_input
);
44 void DisposeInputCookie(int32 cookie
);
46 status_t
HandleMessage(
52 const media_timed_event
*event
,
56 status_t
AcceptFormat(
57 const media_destination
&dst
,
58 media_format
*format
);
60 void ProducerDataStatus(
61 const media_destination
&dst
,
63 bigtime_t at_media_time
);
65 status_t
GetLatencyFor(
66 const media_destination
&dst
,
67 bigtime_t
*out_latency
,
68 media_node_id
*out_id
);
71 const media_source
&src
,
72 const media_destination
&dst
,
73 const media_format
&format
,
74 media_input
*out_input
);
77 const media_source
&src
,
78 const media_destination
&dst
);
80 status_t
FormatChanged(
81 const media_source
&src
,
82 const media_destination
&dst
,
83 int32 from_change_count
,
84 const media_format
&format
);
86 void HandleBuffer(BBuffer
*buffer
);
87 status_t
CreateBuffers(BRect frame
, color_space cspace
, bool overlay
);
92 VideoWindow
* fWindow
;
93 VideoView
* fVideoView
;
97 bool fDirectOverlayBuffer
; // If the overlay memory is directly written by the producer node.
99 BLocker
* fBitmapLocker
;
101 int32 fInternalFlavorId
;