[haiku-commits] haiku: hrev50083 - src/add-ons/media/media-add-ons/video_mixer

  • From: b.vitruvio@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 13 Feb 2016 16:11:26 +0100 (CET)

hrev50083 adds 1 changeset to branch 'master'
old head: 44200efd5d6927b55ab8ef6be8e66b2e478c5f04
new head: 127a93c293ce5174cbaa82ad9e85c827d1a4bc9e
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=127a93c293ce+%5E44200efd5d69

----------------------------------------------------------------------------

127a93c293ce: video_mixer: Fix build
  
  * Unfortunately it's crashing the media_addon_server
  at startup.

                                [ Dario Casalinuovo <b.vitruvio@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev50083
Commit:      127a93c293ce5174cbaa82ad9e85c827d1a4bc9e
URL:         http://cgit.haiku-os.org/haiku/commit/?id=127a93c293ce
Author:      Dario Casalinuovo <b.vitruvio@xxxxxxxxx>
Date:        Sat Feb 13 15:00:14 2016 UTC

----------------------------------------------------------------------------

7 files changed, 42 insertions(+), 29 deletions(-)
.../media-add-ons/video_mixer/BufferMixer.cpp     | 13 +++++++------
.../media/media-add-ons/video_mixer/Jamfile       |  2 +-
.../media-add-ons/video_mixer/VideoMixerNode.cpp  | 13 ++++++++-----
.../video_mixer/VideoMixerNodeConsumer.cpp        |  4 +++-
.../video_mixer/VideoMixerNodeEventLooper.cpp     | 19 +++++++++++--------
.../video_mixer/VideoMixerNodeProducer.cpp        |  4 ++++
.../media/media-add-ons/video_mixer/yuvrgb.nasm   | 16 ++++++++--------

----------------------------------------------------------------------------

diff --git a/src/add-ons/media/media-add-ons/video_mixer/BufferMixer.cpp 
b/src/add-ons/media/media-add-ons/video_mixer/BufferMixer.cpp
index 36a0942..1e5df28 100644
--- a/src/add-ons/media/media-add-ons/video_mixer/BufferMixer.cpp
+++ b/src/add-ons/media/media-add-ons/video_mixer/BufferMixer.cpp
@@ -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;
        
diff --git a/src/add-ons/media/media-add-ons/video_mixer/Jamfile 
b/src/add-ons/media/media-add-ons/video_mixer/Jamfile
index dfe7e3a..f41d494 100644
--- a/src/add-ons/media/media-add-ons/video_mixer/Jamfile
+++ b/src/add-ons/media/media-add-ons/video_mixer/Jamfile
@@ -14,7 +14,7 @@ for architectureObject in [ MultiArchSubDirSetup ] {
                        CpuCapabilities.cpp
                        BufferMixer.cpp
                        yuvrgb.nasm
-                       : be media
+                       : be media [ TargetLibsupc++ ] [ TargetLibstdc++ ]
                ;
        }
 }
diff --git a/src/add-ons/media/media-add-ons/video_mixer/VideoMixerNode.cpp 
b/src/add-ons/media/media-add-ons/video_mixer/VideoMixerNode.cpp
index 5970202..e85e125 100644
--- a/src/add-ons/media/media-add-ons/video_mixer/VideoMixerNode.cpp
+++ b/src/add-ons/media/media-add-ons/video_mixer/VideoMixerNode.cpp
@@ -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
diff --git 
a/src/add-ons/media/media-add-ons/video_mixer/VideoMixerNodeConsumer.cpp 
b/src/add-ons/media/media-add-ons/video_mixer/VideoMixerNodeConsumer.cpp
index eae92a0..9fbedb4 100644
--- a/src/add-ons/media/media-add-ons/video_mixer/VideoMixerNodeConsumer.cpp
+++ b/src/add-ons/media/media-add-ons/video_mixer/VideoMixerNodeConsumer.cpp
@@ -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);
diff --git 
a/src/add-ons/media/media-add-ons/video_mixer/VideoMixerNodeEventLooper.cpp 
b/src/add-ons/media/media-add-ons/video_mixer/VideoMixerNodeEventLooper.cpp
index 639d070..c2c4be1 100644
--- a/src/add-ons/media/media-add-ons/video_mixer/VideoMixerNodeEventLooper.cpp
+++ b/src/add-ons/media/media-add-ons/video_mixer/VideoMixerNodeEventLooper.cpp
@@ -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;
diff --git 
a/src/add-ons/media/media-add-ons/video_mixer/VideoMixerNodeProducer.cpp 
b/src/add-ons/media/media-add-ons/video_mixer/VideoMixerNodeProducer.cpp
index ab4b86e..8fa016b 100644
--- a/src/add-ons/media/media-add-ons/video_mixer/VideoMixerNodeProducer.cpp
+++ b/src/add-ons/media/media-add-ons/video_mixer/VideoMixerNodeProducer.cpp
@@ -12,6 +12,10 @@
 
 #include "VideoMixerNode.h"
 
+#include <stdio.h>
+#include <string.h>
+
+
 // -------------------------------------------------------- //
 // implemention of BBufferProducer
 // -------------------------------------------------------- //
diff --git a/src/add-ons/media/media-add-ons/video_mixer/yuvrgb.nasm 
b/src/add-ons/media/media-add-ons/video_mixer/yuvrgb.nasm
index 0cabc75..ad11d5c 100644
--- a/src/add-ons/media/media-add-ons/video_mixer/yuvrgb.nasm
+++ b/src/add-ons/media/media-add-ons/video_mixer/yuvrgb.nasm
@@ -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
 


Other related posts: