video_mixer: Fix build

* Unfortunately it's crashing the media_addon_server
at startup.
This commit is contained in:
Dario Casalinuovo 2016-02-13 16:00:14 +01:00
parent 44200efd5d
commit 127a93c293
7 changed files with 42 additions and 29 deletions

View File

@ -57,16 +57,17 @@ BufferMixer::Merge(BBuffer *input, BBuffer *output) {
uint32 size = input->Header()->size_used / 4;
uint8 alpha = 0;
uint8 c1, c2, c3;
for (uint32 i=0; i<size; i++) {
c1 = *source++;
c2 = *source++;
c3 = *source++;
alpha = *source++;
*destination++ = ALPHABLEND(c1, *destination, alpha);
*destination++ = ALPHABLEND(c2, *destination, alpha);
*destination++ = ALPHABLEND(c3, *destination, alpha);
*destination++ = 0x00;
*(destination) = ALPHABLEND(c1, *destination, alpha);
*(destination+1) = ALPHABLEND(c2, *destination, alpha);
*(destination+2) = ALPHABLEND(c3, *destination, alpha);
*(destination+3) = 0x00;
destination += 4;
}
}
@ -91,7 +92,7 @@ void
BufferMixer::RemoveBuffer(int32 id) {
BBuffer *oldBuffer;
if (id < groupedBuffers.size()) {
if (uint32(id) < groupedBuffers.size()) {
oldBuffer = groupedBuffers[id];
groupedBuffers[id] = NULL;

View File

@ -14,7 +14,7 @@ for architectureObject in [ MultiArchSubDirSetup ] {
CpuCapabilities.cpp
BufferMixer.cpp
yuvrgb.nasm
: be media
: be media [ TargetLibsupc++ ] [ TargetLibstdc++ ]
;
}
}

View File

@ -21,6 +21,8 @@
#include "VideoMixerNode.h"
using std::vector;
VideoMixerNode::~VideoMixerNode(void)
{
fprintf(stderr,"VideoMixerNode::~VideoMixerNode\n");
@ -29,9 +31,9 @@ VideoMixerNode::~VideoMixerNode(void)
}
VideoMixerNode::VideoMixerNode(
const flavor_info *info = 0,
BMessage *config = 0,
BMediaAddOn *addOn = 0)
const flavor_info *info,
BMessage *config,
BMediaAddOn *addOn)
: BMediaNode("VideoMixerNode"),
BBufferConsumer(B_MEDIA_RAW_VIDEO), // Raw video buffers in
BBufferProducer(B_MEDIA_RAW_VIDEO), // Raw video buffers out
@ -303,8 +305,9 @@ void VideoMixerNode::GetFlavor(flavor_info *outInfo, int32 id)
if (outInfo != NULL) {
outInfo->internal_id = id;
outInfo->name = "Haiku VideoMixer";
outInfo->info = "A VideoMixerNode node mixes multiple video streams into a single stream.";
strcpy(outInfo->name, "Haiku VideoMixer");
strcpy(outInfo->info, "A VideoMixerNode node mixes multiple video"
" streams into a single stream.");
outInfo->kinds = B_BUFFER_CONSUMER | B_BUFFER_PRODUCER;
outInfo->flavor_flags = B_FLAVOR_IS_LOCAL;
outInfo->possible_count = INT_MAX; // no limit

View File

@ -12,6 +12,8 @@
#include "VideoMixerNode.h"
#include <stdio.h>
// -------------------------------------------------------- //
// implemention of BBufferConsumer
@ -46,7 +48,7 @@ status_t VideoMixerNode::GetNextInput(
fprintf(stderr,"VideoMixerNode(BBufferConsumer)::GetNextInput (%ld)\n",*cookie);
// Cookie 0 is the connecting input, all others are connected inputs
if (*cookie == fConnectedInputs.size()) {
if (uint32(*cookie) == fConnectedInputs.size()) {
*out_input = fInitialInput;
} else {
out_input = GetInput(*cookie);

View File

@ -12,6 +12,9 @@
#include "VideoMixerNode.h"
#include <stdio.h>
// -------------------------------------------------------- //
// implementation for BMediaEventLooper
// -------------------------------------------------------- //
@ -19,7 +22,7 @@
void VideoMixerNode::HandleEvent(
const media_timed_event *event,
bigtime_t lateness,
bool realTimeEvent = false)
bool realTimeEvent)
{
switch (event->type) {
case BTimedEventQueue::B_START:
@ -80,7 +83,7 @@ void VideoMixerNode::ControlLoop() {
status_t VideoMixerNode::HandleStart(
const media_timed_event *event,
bigtime_t lateness,
bool realTimeEvent = false)
bool realTimeEvent)
{
fprintf(stderr,"VideoMixerNode(BMediaEventLooper)::HandleStart()\n");
if (RunState() != B_STARTED) {
@ -94,7 +97,7 @@ status_t VideoMixerNode::HandleStart(
status_t VideoMixerNode::HandleSeek(
const media_timed_event *event,
bigtime_t lateness,
bool realTimeEvent = false)
bool realTimeEvent)
{
fprintf(stderr,"VideoMixerNode(BMediaEventLooper)::HandleSeek(t=%lld,d=%ld,bd=%lld)\n",event->event_time, event->data, event->bigdata);
return B_OK;
@ -103,7 +106,7 @@ status_t VideoMixerNode::HandleSeek(
status_t VideoMixerNode::HandleWarp(
const media_timed_event *event,
bigtime_t lateness,
bool realTimeEvent = false)
bool realTimeEvent)
{
fprintf(stderr,"VideoMixerNode(BMediaEventLooper)::HandleWarp\n");
return B_OK;
@ -112,7 +115,7 @@ status_t VideoMixerNode::HandleWarp(
status_t VideoMixerNode::HandleStop(
const media_timed_event *event,
bigtime_t lateness,
bool realTimeEvent = false)
bool realTimeEvent)
{
fprintf(stderr,"VideoMixerNode(BMediaEventLooper)::HandleStop\n");
// flush the queue so downstreamers don't get any more
@ -123,7 +126,7 @@ status_t VideoMixerNode::HandleStop(
status_t VideoMixerNode::HandleBuffer(
const media_timed_event *event,
bigtime_t lateness,
bool realTimeEvent = false)
bool realTimeEvent)
{
if (event->type != BTimedEventQueue::B_HANDLE_BUFFER) {
fprintf(stderr,"HandleBuffer called on non buffer event type\n");
@ -165,7 +168,7 @@ status_t VideoMixerNode::HandleBuffer(
status_t VideoMixerNode::HandleDataStatus(
const media_timed_event *event,
bigtime_t lateness,
bool realTimeEvent = false)
bool realTimeEvent)
{
fprintf(stderr,"VideoMixerNode(BMediaEventLooper)::HandleDataStatus");
SendDataStatus(event->data, fOutput.destination, event->event_time);
@ -175,7 +178,7 @@ status_t VideoMixerNode::HandleDataStatus(
status_t VideoMixerNode::HandleParameter(
const media_timed_event *event,
bigtime_t lateness,
bool realTimeEvent = false)
bool realTimeEvent)
{
fprintf(stderr,"VideoMixerNode(BMediaEventLooper)::HandleParameter");
return B_OK;

View File

@ -12,6 +12,10 @@
#include "VideoMixerNode.h"
#include <stdio.h>
#include <string.h>
// -------------------------------------------------------- //
// implemention of BBufferProducer
// -------------------------------------------------------- //

View File

@ -212,16 +212,16 @@ Const128 dw 128
dw 128
; void Convert_YUV422_RGBA32_SSE2(void *fromPtr, void *toPtr, int width)
width equ ebp+16
toPtr equ ebp+12
fromPtr equ ebp+8
%define width ebp+16
%define toPtr ebp+12
%define fromPtr ebp+8
; void Convert_YUV420P_RGBA32_SSE2(void *fromYPtr, void *fromUPtr, void *fromVPtr, void *toPtr, int width)
width1 equ ebp+24
toPtr1 equ ebp+20
fromVPtr equ ebp+16
fromUPtr equ ebp+12
fromYPtr equ ebp+8
%define width1 ebp+24
%define toPtr1 ebp+20
%define fromVPtr ebp+16
%define fromUPtr ebp+12
%define fromYPtr ebp+8
SECTION .text align=16