PDA

View Full Version : adding MVintegration to existing vc++ doc type app



steveschutz
March 31, 2004, 17:51:12
I have a substantial application built for imaging / sound / analog data analysis and want to add bring in a filter graph into the app.
I can manage this in a dialog based app- using
/*
m_mvControl.Create("test", WS_CHILD, CRect(10, 10, 100, 100), this, 232);

hResult = m_mvControl.LoadConfig(".\\Rotation.mvp");

etc, etc, etc
*/
Like in the "Control" Example-

How do I accomplish this in my doc type app?
Plus I would like to optionally direct this right onto the main frame-

I have been fighting with this for a few days.

Any input / feedback would be appreciated

Steve Schutz
Amtex Inc

Bernd Peretzke
April 1, 2004, 13:47:30
Hi,

You can use any visible window to display a video with the MV Integration Control. All you need are the header and implementation (*.cpp) files for the control. You can copy this file from the control sample.

Add a member variable and create the control like the control sample. Set the video window to the area within your window (e.g. CView).

If you want to display a video onto a frame window you have to make sure that no other child window (view) is visible in the video area.

Sample Code:

/* SDI app with CView window. mvcontrol1.h and mvcontrol1.cpp files from the "Control" sample added*/

class CTestView : public CView
{
...
protected:
CMVControl m_control;
}

/* Implematation file: create the control, load a filter graph, setup videowindow and start it. */

void CTestView ::OnInitialUpdate()
{
CView::OnInitialUpdate();


static BOOL first = TRUE;

if(m_hWnd != 0L && first)
{
first = FALSE;
m_control.Create("test", WS_CHILD, CRect(10, 10, 100, 100), this, 232);

m_control.LoadConfig(".\\test.mvp");

CRect rect;
GetClientRect(rect);

m_control.SetActiveWindow(0);
m_control.SetVideoLeft(0);
m_control.SetVideoTop(0);
m_control.SetVideoHeight(rect.Height());
m_control.SetVideoWidth(rect.Width());
m_control.SetupWindow((long)m_hWnd, TRUE);

m_control.Start();
}
}




Regards
Bernd

brow0833
June 13, 2006, 17:27:40
I'm attempting to do something similar here. I'd like to have multiple video windows inside a main window like a multiple document interface. Creating a new dialog that contains the CMVSmartControl for each source gets messy when there are more then a couple windows. I'd like to contain them inside of one window.

This post seems to use a control that I don't have. Is there a current recommended way to do this?

Thanks for any suggestions,

Andy

Bernd Peretzke
June 13, 2006, 17:39:02
Hi,

You could add more than one MV Smart Control into a window. The control is a window so you could use them like a window. The find object sample uses two MV Smart Controls.

The initinal post refers to the MV Integration Control. This control was replaced by the MV Smart Control. So use the MV Smart Control instead of the MV Integration control.

Regards
Bernd

brow0833
June 13, 2006, 17:46:11
Thanks for the quick response. The multiple controls on one window is a good idea, but I'd like to create a new window for each video source.

I see there are IMVSCVideoWindow and IMVSCVideoWindow2 interfaces that might do what I'm talking about.

Are there any examples of how this interface is used? Could it be used in the way I'm suggesting? Like a MDI or multiple document interface. So I could create a new CMVSmartControl for each camera such that the window in contained inside of a main window?

Andy

Bernd Peretzke
June 13, 2006, 18:02:23
Hi,

Yes you could do that. The MV Smart Control is a window that shows the video from a stream. With the IMVSCVideoWindow interface you could setup some properties regarding the video output. But for resizing or moving you could use the normal window functions (MoveWindow, ...).

Try it out. :)

Regards
Bernd