3rdparty/licenseReport: Add seperate LGPL checks
[haiku.git] / src / add-ons / media / media-add-ons / videowindow / VideoNode.h
blobe4d649739e83f532bc74bf86f0fa52868f151ca7
1 /*
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.
6 */
7 #ifndef __VIDEO_NODE_H_
8 #define __VIDEO_NODE_H_
11 #include <BufferConsumer.h>
12 #include <MediaEventLooper.h>
15 class BBitmap;
16 class BLocker;
17 class BWindow;
18 class VideoView;
19 class VideoWindow;
22 class VideoNode : public BMediaEventLooper, public BBufferConsumer
24 public:
25 VideoNode(const char *name);
26 VideoNode(const char *name, BMediaAddOn* addon, int32 id);
27 ~VideoNode();
29 void SetOverlayEnabled(bool yesno);
30 bool IsOverlayActive();
32 void LockBitmap();
33 BBitmap * Bitmap();
34 void UnlockBitmap();
36 protected:
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(
47 int32 message,
48 const void *data,
49 size_t size);
51 void HandleEvent(
52 const media_timed_event *event,
53 bigtime_t lateness,
54 bool realTimeEvent);
56 status_t AcceptFormat(
57 const media_destination &dst,
58 media_format *format);
60 void ProducerDataStatus(
61 const media_destination &dst,
62 int32 status,
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);
70 status_t Connected(
71 const media_source &src,
72 const media_destination &dst,
73 const media_format &format,
74 media_input *out_input);
76 void Disconnected(
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);
88 void DeleteBuffers();
90 private:
91 void _InitDisplay();
92 VideoWindow * fWindow;
93 VideoView * fVideoView;
94 media_input fInput;
95 bool fOverlayEnabled;
96 bool fOverlayActive;
97 bool fDirectOverlayBuffer; // If the overlay memory is directly written by the producer node.
98 BBitmap * fBitmap;
99 BLocker * fBitmapLocker;
100 BMediaAddOn* fAddOn;
101 int32 fInternalFlavorId;
104 #endif