http://engy.us/misc/pinvoke_compatibility.patch
This does two major things:
1) Adds some wrapper and setter methods. You have a limited way of interacting with unmanaged memory when you use P-invokes, which makes directly modifying structures impossible. Libhb currently relies on this in several ways, so I need to add these native methods to do this interaction.
2) Adds hb_register_logger, which allows you to get log messages passed to a given callback. Much like hb_register_error_handler, except this will pass through everything on stderr. This includes HB log messages and other messages, like from x264.
There's also a bit of refactoring around process initialization.
[PATCH] Pinvoke compatibility update for libhb
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.
*******************************
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.
*******************************
-
- Novice
- Posts: 50
- Joined: Thu Mar 29, 2007 2:56 am
-
- Novice
- Posts: 50
- Joined: Thu Mar 29, 2007 2:56 am
Re: [PATCH] Pinvoke compatibility update for libhb
Updated patch to apply to latest SVN.
Re: [PATCH] Pinvoke compatibility update for libhb
Ran a few test sources with this patch applied and didn't have any problems with the encodes.
I do appear to be seeing encodes that are a fair bit slower. I'll need to do some testing to see if this is patch related or if we have something else going on. Seems to be around 50~70fps slower on universal. (It's possibly not the patch since I've been using a fairly old build in my test setup.)
I do appear to be seeing encodes that are a fair bit slower. I'll need to do some testing to see if this is patch related or if we have something else going on. Seems to be around 50~70fps slower on universal. (It's possibly not the patch since I've been using a fairly old build in my test setup.)
Re: [PATCH] Pinvoke compatibility update for libhb
Looks like it's something else. 3154 seems a bit slower too :/
So I'm fine with this going in if the code looks ok.
So I'm fine with this going in if the code looks ok.
-
- Novice
- Posts: 50
- Joined: Thu Mar 29, 2007 2:56 am
Re: [PATCH] Pinvoke compatibility update for libhb
Patch updated. Had a bug with picking titles from DVDs with invalid titles.
- JohnAStebbins
- HandBrake Team
- Posts: 5726
- Joined: Sat Feb 09, 2008 7:21 pm
Re: [PATCH] Pinvoke compatibility update for libhb
Committed with a couple minor modifications http://trac.handbrake.fr/changeset/3317
I have a question about how you are using hb_get_filter_object however. Are the strings that are being strdup'd there being freed somewhere? It's usually bad practice to have one piece of code alloc memory and another free it. But I can see where this might be necessary in the interface to C#.
I have a question about how you are using hb_get_filter_object however. Are the strings that are being strdup'd there being freed somewhere? It's usually bad practice to have one piece of code alloc memory and another free it. But I can see where this might be necessary in the interface to C#.
-
- Novice
- Posts: 50
- Joined: Thu Mar 29, 2007 2:56 am
Re: [PATCH] Pinvoke compatibility update for libhb
Thanks!
I see what you mean about the settings strings. When the CLI interacts with the filter objects, it is allocating the strings and can clean them up if it wants to. In this case, no one appears to have responsibility for them. I believe that I'll need to manually marshal the string in the interop and keep it around until the job is complete. Then in hb_get_filter_object we don't need to strdup, we can just set the char* directly. Want me to come up with a patch? Though the change is pretty simple, you could just check it in yourself.
I see what you mean about the settings strings. When the CLI interacts with the filter objects, it is allocating the strings and can clean them up if it wants to. In this case, no one appears to have responsibility for them. I believe that I'll need to manually marshal the string in the interop and keep it around until the job is complete. Then in hb_get_filter_object we don't need to strdup, we can just set the char* directly. Want me to come up with a patch? Though the change is pretty simple, you could just check it in yourself.
- JohnAStebbins
- HandBrake Team
- Posts: 5726
- Joined: Sat Feb 09, 2008 7:21 pm
Re: [PATCH] Pinvoke compatibility update for libhb
Yes, please create a patch to fix this. You're going to need to test it anyway since your code is currently the only one that uses this function.
-
- Novice
- Posts: 50
- Joined: Thu Mar 29, 2007 2:56 am