switcherlib and Mediaupload

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

Jens Walkowiak

  • Posts: 28
  • Joined: Thu Jan 03, 2013 4:52 pm

switcherlib and Mediaupload

PostMon May 25, 2020 9:17 pm

Hello,

I have an other question about using the switcherlib.

Mein Code is:
slot =0;
dateiname = @"G:\testbild.jpg";
Upload meinupload= new Upload(meinatem, dateiname, slot);
meinupload.SetName(dateiname);
//meinupload.function_test();
meinupload.Start();

while (meinupload.InProgress())
{
in_prozess.Text= meinupload.GetProgress().ToString();

}

meinatem is know and works

During "meinupload.Start();" the Atem and my program freeze.

Where is my mistake?

Thank you
Jens
Offline

Ian Morrish

  • Posts: 488
  • Joined: Sun Jan 18, 2015 9:24 pm
  • Location: New Zealand

Re: switcherlib and Mediaupload

PostTue May 26, 2020 11:00 pm

The file must match switcher resolution for height and width.
Try setting the name, can't remember if this is required.
Add a thread sleep to stop any blocking for the callback to be able to change the progress status.

Upload upload = new Upload(switcher, filename, slot);
upload.SetName("Title of File");
upload.Start();
while (upload.InProgress())
{
Thread.Sleep(100);
}
Regards,
Ian Morrish
Video Integrated Scripting Environment
(Windows PowerShell with ATEM driver + more)
https://ianmorrish.wordpress.com
Offline

Jens Walkowiak

  • Posts: 28
  • Joined: Thu Jan 03, 2013 4:52 pm

Re: switcherlib and Mediaupload

PostFri May 29, 2020 12:57 pm

Hello,

Thanks for your answer. The resolution of the picture is the same as the switcher.
The sleep-Command I have tried it.
But I get "ContextSwitchDeadlock" as error.

Thanks Jens
Offline

Ian Morrish

  • Posts: 488
  • Joined: Sun Jan 18, 2015 9:24 pm
  • Location: New Zealand

Re: switcherlib and Mediaupload

PostFri Jun 05, 2020 11:48 pm

Sounds like a threading issue. What type of application (I tested in a console app)?
Presume you have
using System.Threading;
using System.Threading.Tasks;
Regards,
Ian Morrish
Video Integrated Scripting Environment
(Windows PowerShell with ATEM driver + more)
https://ianmorrish.wordpress.com
Offline

Jens Walkowiak

  • Posts: 28
  • Joined: Thu Jan 03, 2013 4:52 pm

Re: switcherlib and Mediaupload

PostSat Jun 06, 2020 5:34 am

Hi Ian,

thank you for your answer, the language is c# and it is a Windows Form app. (Net) Other routines are working (Supersource, DSK, ….). Your console app "mediaupload.exe" works fine.

Only in my program the mediaupload don't work.

Here is my code:
Code: Select all
 {
            int slot=0;
            string dateiname="";


            if (Slot_1.Checked==true) { slot = 0; }
            if (Slot_2.Checked == true) { slot = 1; }
            if (Slot_3.Checked == true) { slot = 2; }

            OpenFileDialog mein_oeffen = new OpenFileDialog()
            {
                Multiselect = false,
                InitialDirectory = "c:\\",
                Filter = "tiff(*.tif)|*.tif|" + "jpg(*.jpg) | *.jpg|" + "png(*.png)|*.png|" + "Alle Dateien(*.*)|*.*",
                Title = "Bilder zum Laden "
            };
            if(mein_oeffnen.ShowDialog()==DialogResult .OK)
            {
                dateiname =String.Join("", mein_oeffnen.FileName) ;

            }
            dateiname = @" G:\testbild.jpg";  //only for testing
           
            Upload meinupload= new Upload(meinatem, " G:\\testbild.jpg", 1);
           meinupload.SetName(dateiname);
            //meinupload.function_test();

            meinupload.Start();

         
            in_prozess.Text = "nu";
             while (meinupload.InProgress())
            {
                Thread.Sleep(100);
               
               in_prozess.Text= meinupload.GetProgress().ToString();

            }
             
           
        }


The file g:\testbild.jpg is for only testing an the fixed slot 1.

Many greetings
Jens

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 9 guests