How to change the existing stream?
(One intermediate revision by one user not shown) | |||
Line 8: | Line 8: | ||
[[Image:ChangeStream1.jpg]] | [[Image:ChangeStream1.jpg]] | ||
+ | |||
* Double click on a stream you need to change in upper left table. The "change stream" dialog will appear. | * Double click on a stream you need to change in upper left table. The "change stream" dialog will appear. | ||
[[Image:ChangeStream2.jpg]] | [[Image:ChangeStream2.jpg]] | ||
+ | |||
* If you need to change stream to file, select "File" radio button, choose needed file and press "Apply". | * If you need to change stream to file, select "File" radio button, choose needed file and press "Apply". | ||
Line 26: | Line 28: | ||
pMixerFiles.ChangeFile(m_nStream, textPath.Text, dblIn, dblOut); | pMixerFiles.ChangeFile(m_nStream, textPath.Text, dblIn, dblOut); | ||
+ | |||
* If you need to change stream to Live Source, select "Live Source" radio button, choose needed source and it's properties and press "Apply". | * If you need to change stream to Live Source, select "Live Source" radio button, choose needed source and it's properties and press "Apply". |
Latest revision as of 18:19, 2 April 2010
There is no way to add/remove streams without re-initialization of Vision Mixer object, but you easily can change the existing one. This feature allows you to operate with streams any way you need.
Here is a sequence of actions to change stream in Vision Mixer C# sample:
- Run sample and add a couple of streams. If can be File streams, Live Source streams, Empty streams (like "bars") or something else.
Press "Apply" to initialize Vision Mixer object with your streams. Please note that you can change only existing streams but cannot add/remove them, so if you plan to show one more stream some time later you need to add fake stream ("bars") for it before initialization.
- Double click on a stream you need to change in upper left table. The "change stream" dialog will appear.
- If you need to change stream to file, select "File" radio button, choose needed file and press "Apply".
You'll see that your stream is changed to file stream.
Code sample:
MGVIDEOMIXERLib.IMGMixerFiles pMixerFiles = (MGVIDEOMIXERLib.IMGMixerFiles)m_pMixerConfig;
pMixerFiles.ChangeFile(m_nStream, textPath.Text, dblIn, dblOut);
- If you need to change stream to Live Source, select "Live Source" radio button, choose needed source and it's properties and press "Apply".
You'll see that your stream is changed to Live Source stream.
Code sample:
MGVIDEOMIXERLib.IMLVideoMixerScene pMixerScene = (MGVIDEOMIXERLib.IMLVideoMixerScene)m_pMixerConfig;
m_pMixerConfig.SetTargetStream(m_nStream);
MGVIDEOMIXERLib.IMGDeviceConfig pDeviceConfig = (MGVIDEOMIXERLib.IMGDeviceConfig)m_pMixerConfig;
//Set audio device
pDeviceConfig.SetDevice(comboAudDevice.SelectedItem.ToString(), MGVIDEOMIXERLib.eMGDeviceType.eMGDT_Audio);
//Set video device
pDeviceConfig.SetDevice(comboVidDevice.SelectedItem.ToString(), MGVIDEOMIXERLib.eMGDeviceType.eMGDT_Video);
pDeviceConfig.SetFormat(comboFormatVid.SelectedIndex, MGVIDEOMIXERLib.eMGDeviceType.eMGDT_Video);
m_pMixerConfig.SetPreparedDevice(m_nStream, 1);