Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
54 user(s) are online (38 user(s) are browsing Forums)

Members: 1
Guests: 53

Rigo, more...

Support us!

Recent OS4 Files
OS4Depot.net




« 1 ... 3 4 5 (6) 7 8 9 ... 15 »


Re: Odyssey's MediaPlayer thread
Home away from home
Joined:
2007/1/26 21:48
From New Zealand
Posts: 2310
@kas1e

Quote:
Or it needit src/dest in any case even for querying hardware support ?

You need source and destination bitmaps. Ideally, the destination would be locked to the target graphics card too, for dual graphics card systems. Otherwise the graphics library might just move the bitmaps to a different card.

Hans

   Report Go to top

Re: Odyssey's MediaPlayer thread
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6343
@Capehill
Quote:

I'm trying to merge this with the other patches using git. There are some compiler warnings:

1) Rect k used uninitialized (declared near 3787)

2) Arithmetic on void pointer (near 4234). These "APTR pY, pCb, pCr;" should be declared as "uint8 *".


Checked your compositing-ami603-kas1e branch. And yeah! It works same as for us, just without CGX, cool! Through found few moments:

1). Where things should be "black" (on the borders of the window when resized, they now not cleaned and keep show previous content. That something about fillrect i assume and color_key / value spend too. Maybe it just difference between FillPixelArray from CGX5, and RectFillColor from graphics.library ? Will check with CGX5's FillPixelArray if it make difference indeed.

2) Found that in latest commit you overwrite WritePixelArraysAlpha() functions with wrong ones (not in owbbrowserclass, but in other files), while should keep just WritePixelArraysAlpha as in original , as it now implemented in os4funcs.cpp, etc. Not big deal, as it just branch about compositing, but still to not traps with issues later if use that branch :)

Also, i not sure, but do need all that "vertex" stuff in compositeHookFunc() what you think ? Hans says before we didn't need that.


Edited by kas1e on 2020/3/30 12:16:53
Edited by kas1e on 2020/3/30 12:18:14
   Report Go to top

Re: Odyssey's MediaPlayer thread
Just popping in
Joined:
2006/12/27 21:09
Posts: 86
@kas1e

The vertex stuff was used because in my experience i had lots of trouble when using the SrcWidth, SrcHeight, scale stuff, and with vertex you don't need to bother with scalex/y calculations etc.
Feel free to change it if you think the code is clearer.

   Report Go to top

Re: Odyssey's MediaPlayer thread
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6343
@Ami603
Ah, ok , got it. Then probabaly better to keep it as it. Now only to understand why when we switch to another tab video continue to be played in new tabs instead of keeps out in tab when it open.

   Report Go to top

Re: Odyssey's MediaPlayer thread
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1085
@kas1e

Quote:

Checked your compositing-ami603-kas1e branch. And yeah! It works same as for us, just without CGX, cool! Through found few moments:


Some things went wrong during merge...

I reset git history approximately to the point where you started your patch, and then tried to merge the newer patches on top of that, fixing the conflicts.

Quote:

1). Where things should be "black" (on the borders of the window when resized, they now not cleaned and keep show previous content. That something about fillrect i assume and color_key / value spend too. Maybe it just difference between FillPixelArray from CGX5, and RectFillColor from graphics.library ? Will check with CGX5's FillPixelArray if it make difference indeed.


Does this happen only with my branch? Can you see which merge failed?

Quote:

2) Found that in latest commit you overwrite WritePixelArraysAlpha() functions with wrong ones (not in owbbrowserclass, but in other files), while should keep just WritePixelArraysAlpha as in original , as it now implemented in os4funcs.cpp, etc. Not big deal, as it just branch about compositing, but still to not traps with issues later if use that branch :)


Yes, this one I noticed only after git push :( This should be simple to fix though. My bad totally.

PS. some of the new compiler warnings are still not fixed.

   Report Go to top

Re: Odyssey's MediaPlayer thread
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6343
@Capehill
Quote:

Does this happen only with my branch? Can you see which merge failed?


I added now for a test back CGX5's FillPixelArray() instead of graphics's library RectFillColor() in 2 places : and have borders be black again.

So it seems that RectFillColor() or works differently, or have bug in terms of applying that "0x000000" part, or some bug somewhere else we had now (maybe something with _rp(obj) part or so ?). I even tried to replace 0x00000000 on 0xFFFFFFFF just in case for RectFillColor, but that change nothing too.

In other words simple doing this:

/* draw rects, if visible */
    
if (data->video_x_offset || data->video_y_offset)
    {
        if (
IsValidRect(&b1))
        {
            
/*RectFillColor*/FillPixelArray(_rp(obj), b1.MinXb1.MinY,
                            
b1.MaxX b1.MinX 1b1.MaxY b1.MinY 1,
                            
0x00000000);
        }

        if (
IsValidRect(&b2))
        {
            
/*RectFillColor*/FillPixelArray(_rp(obj), b2.MinXb2.MinY,
                            
b2.MaxX b2.MinX 1b2.MaxY b2.MinY 1,
                            
0x00000000);
        }
    }


(with commenting out all other CGX functions in their includes, and using graphics.library ones for all other parts, but only use FillPixelArray from CGX) , make black borders be there.

   Report Go to top

Re: Odyssey's MediaPlayer thread
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1085
@kas1e

FillPixelArray seems to use width and height params, while RectFillColor needs maxX and maxY instead of.

   Report Go to top

Re: Odyssey's MediaPlayer thread
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6343
@Capehill
Yeah, Ami603 help with as well, so now all fine.

@Capehill,Ami603
Now probabaly i can remove ifdefs, check that all ok , and commit it. And then on top of that we will need to fix checking on compositing and fallback to how it was without, and find out how to fix issue with Tabs and that all. Everyone agree ?:)

   Report Go to top

Re: Odyssey's MediaPlayer thread
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1085
@kas1e

For me the video is not correctly clipped. Have to test it more and fix it.

   Report Go to top

Re: Odyssey's MediaPlayer thread
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6343
@Capehill

That because of Fillrect/Rectfill diffs probabaly (you visually see that it's not clipped probabaly).

Should be like this:

/* draw rects, if visible */
    
if (data->video_x_offset || data->video_y_offset)
    {
        if (
IsValidRect(&b1))
        {
            
RectFillColor(_rp(obj), b1.MinXb1.MinY,
                            
b1.MaxX 1b1.MaxY 1,
                            
0xFF000000);
        }

        if (
IsValidRect(&b2))
        {
            
RectFillColor(_rp(obj), b2.MinXb2.MinY,
                            
b2.MaxX 1b2.MaxY 1,
                            
0xFF000000);
        }
    }

    if (
IsValidRect(&k))
    {
            
RectFillColor(_rp(obj), data->rect.MinXdata->rect.MinY,
                        
data->rect.MaxX 1data->rect.MaxY 1,
                        
0xFF000000); // we don't need color key for compositing
                        
            //printf("after FillPixelArray k.MinX = %d, k.MinY = %d, k.MaxY = %d, k.MaxX = %dn", k.MinX, k.MinY,k.MaxY, k.MaxX);

            
data->vleft k.MinX;
            
data->vright k.MaxX k.MinX 1;
            
data->vtop k.MinY;
            
data->vbottom k.MaxY k.MinY 1;
    }


   Report Go to top

Re: Odyssey's MediaPlayer thread
Just popping in
Joined:
2006/12/27 21:09
Posts: 86
@kas1e

That thing didn't work as expected, thus we added a struct rectangle inside struct data instead of the single variables.


data->rect.MinX = left + data->video_x_offset;
data->rect.MinY = top + data->video_y_offset;
data->rect.MaxX = right - data->video_x_offset;
data->rect.MaxY = bottom - data->video_y_offset;

AndRectRect(&data->rect, &bounds);

   Report Go to top

Re: Odyssey's MediaPlayer thread
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6343
@Capehill
Tried with Ami603 today all kind of stuff, but still can't get why video in fullscreen mode renders-copy to the new tabs. And only video. Buttons, all those borders-fillrects are where they should be: in the video tab, but video itself renders to all the newly opened tabs.

Its probabaly something at the begining of DEFSMETHOD(OWBBrowser_VideoBlit), where we do "if(msg->src && msg->stride && lock != NULL)".

Originally for morphos it was "if(data->video_handle && msg->src && msg->stride && LockVLayer(data->video_handle))", but not sure if that the only enough to detect if we have active tab with video or not.

We should't blit if the tab not active, but how it works originally for mos i can't get. Maybe that "data->video_handle" value somehow make difference, or that its LockVLayer called and fail/not-fail when tab active/notactive, dunno. Maybe some ifdefs borks somewhere, or "if compositing==1" checks.

   Report Go to top

Re: Odyssey's MediaPlayer thread
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1085
@kas1e

On MorphOS, does the video keep on playing on a background tab (is there sound?), also does it stay in fullscreen or not?

I'm trying to figure out should there be an exit from this fullscreen mode, or not.

   Report Go to top

Re: Odyssey's MediaPlayer thread
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6343
@Capehill

Some news : right now after lot of check Ami603 was able to fix issues with "video renders in another tab". Now we fighting with issues that on peg2 we crashes, as didn't check properly on if compositing available, dealing with it now.


Quote:

On MorphOS, does the video keep on playing on a background tab (is there sound?), also does it stay in fullscreen or not?


Yes and yes. For us its the same now.

Quote:

I'm trying to figure out should there be an exit from this fullscreen mode, or not.


If you mean "iconify" then on morphos after we iconify and de-iconify back, it then swith to window mode, yes.

In other words, i hope today we will deal why it crashes on peg2, then i will made a commit + beta05, and since that one we can start dealing with little bugs if we will have any.

Good news, is that in compare with CGX5 on morphos, we can have many videos played in different tabs. Not just one overlay one , but many. I tried now just open 3 tabs, 3 different videos and hit them all to fullscreen : works !:) Just that damn "exclusive ahi" kill the fun, as if mediaplayer works, no other sound/music from anything else (even from another instanses of mediaplayer" will work. But that probabaly can be deal with later.

   Report Go to top

Re: Odyssey's MediaPlayer thread
Quite a regular
Joined:
2007/2/6 13:57
From Donostia (SPAIN)
Posts: 544
Great update/news!!!!

About the ahi sound problem, maybe changing to use other mode (unit0,.. instead of music_unit) not sure.

   Report Go to top

Re: Odyssey's MediaPlayer thread
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6343
Well no beta today, hope tomorrow. Issue we find now, is that something seems wrong with return values of compositetags call when we call it on hardware which not support composite-video, but when our call are with "verticies".

And while Without "verticies" we have not crash on cards with no-compositing, we have no rendering on cards with compositing :) So that need to be deal with.

Ami603 probabaly will cry soon :)

   Report Go to top

Re: Odyssey's MediaPlayer thread
Quite a regular
Joined:
2007/2/6 13:57
From Donostia (SPAIN)
Posts: 544
In Hans De Ruiter CompositeYUV.c example, there is a code that checks for compositeavail or not:

// Test if composited video is available
uint32 fillWindowWithBitMap(struct BitMap *bitMapstruct Window *window)
{
    
// Need to composite onto the window's rastport. Since CompositeTags() only renders to bitmaps,
    // we use ILayers->DoHookClipRects().
    
CompositeHookData hookData;
    
struct Rectangle rect;
    
struct Hook hook;

     
rect.MinX window->BorderLeft;
     
rect.MinY window->BorderTop;
     
rect.MaxX window->Width window->BorderRight 1;
     
rect.MaxY window->Height window->BorderBottom 1;
     
float destWidth rect.MaxX rect.MinX 1;
     
float destHeight rect.MaxY rect.MinY 1;
     
float scaleX = (destWidth 0.5f) / SOURCE_WIDTH;
     
float scaleY = (destHeight 0.5f) / SOURCE_HEIGHT;

    
hookData.srcBitMap bitMap;
    
hookData.srcWidth SOURCE_WIDTH;
    
hookData.srcHeight SOURCE_HEIGHT;
    
hookData.offsetX window->BorderLeft;
    
hookData.offsetY window->BorderTop;
    
hookData.scaleX COMP_FLOAT_TO_FIX(scaleX);
    
hookData.scaleY COMP_FLOAT_TO_FIX(scaleY);
    
hookData.retCode COMPERR_Success;

    
hook.h_Entry = (HOOKFUNC)compositeHookFunc;
    
hook.h_Data = &hookData;

    
ILayers->DoHookClipRects(&hookwindow->RPort, &rect);

    return 
hookData.retCode;
}
...

        
compositedVideoAvailable TRUE;
...
    
uint32 errCode fillWindowWithBitMap(yuvBitMapwindow);
    if(
errCode)
    {
        
// Composited video isn't available
...
        
printf("Composited video isn't available (CompositeTags() returned: %u %s)n",
            (
unsigned int)errCodecompositeErrorStr);

        
compositedVideoAvailable FALSE;
    }

   Report Go to top

Re: Odyssey's MediaPlayer thread
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6343
@jabirulo
Yes, of course we do check. It's just when our compositeHookFunc looks like this:

ULONG compositeHookFunc(struct Hook *hookstruct RastPort *rastPortstruct BackFillMessage *msg)
{
    
CompositeHookData *hookData = (CompositeHookData*)hook->h_Data;
    
uint16 indexArray[]= { 0,1,2,0,2,3};
    
float scalex,scaley;
    
struct Vert
    
{
        
float32    x,
                
y,
                
s,
                
t,
                
w;
    }
vertices[4];
    
    
//  Vertex 1 top left coordinates: x,y destination bitmap  s,t origin bitmap 
    
vertices[0].hookData->left;
    
vertices[0].hookData->top;
    
vertices[0].0.0f;
    
vertices[0].0.0f;
    
vertices[0].=  1.0f;  // for perspective correction (3d transformations)
    
    //  Vertex 2 top right coordinates
    
vertices[1].hookData->right;
    
vertices[1].hookData->top;
    
vertices[1].=  hookData->srcWidth// width of the image to blit. for now global        
    
vertices[1].0.0f;
    
vertices[1].=  1.0f;
    
    
//  Vertex 3 bottom right coordinates
    
vertices[2].hookData->right;
    
vertices[2].hookData->bottom;
    
vertices[2].=  hookData->srcWidth;
    
vertices[2].=  hookData->srcHeight;
    
vertices[2].=  1.0f;
    
    
//  Vertex 4 bottom left coordinates
    
vertices[3].=  hookData->left;
    
vertices[3].=  hookData->bottom;
    
vertices[3].0.0f;
    
vertices[3].=  hookData->srcHeight;
    
vertices[3].=  1.0f;

    
scalex = (hookData->right hookData->left)/hookData->srcWidth;
    
scalex = (hookData->bottom hookData->top)/hookData->srcHeight;

    
hookData->retCode CompositeTags(COMPOSITE_Src_Over_Dest,hookData->srcBitMap,rastPort->BitMap,
                    
COMPTAG_NumTriangles2,
                    
COMPTAG_VertexArrayvertices
                    
COMPTAG_IndexArrayindexArray
                    
COMPTAG_VertexFormatCOMPVF_STW0_Present,
                    
COMPTAG_Flags,COMPFLAG_HardwareOnly COMPFLAG_SrcFilter,
                    
TAG_DONE);
    return 
hookData->retCode;
}


Then it works on x5000 as expected, and while it return on pegasos2 "operation would fall back to software emulation" it then instead of rendering nothing, just crashes once i move window. But should not crashes.

If we use that one:

ULONG compositeHookFunc(struct Hook *hookstruct RastPort *rastPortstruct BackFillMessage *msg)
{
    
CompositeHookData *hookData = (CompositeHookData*)hook->h_Data;

    
float scalex,scaley;
    
scalex = (hookData->right hookData->left)/hookData->srcWidth;
    
scalex = (hookData->bottom hookData->top)/hookData->srcHeight;

    
hookData->retCode CompositeTags(COMPOSITE_Src_Over_Dest,hookData->srcBitMap,rastPort->BitMap,
                
//    COMPTAG_NumTriangles, 2,
                //    COMPTAG_VertexArray, vertices, 
                //    COMPTAG_IndexArray, indexArray, 
                    
COMPTAG_DestX,hookData->left,
                    
COMPTAG_DestY,hookData->top,
                    
COMPTAG_ScaleXscalex,
                    
COMPTAG_ScaleY,scaley,
                
//    COMPTAG_VertexFormat, COMPVF_STW0_Present,
                    
COMPTAG_Flags,COMPFLAG_HardwareOnly COMPFLAG_SrcFilter,
                    
TAG_DONE);
    return 
hookData->retCode;
}


Then on peg2 it render nothing as expected, but didn't crashes. But on x5000 that way without verticies didn't works and render nothing.

Probably we have some logical error somewhere or so. Will try to deal with Ami603 today.


   Report Go to top

Re: Odyssey's MediaPlayer thread
Home away from home
Joined:
2007/1/26 21:48
From New Zealand
Posts: 2310
@kas1e

Rather annoying that the old drivers don't handle the vertex arrays case properly, and return the error code.

Your code is missing some tags you need when using regular "rectangle mode." You need the following tags too:
COMPTAG_SrcWidth
COMPTAG_SrcHeight
COMPTAG_OffsetX
COMPTAG_OffsetY

One small gotcha with CompositeTags(), is that COMPTAG_DestX|Y|Width|Height define a clipping rectangle rather than where the bitmap will be rendered. That's why you need to set COMPTAG_OffsetX|Y too.

While that may seem unnecessarily complicated, it's pretty handy when you use DoHookClipRects(). You set the clip rectangle to the clip region, and COMPTAG_OffsetX|Y marks where the target draw region is.

Hans

   Report Go to top

Re: Odyssey's MediaPlayer thread
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6343
@Hans
Quote:

Rather annoying that the old drivers don't handle the vertex arrays case properly, and return the error code.


But they should return error code anyway, as compositing video not available on old drivers ?


   Report Go to top


« 1 ... 3 4 5 (6) 7 8 9 ... 15 »



[Advanced Search]



Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project