2 * Copyright (C) 2006-2008 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 #include "VideoAddOn.h"
17 VideoWindowAddOn::VideoWindowAddOn(image_id id
)
22 fInputFormat
.type
= B_MEDIA_RAW_VIDEO
;
23 fInputFormat
.u
.raw_video
= media_raw_video_format::wildcard
;
25 fInfo
.internal_id
= 0;
26 fInfo
.name
= strdup("VideoWindow Consumer");
27 fInfo
.info
= strdup("This node displays a simple video window");
28 fInfo
.kinds
= B_BUFFER_CONSUMER
;
29 fInfo
.flavor_flags
= 0;
30 fInfo
.possible_count
= 0;
31 fInfo
.in_format_count
= 1;
32 fInfo
.in_format_flags
= 0;
33 fInfo
.in_formats
= &fInputFormat
;
34 fInfo
.out_format_count
= 0;
35 fInfo
.out_formats
= 0;
36 fInfo
.out_format_flags
= 0;
40 VideoWindowAddOn::~VideoWindowAddOn()
47 VideoWindowAddOn::WantsAutoStart()
55 VideoWindowAddOn::CountFlavors()
63 VideoWindowAddOn::GetFlavorAt(int32 cookie
, const flavor_info
**flavorInfo
)
68 if (!flavorInfo
|| !*flavorInfo
)
77 VideoWindowAddOn::InstantiateNodeFor(const flavor_info
*info
, BMessage
*, status_t
*outError
)
83 if (info
->in_formats
[0].type
!= B_MEDIA_RAW_VIDEO
) {
84 *outError
= B_MEDIA_BAD_FORMAT
;
89 if (info
->in_formats
[0].u
.raw_video
.display
.line_width
!= 0)
90 size
.right
= info
->in_formats
[0].u
.raw_video
.display
.line_width
;
93 if (info
->in_formats
[0].u
.raw_video
.display
.line_count
!= 0)
94 size
.bottom
= info
->in_formats
[0].u
.raw_video
.display
.line_count
;
98 VideoNode
* node
= new VideoNode("Video Node", this, info
->internal_id
);
104 extern "C" BMediaAddOn
*make_media_addon(image_id id
)
106 return new VideoWindowAddOn(id
);