
|
[haiku-development]
||
[Date Prev]
[03-2008 Date Index]
[Date Next]
||
[Thread Prev]
[03-2008 Thread Index]
[Thread Next]
[haiku-development] Video Window patch
- From: Maurice Kalinowski <haiku@xxxxxxxxxxxxx>
- To: haiku-development@xxxxxxxxxxxxx
- Date: Sun, 02 Mar 2008 17:04:40 +0100
Hey once again,
as some of you might already have seen, Marcus was so kind to re-license
the videowindow media addon, so that I could apply some changes to it.
So far the code could not be used as an AddOn at all, it was unfinished.
I've implemented the remaining parts, refactored some stuff and it seems
to work quite good here. For those of you, who don't know, what I am
talking about, take a look here:
http://www.kaldience.com/haiku/videowindow.png
I have recognized some issues in Cortex and I am not sure if these might
be side-effects of the addon, but so far it seems like Cortex is having
multiple potential problems and needs much more care. On a side note,
the System Clock still has no icon, anyone took a look at my previous
patch so far ? Just kidding... :P
So here's the commit proposal:
- Compile fix
- Added Jamfile
- Added debug.h from other media addons to be able to have some nicer
debug output in case needed and be able to remove some of the printfs
floating around so far.
- Instead of using the MediaNode inside the View, the node should
control the view and the window in the case it is instantiated from an
addon.
- During the connection process the VideoNode tried to allocate overlay
buffers. This can fail for multiple reasons like there is already
someone using overlay or it is not supported at all due to driver
limitations. In that case try to get non overlay buffers. If this fails,
the Connect() can still return an error. This made the Connect() work
here on vmware with the vmware graphics driver. Still needs someone
having acceleration to verify, that overlay is working properly.
- Implemented the addon, which was empty so far
- Implemented the VideoWindow class, which was empty so far
- not sure if the VideoWindow class is needed at all. We could use it
for delayed show of the window when first data arrives or connection is
actually established. Currently the window gets shown as soon as the
Node is instantiated.
Some remark on testing it. I did not add this media addon to the image,
as I am not the one to decide if it should be included (though I think
it should be. It makes you at least play a little bit around with
Cortex/MediaKit under Haiku). Use usual options in UserBuildConfig for
adding it.
Cortex has a very annoying bug so far, the Transport Window never gets
updated. Thus, the testing procedure is the following.
- Instantiate a video window node
- Instantiate a demo video producer
- Connect both nodes
- Select the producer node in the main window
- Close the Transport Window
- Open the transport Window again over the menubar
- You are now able to start/stop the nodes in the Transport Window.
I will try to figure out, what is going wrong with Cortex here later on.
Possibly someone else wants to take care of it? Otherwise, should a task
for this be created?
Hoping to hear soon from someone of you,
Maurice
P.S.: I've attached one diff file and also a zip with containing the
code as the diff is quite large and it might be easier to just browse
the code. Also missing files from the diff are included there (Jamfile
and debug.h)
diff -dur ../../../../../haiku/src/add-ons/media/media-add-ons/Jamfile ./Jamfile
--- ../../../../../haiku/src/add-ons/media/media-add-ons/Jamfile
2008-02-21 20:30:23.000000000 +0100
+++ ./Jamfile 2008-03-02 15:27:52.000000000 +0100
@@ -14,4 +14,5 @@
SubInclude HAIKU_TOP src add-ons media media-add-ons usb_vision ;
SubInclude HAIKU_TOP src add-ons media media-add-ons usb_webcam ;
SubInclude HAIKU_TOP src add-ons media media-add-ons video_producer_demo ;
+SubInclude HAIKU_TOP src add-ons media media-add-ons videowindow ;
Only in ./videowindow: debug.h
Only in ./videowindow: Jamfile
diff -dur
../../../../../haiku/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.cpp
./videowindow/VideoAddOn.cpp
---
../../../../../haiku/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.cpp
2008-03-02 16:55:54.000000000 +0100
+++ ./videowindow/VideoAddOn.cpp 2008-03-02 15:55:36.000000000 +0100
@@ -1,6 +1,102 @@
/*
- * Copyright (C) 2006 Marcus Overhagen <marcus@xxxxxxxxxxxx>. All rights
reserved.
+ * Copyright (C) 2006-2008 Marcus Overhagen <marcus@xxxxxxxxxxxx>. All rights
reserved.
+ * Copyright (C) 2008 Maurice Kalinowski <haiku@xxxxxxxxxxxxx>. All rights
reserved.
*
* Distributed under the terms of the MIT License.
*/
#include "VideoAddOn.h"
+#include "VideoNode.h"
+#include "VideoView.h"
+#include "debug.h"
+
+
+#include <stdio.h>
+#include <string.h>
+
+
+VideoWindowAddOn::VideoWindowAddOn(image_id id)
+ : BMediaAddOn(id)
+{
+ CALLED();
+ fInfo.internal_id = 0;
+ fInfo.name = strdup("VideoWindow Consumer");
+ fInfo.info = strdup("This node displays a simple video window");
+ fInfo.kinds = B_BUFFER_CONSUMER;
+ fInfo.flavor_flags = 0;
+ fInfo.possible_count = 0;
+ fInfo.in_format_count = 1;
+ media_format *inFormat = new media_format;
+ inFormat->type = B_MEDIA_RAW_VIDEO;
+ inFormat->u.raw_video = media_raw_video_format::wildcard;
+ fInfo.in_formats = inFormat;
+}
+
+
+VideoWindowAddOn::~VideoWindowAddOn()
+{
+}
+
+
+
+bool
+VideoWindowAddOn::WantsAutoStart()
+{
+ CALLED();
+ return false;
+}
+
+
+int32
+VideoWindowAddOn::CountFlavors()
+{
+ CALLED();
+ return 1;
+}
+
+
+status_t
+VideoWindowAddOn::GetFlavorAt(int32 cookie, const flavor_info **flavorInfo)
+{
+ CALLED();
+ if (cookie != 0)
+ return B_BAD_INDEX;
+ if (!flavorInfo || !*flavorInfo)
+ return B_ERROR;
+
+ *flavorInfo = &fInfo;
+ return B_OK;
+}
+
+
+BMediaNode*
+VideoWindowAddOn::InstantiateNodeFor(const flavor_info *info, BMessage*,
status_t *outError)
+{
+ CALLED();
+ if (!outError)
+ return NULL;
+
+ if (info->in_formats[0].type != B_MEDIA_RAW_VIDEO) {
+ *outError = B_MEDIA_BAD_FORMAT;
+ return NULL;
+ }
+
+ BRect size;
+ if (info->in_formats[0].u.raw_video.display.line_width != 0)
+ size.right = info->in_formats[0].u.raw_video.display.line_width;
+ else
+ size.right = 320;
+ if (info->in_formats[0].u.raw_video.display.line_count != 0)
+ size.bottom =
info->in_formats[0].u.raw_video.display.line_count;
+ else
+ size.bottom = 240;
+
+ VideoNode* node = new VideoNode("Video Node", this, info->internal_id);
+
+ return node;
+}
+
+
+extern "C" BMediaAddOn *make_media_addon(image_id id)
+{
+ return new VideoWindowAddOn(id);
+}
diff -dur
../../../../../haiku/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.h
./videowindow/VideoAddOn.h
---
../../../../../haiku/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.h
2008-03-02 16:55:54.000000000 +0100
+++ ./videowindow/VideoAddOn.h 2008-03-02 15:49:10.000000000 +0100
@@ -1,18 +1,29 @@
/*
- * Copyright (C) 2006 Marcus Overhagen <marcus@xxxxxxxxxxxx>. All rights
reserved.
+ * Copyright (C) 2006-2008 Marcus Overhagen <marcus@xxxxxxxxxxxx>. All rights
reserved.
+ * Copyright (C) 2008 Maurice Kalinowski <haiku@xxxxxxxxxxxxx>. All rights
reserved.
*
* Distributed under the terms of the MIT License.
*/
#ifndef __VIDEO_ADD_ON_H
#define __VIDEO_ADD_ON_H
+
#include <MediaAddOn.h>
-class MediaAddOn : public BMediaAddOn
+
+class VideoWindowAddOn : public BMediaAddOn
{
public:
+
VideoWindowAddOn(image_id);
+
~VideoWindowAddOn();
+
+ bool WantsAutoStart();
+ int32 CountFlavors();
+ status_t GetFlavorAt(int32,
const flavor_info**);
+ BMediaNode*
InstantiateNodeFor(const flavor_info*, BMessage*, status_t*);
private:
+ flavor_info fInfo;
};
extern "C" BMediaAddOn *make_media_addon(image_id id);
diff -dur
../../../../../haiku/src/add-ons/media/media-add-ons/videowindow/VideoNode.cpp
./videowindow/VideoNode.cpp
---
../../../../../haiku/src/add-ons/media/media-add-ons/videowindow/VideoNode.cpp
2008-03-02 16:55:54.000000000 +0100
+++ ./videowindow/VideoNode.cpp 2008-03-02 16:20:56.000000000 +0100
@@ -1,51 +1,78 @@
/*
* Copyright (C) 2006 Marcus Overhagen <marcus@xxxxxxxxxxxx>. All rights
reserved.
+ * Copyright (C) 2008 Maurice Kalinowski <haiku@xxxxxxxxxxxxx>. All rights
reserved.
*
* Distributed under the terms of the MIT License.
*/
-#include <stdio.h>
-#include <string.h>
-#include <Window.h>
-#include <TimeSource.h>
-#include <MediaRoster.h>
-#include <BufferGroup.h>
-#include <Buffer.h>
-#include <Bitmap.h>
-#include <Locker.h>
-#include <Debug.h>
-
#include "VideoNode.h"
#include "VideoView.h"
+#include "VideoWindow.h"
-VideoNode::VideoNode(const char *name, VideoView *view)
+#include <Bitmap.h>
+#include <Buffer.h>
+#include <BufferGroup.h>
+#include <Debug.h>
+#include <MediaRoster.h>
+#include <Locker.h>
+#include <TimeSource.h>
+#include <Window.h>
+#include <stdio.h>
+#include <string.h>
+
+
+VideoNode::VideoNode(const char *name)
: BMediaNode(name)
, BMediaEventLooper()
, BBufferConsumer(B_MEDIA_RAW_VIDEO)
- , fVideoView(view)
+ , fWindow(0)
+ , fVideoView(0)
, fInput()
, fOverlayEnabled(true)
, fOverlayActive(false)
, fDirectOverlayBuffer(false)
, fBitmap(0)
, fBitmapLocker(new BLocker("Video Node Locker"))
+ , fAddOn(0)
+ , fInternalFlavorId(0)
{
+ _InitDisplay();
}
+VideoNode::VideoNode(const char *name, BMediaAddOn* addon, int32 id)
+ : BMediaNode(name)
+ , BMediaEventLooper()
+ , BBufferConsumer(B_MEDIA_RAW_VIDEO)
+ , fWindow(0)
+ , fVideoView(0)
+ , fInput()
+ , fOverlayEnabled(true)
+ , fOverlayActive(false)
+ , fDirectOverlayBuffer(false)
+ , fBitmap(0)
+ , fBitmapLocker(new BLocker("Video Node Locker"))
+ , fAddOn(addon)
+ , fInternalFlavorId(id)
+{
+ _InitDisplay();
+}
+
VideoNode::~VideoNode()
{
Quit();
DeleteBuffers();
delete fBitmapLocker;
+ if (fWindow)
+ fWindow->Quit();
}
BMediaAddOn *
VideoNode::AddOn(int32 *internal_id) const
{
- *internal_id = 0;
- return NULL;
+ *internal_id = fInternalFlavorId;
+ return fAddOn;
}
@@ -127,7 +154,7 @@
HandleBuffer((BBuffer *)event->pointer);
break;
default:
- printf("VideoNode::HandleEvent unknown event");
+ fprintf(stderr, "VideoNode::HandleEvent unknown event");
break;
}
}
@@ -149,12 +176,13 @@
{
if (dst != fInput.destination)
return B_MEDIA_BAD_DESTINATION;
-
+
*out_latency = 10000;
*out_id = TimeSource()->ID();
return B_OK;
}
+
status_t
VideoNode::AcceptFormat(const media_destination &dst,
media_format *format)
@@ -166,17 +194,15 @@
* BBufferConsumer::Connected
* BBufferProducer::Connect
*/
-
if (dst != fInput.destination)
return B_MEDIA_BAD_DESTINATION;
-
+
if (format->type == B_MEDIA_NO_TYPE)
format->type = B_MEDIA_RAW_VIDEO;
-
+
if (format->type != B_MEDIA_RAW_VIDEO)
return B_MEDIA_BAD_FORMAT;
-
return B_OK;
}
@@ -210,15 +236,19 @@
DeleteBuffers();
err = CreateBuffers(frame, colorspace, fOverlayEnabled);
+ if (err && fOverlayEnabled) {
+ SetOverlayEnabled(false);
+ err = CreateBuffers(frame, colorspace, fOverlayEnabled);
+ }
+
if (err) {
- printf("VideoNode::Connected failed, fOverlayEnabled = %d\n",
fOverlayEnabled);
+ fprintf(stderr, "VideoNode::Connected failed, fOverlayEnabled =
%d\n", fOverlayEnabled);
return err;
}
*out_input = fInput;
return B_OK;
-
}
@@ -244,7 +274,6 @@
int32 from_change_count,
const media_format &format)
{
- printf("VideoNode::FormatChanged enter\n");
if (src != fInput.source)
return B_MEDIA_BAD_SOURCE;
if (dst != fInput.destination)
@@ -259,20 +288,20 @@
fVideoView->RemoveOverlay();
err = CreateBuffers(frame, colorspace, true); // try overlay
if (err) {
- printf("VideoNode::FormatChanged creating overlay
buffer failed\n");
+ fprintf(stderr, "VideoNode::FormatChanged creating
overlay buffer failed\n");
err = CreateBuffers(frame, colorspace, false); // no
overlay
}
} else {
err = CreateBuffers(frame, colorspace, false); // no overlay
}
+
if (err) {
- printf("VideoNode::FormatChanged failed (lost buffer
group!)\n");
+ fprintf(stderr, "VideoNode::FormatChanged failed (lost buffer
group!)\n");
return B_MEDIA_BAD_FORMAT;
}
fInput.format = format;
- printf("VideoNode::FormatChanged leave\n");
return B_OK;
}
@@ -280,10 +309,8 @@
void
VideoNode::HandleBuffer(BBuffer *buffer)
{
-// printf("VideoNode::HandleBuffer\n");
-
LockBitmap();
- if (fBitmap) {
+ if (fBitmap && fWindow && fVideoView) {
// bigtime_t start = system_time();
if (fOverlayActive) {
if (B_OK == fBitmap->LockBits()) {
@@ -341,8 +368,8 @@
status_t
VideoNode::CreateBuffers(BRect frame, color_space cspace, bool overlay)
{
- printf("VideoNode::CreateBuffers: frame %d,%d,%d,%d colorspace 0x%08x,
overlay %d\n",
- int(frame.left), int(frame.top), int(frame.right),
int(frame.bottom), int(cspace), overlay);
+ //printf("VideoNode::CreateBuffers: frame %d,%d,%d,%d colorspace
0x%08x, overlay %d\n",
+ // int(frame.left), int(frame.top), int(frame.right),
int(frame.bottom), int(cspace), overlay);
LockBitmap();
ASSERT(fBitmap == 0);
@@ -353,12 +380,12 @@
fBitmap = 0;
fOverlayActive = false;
UnlockBitmap();
- printf("VideoNode::CreateBuffers failed\n");
+ fprintf(stderr, "VideoNode::CreateBuffers failed\n");
return B_ERROR;
}
fOverlayActive = overlay;
UnlockBitmap();
- printf("VideoNode::CreateBuffers success\n");
+
return B_OK;
}
@@ -371,3 +398,16 @@
fBitmap = NULL;
UnlockBitmap();
}
+
+
+void
+VideoNode::_InitDisplay()
+{
+ // TODO: Get rid of hardcoded values
+ BRect size(0,0,320,240);
+ fVideoView = new VideoView(size, "Video View", B_FOLLOW_ALL_SIDES,
B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE, this);
+
+ size.OffsetBy(40.f, 40.f);
+ fWindow = new VideoWindow(size, fVideoView);
+ fWindow->Show();
+}
diff -dur
../../../../../haiku/src/add-ons/media/media-add-ons/videowindow/VideoNode.h
./videowindow/VideoNode.h
---
../../../../../haiku/src/add-ons/media/media-add-ons/videowindow/VideoNode.h
2008-03-02 16:55:54.000000000 +0100
+++ ./videowindow/VideoNode.h 2008-03-02 16:15:41.000000000 +0100
@@ -1,25 +1,34 @@
/*
* Copyright (C) 2006 Marcus Overhagen <marcus@xxxxxxxxxxxx>. All rights
reserved.
+ * Copyright (C) 2008 Maurice Kalinowski <haiku@xxxxxxxxxxxxx>. All rights
reserved.
*
* Distributed under the terms of the MIT License.
*/
#ifndef __VIDEO_NODE_H_
#define __VIDEO_NODE_H_
+
#include <BufferConsumer.h>
#include <MediaEventLooper.h>
+
+class BBitmap;
+class BLocker;
+class BWindow;
class VideoView;
+class VideoWindow;
+
class VideoNode : public BMediaEventLooper, public BBufferConsumer
{
public:
- VideoNode(const char *name, VideoView
*view);
+ VideoNode(const char *name);
+ VideoNode(const char *name,
BMediaAddOn* addon, int32 id);
~VideoNode();
void SetOverlayEnabled(bool yesno);
bool IsOverlayActive();
-
+
void LockBitmap();
BBitmap * Bitmap();
void UnlockBitmap();
@@ -52,7 +61,7 @@
const media_destination
&dst,
int32 status,
bigtime_t
at_media_time);
-
+
status_t GetLatencyFor(
const media_destination
&dst,
bigtime_t *out_latency,
@@ -74,12 +83,13 @@
int32 from_change_count,
const media_format
&format);
-protected:
void HandleBuffer(BBuffer *buffer);
status_t CreateBuffers(BRect frame, color_space cspace,
bool overlay);
void DeleteBuffers();
-protected:
+private:
+ void _InitDisplay();
+ VideoWindow * fWindow;
VideoView * fVideoView;
media_input fInput;
bool fOverlayEnabled;
@@ -87,6 +97,8 @@
bool fDirectOverlayBuffer; // If the overlay
memory is directly written by the producer node.
BBitmap * fBitmap;
BLocker * fBitmapLocker;
+ BMediaAddOn* fAddOn;
+ int32 fInternalFlavorId;
};
#endif
diff -dur
../../../../../haiku/src/add-ons/media/media-add-ons/videowindow/VideoView.cpp
./videowindow/VideoView.cpp
---
../../../../../haiku/src/add-ons/media/media-add-ons/videowindow/VideoView.cpp
2008-03-02 16:55:54.000000000 +0100
+++ ./videowindow/VideoView.cpp 2008-03-02 16:06:12.000000000 +0100
@@ -3,39 +3,32 @@
*
* Distributed under the terms of the MIT License.
*/
+#include "VideoNode.h"
+#include "VideoView.h"
+#include "debug.h"
+
#include <Bitmap.h>
+#include <Locker.h>
#include <MediaRoster.h>
-#include "VideoView.h"
-#include "VideoNode.h"
+#include <Message.h>
+
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
-VideoView::VideoView(BRect frame, const char *name, uint32 resizeMask, uint32
flags)
+
+VideoView::VideoView(BRect frame, const char *name, uint32 resizeMask, uint32
flags, VideoNode *node)
: BView(frame, name, resizeMask, flags)
- , fVideoNode(0)
+ , fVideoNode(node)
, fOverlayActive(false)
{
SetViewColor(B_TRANSPARENT_COLOR);
-
- status_t err = B_OK;
- BMediaRoster *mroster = BMediaRoster::Roster(&err);
- if (!mroster || err) {
- printf("VideoView::VideoView: media_server is dead\n");
- exit(1);
- } else {
- fVideoNode = new VideoNode("video in", this);
- err = mroster->RegisterNode(fVideoNode);
- }
}
VideoView::~VideoView()
{
- if (fVideoNode) {
- BMediaRoster::Roster()->UnregisterNode(fVideoNode);
- delete fVideoNode;
- }
}
@@ -55,14 +48,14 @@
void
VideoView::OverlayLockAcquire()
{
- printf("VideoView::OverlayLockAcquire\n");
+ CALLED();
}
void
VideoView::OverlayLockRelease()
{
- printf("VideoView::OverlayLockRelease\n");
+ CALLED();
// overlaybitmap->UnlockBits
}
@@ -70,7 +63,7 @@
void
VideoView::OverlayScreenshotPrepare()
{
- printf("OverlayScreenshotPrepare enter\n");
+ CALLED();
/*
fVideoNode->LockBitmap();
if (fOverlayActive) {
@@ -88,14 +81,13 @@
}
fVideoNode->UnlockBitmap();
*/
- printf("OverlayScreenshotPrepare leave\n");
}
void
VideoView::OverlayScreenshotCleanup()
{
- printf("OverlayScreenshotCleanup enter\n");
+ CALLED();
/*
snooze(50000); // give app server some time to take the screenshot
fVideoNode->LockBitmap();
@@ -110,15 +102,14 @@
}
fVideoNode->UnlockBitmap();
*/
- printf("OverlayScreenshotCleanup leave\n");
}
void
VideoView::RemoveVideoDisplay()
{
- printf("VideoView::RemoveVideoDisplay\n");
-
+ CALLED();
+
if (fOverlayActive) {
ClearViewOverlay();
fOverlayActive = false;
@@ -130,7 +121,7 @@
void
VideoView::RemoveOverlay()
{
- printf("VideoView::RemoveOverlay\n");
+ CALLED();
if (LockLooperWithTimeout(50000) == B_OK) {
ClearViewOverlay();
fOverlayActive = false;
@@ -148,7 +139,10 @@
} else {
fVideoNode->LockBitmap();
BBitmap *bmp = fVideoNode->Bitmap();
- if (bmp)
+ if (!bmp) {
+ SetHighColor(0, 0, 0, 0);
+ FillRect(updateRect);
+ } else
DrawBitmap(bmp, Bounds());
fVideoNode->UnlockBitmap();
}
@@ -158,8 +152,8 @@
void
VideoView::DrawFrame()
{
-// printf("VideoView::DrawFrame\n");
-
+ //CALLED();
+
bool want_overlay = fVideoNode->IsOverlayActive();
if (!want_overlay && fOverlayActive) {
@@ -168,9 +162,10 @@
UnlockLooper();
fOverlayActive = false;
} else {
- printf("can't ClearViewOverlay, as
LockLooperWithTimeout failed\n");
+ fprintf(stderr, "VideoView::DrawFrame: cannot
ClearViewOverlay, as LockLooperWithTimeout failed\n");
}
}
+
if (want_overlay && !fOverlayActive) {
fVideoNode->LockBitmap();
BBitmap *bmp = fVideoNode->Bitmap();
@@ -247,4 +242,3 @@
}
return supported;
}
-
diff -dur
../../../../../haiku/src/add-ons/media/media-add-ons/videowindow/VideoView.h
./videowindow/VideoView.h
---
../../../../../haiku/src/add-ons/media/media-add-ons/videowindow/VideoView.h
2008-03-02 16:55:54.000000000 +0100
+++ ./videowindow/VideoView.h 2008-03-02 16:06:24.000000000 +0100
@@ -6,19 +6,23 @@
#ifndef __VIDEO_VIEW_H
#define __VIDEO_VIEW_H
+
#include <View.h>
+
+class BMediaAddOn;
class VideoNode;
+
class VideoView : public BView
{
public:
- VideoView(BRect frame, const char
*name, uint32 resizeMask, uint32 flags);
+ VideoView(BRect frame, const char
*name, uint32 resizeMask, uint32 flags, VideoNode *node);
~VideoView();
-
+
void RemoveVideoDisplay();
void RemoveOverlay();
-
+
VideoNode * Node();
bool IsOverlaySupported();
@@ -28,14 +32,14 @@
void OverlayScreenshotPrepare();
void OverlayScreenshotCleanup();
-
+
void DrawFrame();
private:
void AttachedToWindow();
void MessageReceived(BMessage *msg);
void Draw(BRect updateRect);
-
+
private:
VideoNode * fVideoNode;
bool fOverlayActive;
diff -dur
../../../../../haiku/src/add-ons/media/media-add-ons/videowindow/VideoWindow.cpp
./videowindow/VideoWindow.cpp
---
../../../../../haiku/src/add-ons/media/media-add-ons/videowindow/VideoWindow.cpp
2008-03-02 16:55:54.000000000 +0100
+++ ./videowindow/VideoWindow.cpp 2008-03-02 15:38:46.000000000 +0100
@@ -1,11 +1,30 @@
/*
- * Copyright (C) 2006 Marcus Overhagen <marcus@xxxxxxxxxxxx>. All rights
reserved.
+ * Copyright (C) 2006-2008 Marcus Overhagen <marcus@xxxxxxxxxxxx>. All rights
reserved.
+ * Copyright (C) 2008 Maurice Kalinowski <haiku@xxxxxxxxxxxxx>. All rights
reserved.
*
* Distributed under the terms of the MIT License.
*/
-#include "VideoView.h"
-#include "VideoNode.h"
#include "VideoWindow.h"
+#include "VideoView.h"
-#include <stdio.h>
-#include <string.h>
+
+VideoWindow::VideoWindow(BRect size, VideoView* view)
+ : BWindow(size, "Video Window", B_TITLED_WINDOW, 0)
+ , fVideoView(view)
+{
+ if (fVideoView)
+ AddChild(fVideoView);
+}
+
+
+VideoWindow::~VideoWindow()
+{
+}
+
+
+void
+VideoWindow::MessageReceived(BMessage *msg)
+{
+ if (msg)
+ BWindow::MessageReceived(msg);
+}
diff -dur
../../../../../haiku/src/add-ons/media/media-add-ons/videowindow/VideoWindow.h
./videowindow/VideoWindow.h
---
../../../../../haiku/src/add-ons/media/media-add-ons/videowindow/VideoWindow.h
2008-03-02 16:55:54.000000000 +0100
+++ ./videowindow/VideoWindow.h 2008-03-02 16:06:58.000000000 +0100
@@ -1,24 +1,27 @@
/*
- * Copyright (C) 2006 Marcus Overhagen <marcus@xxxxxxxxxxxx>. All rights
reserved.
+ * Copyright (C) 2006-2008 Marcus Overhagen <marcus@xxxxxxxxxxxx>. All rights
reserved.
+ * Copyright (C) 2008 Maurice Kalinowski <haiku@xxxxxxxxxxxxx>. All rights
reserved.
*
* Distributed under the terms of the MIT License.
*/
#ifndef __VIDEO_WINDOW_H
#define __VIDEO_WINDOW_H
+
#include <Window.h>
-class VideoNode;
+
class VideoView;
+
class VideoWindow : public BWindow
{
public:
+ VideoWindow(BRect size, VideoView* view);
+ ~VideoWindow();
+ void MessageReceived(BMessage *msg);
private:
-
-private:
- VideoNode * fVideoNode;
VideoView * fVideoView;
};
|

|