Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 Encoder GUIs

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd December 2005, 19:32   #661  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by stax
This yields the problem I described, let's say you inherit from job (or maybe profile) in your plugin and later remove that plugin. As result the entire deserialization will fail unless you do custom serialization. I would host the objects in a class implementing IList and ISerialization and save the stream a serialized object in the list in a byte array so if a object in the list cannot be deserialized because the assembly no longer exists the other objects in the list can still be deserialized.
Never use Binary Serialization for "save configuration" puposes! It can be broken even if your assembly still binary compatible (change/remove/add internal/private members to class). Binary Serilization is for short-term serialization for marshaling/network transmission puposes ONLY!!!!

I strongly recommend to use XmlSerializer and perform per-item serialization!
dimzon is offline   Reply With Quote
Old 2nd December 2005, 19:47   #662  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
@Doom9
Why not to use SF and CVS for collective work?
dimzon is offline   Reply With Quote
Old 2nd December 2005, 20:16   #663  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
maybe we'll have a SVN soon.
SF and his CVS are slow as hell and the mantainence is a pain.
Sharktooth is offline   Reply With Quote
Old 2nd December 2005, 20:39   #664  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Quote:
Never use Binary Serialization for "save configuration" puposes! It can be broken even if your assembly still binary compatible (change/remove/add internal/private members to class). Binary Serilization is for short-term serialization for marshaling/network transmission puposes ONLY!!!!
Last time I tried XML serializer it was very problemlematic to use with complex object graphs using things like generics, polymorphic objects within lists, hashtables or dictionaries etc. Maybe it was improved for 2.0 and maybe with enough experience XML serializing can work but I see absolutely no problem using binary serialization. There is no limit to the complexity of your object graphs, it will work, it will run fast and it won't riquire customizations like polymorphism with the xml serializer. Things like xml serializer calls ctor on deserialize usually yields awkward code. IIRC future .NET versions will be compatible with the 2.0 binary formatter. If you change fields you can call reflection to the rescue either by applying OptionalFieldAttribute (2.0 ;) or cleaner and better as missing or breaking fields with initializer get automatically instantiated:

Code:
Public Class Foo
    Implements ISerializable

    Public Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)
        For Each i As FieldInfo In Me.GetType.GetFields()
            Try
                i.SetValue(Me, info.GetValue(i.Name, i.FieldType))
            Catch
            End Try
        Next
    End Sub

    Public Sub GetObjectData(ByVal info As SerializationInfo, ByVal context As StreamingContext) Implements ISerializable.GetObjectData
        For Each i As FieldInfo In Me.GetType.GetFields()
            info.AddValue(i.Name, i.GetValue(Me))
        Next
    End Sub
End Class
Of course if you have critical data that is never allowed to break you don't want to use binary serialization but for a application like MeGUI that's not really a problem.

Last edited by stax76; 2nd December 2005 at 21:07.
stax76 is offline   Reply With Quote
Old 2nd December 2005, 21:49   #665  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
Perhaps the main thread could be updated with the new bins?

Also, I, too, support setting up SVN for MeGUI.
berrinam is offline   Reply With Quote
Old 2nd December 2005, 22:10   #666  |  Link
charleski
Registered User
 
charleski's Avatar
 
Join Date: Jul 2004
Posts: 383
Well, I've been assuming that people have been beta-testing all the changes I've made (especially the avi-import stuff please!). I've corrected all the issues that I've found or have been reported so far.

I have one more patch to post, but if all this stuff works, it's time to move the build number up a notch IMO, but I'll leave that in doom9's hands.

[edit]
Ok, current patch status:

0.3.2.10018 2 Dec 2005
Forced avs output to YV12 - No-one wins the grand-prize, guess that saved me some cash!
Restructured the code to open a video source in order to accomodate opening the dialog with a source already
specified.
Altered the formation of the main window's title. Version changes need only be set in AssemblyInfo.cs now.
Added berriman's avs script profile changes. (Move your avisynth plugins!) - Fixed it to load dgdecode from the DGMPGDec directory

Changed Files
Antiquated .NET 1.1 bins

[another edit] Grah - that's 0.3.2.1018

Last edited by charleski; 2nd December 2005 at 22:57.
charleski is offline   Reply With Quote
Old 2nd December 2005, 23:25   #667  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
My notebook started going nuts when I was on my way home, playing movies was no longe possible (abysmal performance), and while VS also had a lot of issues, I still managed to take care of one of the pending issues that've been bugging me in megui. The following makes the "show progress window" option in the view menu context sensitive:

add new private variable to Form1.cs

private bool isPwVisible = false;

In Form1.cs, method public bool startEncoding(Job job) add

this.isPwVisible = true;

to all three instances of the if:

if (this.settings.OpenProgressWindow)

in mnuView_Popup

replace

if (pw != null)

with

if (pw != null && !this.isPwVisible)

in mnuViewProcessStatus_Click

add
this.isPwVisible = true;

In ProgressWindow.cs

change

public delegate void WindowClosedCallback();

to

public delegate void WindowClosedCallback(bool hideOnly);

In OnClosing(CancelEventArgs e)

replace the code with the following

if (this.IsUserAbort)
{
e.Cancel = true;
this.Hide();
WindowClosed(true);
}
else
{
WindowClosed(false);
base.OnClosing (e);
}
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 3rd December 2005, 00:16   #668  |  Link
charleski
Registered User
 
charleski's Avatar
 
Join Date: Jul 2004
Posts: 383
@doom9 I've been trying to integrate your changes, but I get the error:
Error 11 No overload for 'pw_WindowClosed' matches delegate 'MeGUI.WindowClosedCallback'
I think I've drunk too much wine to work this out tonight, and I'm not an MCP, my doctorates are in biology, heh.
charleski is offline   Reply With Quote
Old 3rd December 2005, 00:42   #669  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
Quote:
Error 11 No overload for 'pw_WindowClosed' matches delegate 'MeGUI.WindowClosedCallback'
Means you didn't patch everything or didn't tell me enough about the error (as in which file.. which method).
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 3rd December 2005, 04:44   #670  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
Charleski version is 0.2.3.1018 not 0.3.2.1018
However the http://files.x264.nl/Sharktooth/?dir=./megui link contains always the latest .NET 1.1 bins (made with .NET 1.1 SDK c# compiler - csc) and the changed files from the original 0.2.3.1b sources.

Last edited by Sharktooth; 3rd December 2005 at 04:48.
Sharktooth is offline   Reply With Quote
Old 3rd December 2005, 04:53   #671  |  Link
charleski
Registered User
 
charleski's Avatar
 
Join Date: Jul 2004
Posts: 383
Quote:
Originally Posted by Sharktooth
Charleski version is 0.2.3.1018 not 0.3.2.1018
Ok, the fact that it took me 10 minutes to realise that 0.2.3 != 0.3.2 means i should probably look at this code tomorrow...
charleski is offline   Reply With Quote
Old 3rd December 2005, 05:02   #672  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
It's just the archive filename that's wrong... the right version number is 0.2.3.1018. The code is ok.
Sharktooth is offline   Reply With Quote
Old 3rd December 2005, 11:52   #673  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
The Avisynth Script Creator window now doesn't open; a NullReferenceException due to the mainForm member being accessed when it is still null. To fix, move
Code:
			this.mainForm = mainForm;
from about the middle of AviSynthWindow.<init> to the beginning of that constructor.
berrinam is offline   Reply With Quote
Old 4th December 2005, 09:58   #674  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
ChronoCross posted a bug report which seems to cause MeGUI to crash when opening an avs file. This is caused by the two following lines in VideoPlayer.InitializeComponent:
Code:
            ((System.ComponentModel.ISupportInitialize)(this.videoPreview)).BeginInit();
and
Code:
            ((System.ComponentModel.ISupportInitialize)(this.videoPreview)).EndInit();
While they could simply be deleted, perhaps a better way to fix this problem is to force VS to regenerate the InitializeComponent code, by moving some components around.
berrinam is offline   Reply With Quote
Old 5th December 2005, 15:20   #675  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
as a quick workaround for my x264 builds i commented that lines out.
1.1 .NET binaries at the usual place ( http://files.x264.nl/Sharktooth/?dir=./megui ). sources are not updated.

edit: the avc2avi GUI i was talking of some posts above... this is the .NET 1.1 version: http://files.x264.nl/Sharktooth/util..._rev267+gui.7z
The .NET 2.0 version with default style looks much better though.

Last edited by Sharktooth; 5th December 2005 at 16:02.
Sharktooth is offline   Reply With Quote
Old 5th December 2005, 19:10   #676  |  Link
charleski
Registered User
 
charleski's Avatar
 
Join Date: Jul 2004
Posts: 383
Quote:
Originally Posted by berrinam
ChronoCross posted a bug report which seems to cause MeGUI to crash when opening an avs file. This is caused by the two following lines in VideoPlayer.InitializeComponent:
I tracked down the cause of this:
Quote:
Originally Posted by .NET Framework Class Library
PictureBox.System.ComponentModel.ISupportInitialize.BeginInit Method
...
Note: This method is new in the .NET Framework version 2.0.
Aargh. - the Forms Designer automatically adds .NET 2.0-only code, and the .NET 1.1 compiler wasn't detecting this particular problem at compile-time.

@doom9: I worked out what else needed to be added to your changes. Since you added a parameter to the WindowClosedCallback delegate, then
private void pw_WindowClosed()
{
pw = null
}
in Form1.cs needs to change to
private void pw_WindowClosed(bool hideOnly)
{
this.isPwVisible = false;
if (!hideOnly)
pw = null;
}
if I'm reading your intentions correctly.
charleski is offline   Reply With Quote
Old 5th December 2005, 19:20   #677  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
Quote:
if I'm reading your intentions correctly.
Yup, that's it. Did I miss that? It appears so.
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 5th December 2005, 19:35   #678  |  Link
charleski
Registered User
 
charleski's Avatar
 
Join Date: Jul 2004
Posts: 383
I've added it into the source, but I'm playing around with getting the preview window to resize atm.
charleski is offline   Reply With Quote
Old 5th December 2005, 20:04   #679  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
what's wrong with the preview window? it resizes just fine here.
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 5th December 2005, 20:18   #680  |  Link
charleski
Registered User
 
charleski's Avatar
 
Join Date: Jul 2004
Posts: 383
You can pull out a corner and resize the video? That's weird, I can' do that at all.
charleski is offline   Reply With Quote
Reply

Tags
development, megui, not a help thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:19.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.