@All
It's time for everyone who ask for sources to do some real help :) Or anyone who not ask for sources , but can bring any kind of developer's help. That will be apprecated.
So, we have currently 2 issues:
1). MediaPlayer itself is buggy much. For example just moving of position slider offten loose audio (and not only in odyssey, but in whole system and reset need it). That one will be pretty nice to fix. It can be something about programming of AHI itself and differences with the way how it should be done for OS4 and how it was done for MORPHOS. I only replace there necessary stuff to made it compiles. There is files files in question:
https://github.com/kas1e/Odyssey/tree/ ... BAL/Media/WebCore/MorphOSMain one is BCMediaPlayerPrivateMorphOS.cpp. There also acinerella.c which used too, but its usuall file from Acinerella for some basic functions to use with ffmpeg, so that one no big worry probabaly.
2). While first issue is important to fix, things still will be kind of slow, so we want things to be harware accelerated when we go to fullscreen mode (as there we will have no browser anymore, so no cairo limitations and things can be fast, same as done on MorphOS).
I think that we first need to go "composition" way for fullscreen, and later can add overlay for older cards (if there will be real needs in as if i remember right, even old Radeon9200 support compositing as well?).
File in question just one: owbbrowserclass.cpp. File placed there:
https://github.com/kas1e/Odyssey/blob/ ... rphOS/owbbrowserclass.cppThe relevant part which currently only handle CGX5 overlay (so of no use for us) placed in one single method
"DEFSMETHOD(OWBBrowser_VideoEnterFullPage)":
https://github.com/kas1e/Odyssey/blob/ ... owbbrowserclass.cpp#L3795Relevant code which we "just" need to rewrite on compositing usage are placed inside of if(CGXVideoBase).
Whole "video-related" code are in #if ENABLE(VIDEO), but probabaly all what we need it just rewrite that part on compositing:
if(CGXVideoBase)
{
struct Window *window = (struct Window *) getv(_win(obj), MUIA_Window);
if(window)
{
IntSize size = element->player()->naturalSize();
//kprintf("naturalsize %dx%d\n", size.width(), size.height());
ULONG vlayer_width = size.width() & -8;
ULONG vlayer_height = size.height() & -2;
data->video_mode = SRCFMT_YCbCr420;
data->video_handle = CreateVLayerHandleTags(window->WScreen,
VOA_SrcType, data->video_mode,
VOA_UseColorKey, TRUE,
VOA_UseBackfill, FALSE,
VOA_SrcWidth, vlayer_width,
VOA_SrcHeight, vlayer_height,
VOA_DoubleBuffer, TRUE,
TAG_DONE);
if(!data->video_handle)
{
DoMethod(app, MM_OWBApp_AddConsoleMessage, "[MediaPlayer] Couldn't create planar overlay layer, trying chunky instead");
data->video_mode = SRCFMT_YCbCr16;
data->video_handle = CreateVLayerHandleTags(window->WScreen,
VOA_SrcType, data->video_mode,
VOA_UseColorKey, TRUE,
VOA_UseBackfill, FALSE,
VOA_SrcWidth, vlayer_width,
VOA_SrcHeight, vlayer_height,
VOA_DoubleBuffer, TRUE,
TAG_DONE);
}
if(data->video_handle)
{
if ( ( (float) size.width() / (float) size.height()) < ( (float) _mwidth(obj) / (float) _mheight(obj)) )
{
// Width is too big
data->video_y_offset = 0;
data->video_x_offset = _mwidth(obj) - (ULONG) (_mheight(obj) * ( (float) size.width() / (float) size.height()));
data->video_x_offset /= 2;
}
else
{
// Height too big
data->video_y_offset = _mheight(obj) - (ULONG) (_mwidth(obj) * ( (float) size.height() / (float) size.width()));
data->video_y_offset /= 2;
data->video_x_offset = 0;
}
if(0 == AttachVLayerTags(data->video_handle, window,
VOA_LeftIndent, _mleft(obj) - window->BorderLeft + data->video_x_offset,
VOA_RightIndent, window->Width - window->BorderRight - 1 - _mright(obj) + data->video_x_offset,
VOA_TopIndent, _mtop(obj) - window->BorderTop + data->video_y_offset,
VOA_BottomIndent, window->Height - window->BorderBottom -1 - _mbottom(obj) + data->video_y_offset,
TAG_DONE))
{
data->video_fullscreen = msg->fullscreen;
data->video_element = element;
data->video_colorkey = GetVLayerAttr(data->video_handle, VOA_ColorKey);
enable_blanker(_screen(obj), FALSE);
// Change backfill behaviour
set(obj, MUIA_FillArea, TRUE);
set(obj, MUIA_CustomBackfill, TRUE);
DoMethod(obj, MUIM_Backfill, _mleft(obj), _mtop(obj), _mright(obj), _mbottom(obj), 0, 0, 0);
if(data->video_mode == SRCFMT_YCbCr16)
{
element->player()->setOutputPixelFormat(AC_OUTPUT_YUV422);
}
else if(data->video_mode == SRCFMT_YCbCr420)
{
element->player()->setOutputPixelFormat(AC_OUTPUT_YUV420P);
}
set(data->hbargroup, MUIA_ShowMe, FALSE);
set(data->vbar, MUIA_ShowMe, FALSE);
Object *mediacontrolsgroup = (Object *) getv(_parent(_parent(obj)), MA_OWBGroup_MediaControlsGroup);
if(mediacontrolsgroup)
{
set(mediacontrolsgroup, MA_MediaControlsGroup_Browser, obj);
set(mediacontrolsgroup, MUIA_ShowMe, TRUE);
}
}
else
{
DeleteVLayerHandle(data->video_handle);
data->video_handle = NULL;
}
}
else
{
DoMethod(app, MM_OWBApp_AddConsoleMessage, "[MediaPlayer] Couldn't create overlay layer");
}
}
}
And that all. Probabaly there will be needs to a bit touch other fucntions inside of VIDEO part.. But after we will have full-screen mediaplayer in fullspeed and all stuff.
As i not a coder, there need some work done by someone skilled who works already with compositing before, and know how to replace it.
There no needs you to write everything and have working stuff , just something to start with. Maybe pure initialisation of compositing, and render something to it in that place, and then step by step. Even put there code, and i will myself compile it and giving results right away, so we can do it all even if you have no amiga to test, or at work, etc :)