Disko Forum logo Login  |  Register  |  Lost Password
MMSVIdeo

danieltidus
Posts: 14
graphgraph

MMSVIdeo 5 Years, 9 Months ago  
Hi!

I'm trying implement a video player using mmsvideo class. I created a MMSMainWindow instance and after I created a MMSVideo instance passing the MMSMainWindow by the constructor, but I got the follow exception:

MMSFBSurface::clear() failed

How can I resolve this problem? Is there any specifically type of window that I need use whit MMSVideo?

regards.
 
  The administrator has disabled public write access.
MMSVIdeo

Jens
Admin
Posts: 12
graphgraph

Re:MMSVIdeo 5 Years, 9 Months ago  
Hi danieltidus,

a video window should not be a MMSMainWindow, because a MainWindow has e.g. ARGB/AYUV pixelformat because it resides typically on the graphic layer.

You can create a MMSRootWindow with the MMSW_VIDEO flag. This has two effects:
- the pixelformat of the layer will be used (this is normally
no alphachannel pixelformat)
- if using separate graphics and video layers the RootWindow will be
displayed on the video layer

Example code:

// create root window
MMSRootWindow *videoWindow = new MMSRootWindow("", "100%", "100%", MMSALIGNMENT_CENTER, (MMSWINDOW_FLAGS)MMSW_VIDEO);

// show it
videoWindow->show();

// create new mmsvideo instance
MMSVideo *mmsvideo = new MMSVideo(this->videoWindow);
if (mmsvideo) {
mmsvideo->startPlaying("myfile...";
}

Please take a look at videoplugin.cpp of the morphine.tv video plugin.

Regards
Jens
 
  The administrator has disabled public write access.
MMSVIdeo

danieltidus
Admin
Posts: 14
graphgraph

Re:MMSVIdeo 5 Years, 9 Months ago  
OK, Thanks a lot!

Another question:

Is it possible create 2 or more video instances and display them at the same time, like a video mosaic?

Thanks!
 
  The administrator has disabled public write access.
MMSVIdeo

Jens
Admin
Posts: 12
graphgraph

Re:MMSVIdeo 5 Years, 8 Months ago  
Yes it should be possible.

My idea is to create child windows on the root window and use this windows for the different MMSVideoa instances.

I will check this

Regards
Jens
 
  The administrator has disabled public write access.
MMSVIdeo

Jens
Admin
Posts: 12
graphgraph

Re:MMSVIdeo 5 Years, 8 Months ago  
Hi danieltidus,

okay, it works!

The following code creates a root window which includes two
child windows and plays two videos in parallel.

The root window is a full screen window.
The child windows are located at 0,0,199,199 and
200,200,399,399 within the root window.

Please note that the child windows MUST be created
WITHOUT own surfaces (own_surface=false). This means
that the child windows share its surfaces with the
parent window (the root window). They have no own
surface memory allocated.

Please note that the child windows will be visible
only if the root window will also be shown.

// create the root window
MMSRootWindow *rw = new MMSRootWindow("", "100%", "100%",
MMSALIGNMENT_CENTER,
(MMSWINDOW_FLAGS)MMSW_VIDEO);

// create and show root's first child window
bool own_surface = false;
MMSChildWindow *cw1 = new MMSChildWindow("", rw,
"0px", "0px", "200px", "200px",
MMSALIGNMENT_TOP_LEFT,
MMSW_NONE, NULL, &own_surface);
cw1->show();

// create and show root's second child window
MMSChildWindow *cw2 = new MMSChildWindow("", rw,
"200px", "200px", "200px", "200px",
MMSALIGNMENT_TOP_LEFT,
MMSW_NONE, NULL, &own_surface);
cw2->show();

// show the root window
rw->show();

// new MMSVideo instance using child window cw1
MMSVideo *mmsvideo1 = new MMSVideo(cw1);
mmsvideo1->startPlaying("file1";

// new MMSVideo instance using child window cw2
MMSVideo *mmsvideo2 = new MMSVideo(cw2);
mmsvideo2->startPlaying("file2";


I hope it will help you.

Regards
Jens
 
  The administrator has disabled public write access.
MMSVIdeo

danieltidus
Admin
Posts: 14
graphgraph

Re:MMSVIdeo 5 Years, 8 Months ago  
Ok, I'll try it!

Thanks!
 
  The administrator has disabled public write access.
Powered by FireBoard
get the latest posts directly to your desktop