Dan Dennedy [Fri, 4 Apr 2014 23:48:32 +0000 (16:48 -0700)]
Fix crashing when using opengl services with wrapper producers.
Steinar reported crashing in Kdenlive when using the framebuffer
producer due to movit.crop changing the format to mlt_image_none.
Removing that required making other components handle requests with
format = mlt_image_none.
Use the shared ResourcePool also for ad-hoc EffectChains.
We sometimes create an EffectChain just to get a temporary MLT image
into Movit. This, like any other, should use the ResourcePool.
A side-effect of this is that it serves as a temporary workaround
for Kdenlive bug 3253, since it delays the destruction of the
ResourcePool until the end of the program.
Dan Dennedy [Mon, 31 Mar 2014 03:23:54 +0000 (20:23 -0700)]
Prevent making consumer qglsl if glslManager already exists.
With Qt 4 version of qt module, if -consumer qglsl was specified on melt
command line, then the xml would not load without specifying "xml-nogl"
as the service for the resource. This prevents the need to invoke that.
This works around the issue that Movit might want to change from GLEW
to something else in the (very near) future; it's maybe not very pretty,
but it works pretty well in practice.
Dan Dennedy [Tue, 11 Feb 2014 01:29:50 +0000 (17:29 -0800)]
On Windows, ensure consumer-thread-create fires on caller thread.
This is needed to get GPU processing working on Shotcut for Windows and
probably other Qt 5 apps. However, that causes some bad behavior with
Movit on Linux. So, this change is only on Windows for now.
Dan Dennedy [Sat, 1 Feb 2014 05:37:10 +0000 (21:37 -0800)]
If LC_NUMERIC unsupported do not inadvertently change locale.
On Windows, we should be able to use _create_locale() and _free_locale()
but using them results in unresolved symbols linking on mingw 4.8.
Calling setlocale with fallback value of "" results in changing locale
to system-defined. With this change, on OS where LC_NUMERIC changing is
not supported we call with NULL, which makes the call passive.
Given that new/delete on such small objects are cheap and this happens
rarely, it is probably not worth the extra complexity. (In the process,
fix a minor bug related to out-of-memory; not that new will actually
ever return NULL on any compilers newer then MSVC6.)
FBOs are cheap to construct and delete (they carry almost no state),
so it is less complex just to do it on the fly. It also gives less
leakage, as we use new contexts all the time.
Having the MltInput be an Input which forwards down to the real implementation
has been a source of multiple headaches, and now lastly, when finalize()
disappeared, source of a broken build. We still need the unified
set_pixel_pointer() etc., but the class is now simply a holder of the Input*,
not a forwarder as viewed from the EffectChain.
Brian Matherly [Wed, 29 Jan 2014 18:44:09 +0000 (12:44 -0600)]
Save vidstab results to file.
Rather than save vidstab results (which can get quite large) in the properties, save them in a separate file.
Also redirect vid.stab log messages through the MLT logging system (sort of).
Dan Dennedy [Wed, 29 Jan 2014 06:40:53 +0000 (22:40 -0800)]
Add xml_retain property support to xml module.
This is used to serialize and deserialize extra services that are not
part of the lastmost service's graph. This is useful, for example, to
save and load a media bin as a playlist in addition to the main
multitrack graph. Or, it can be used for compound documents.
It is technically allowed to use GL_RGBA as internal format,
but then it is undefined whether you get 4-bit, 8-bit, 10-bit
or something else. Set it explicitly. (Since we give in a NULL
pointer, we can give whatever external format we want; just
hardcode it to GL_RGBA.)
This attempt at optimization is actually detrimental on modern CPUs.
Removing it helps playback speed ~0.3%. mlt_properties_get_data() is now
down to ~0.6%.
Call invalidate_pixel_data() after frame rendering.
This helps the input return its values back to the ResourcePool,
which means we won't be allocating ever more textures as we get
more clips on the timeline.
Dan Dennedy [Tue, 21 Jan 2014 06:34:50 +0000 (22:34 -0800)]
Fix a few problems with YCbCr colorspace conversion.
In avformat producer on libav (and FFmpeg < v2.1) conversion from RGB to
YCbCr would not use the destination colorspace because
sws_getColorspaceDetails() fails. Switch to calling only
sws_setColorspaceDetails().
In full luma yuvj420p->mlt_image_yuv420p conversion, the luma range was
always scaled down to MPEG range. The swscale implementation does not
let one override the range as the conversion routines are initialized at
the time a swscale context is allocated and initialized. Any changes in
sws_setColorspaceChanges() are mute.
In RGB->YCbCr conversion, the existing (source) colorspace was used
instead of the profile colorspace. Also, we need to set the new
colorspace as a property of the frame.
Brian Matherly [Mon, 20 Jan 2014 02:51:30 +0000 (20:51 -0600)]
Updates to vid.stab module.
* Correct some metadata
* Remove "reset" property by making deshake properties mutable.
* Implement "reload" for vidstab for reloading results.
* Misc. changes for MLT consistency.
This allows effects to signal that some sort of change means the chain
needs to be regenerated. In particular, this unbreaks changing the
matrix_size parameter of DeconvolutionSharpenEffect; if you change it,
the entire chain will now be regenerated, instead of getting an assertion
failure.
Stop special-casing the disable parameter for setting.
There are more parameters then just 'disable' that should be set before
chain finalization; in particular, DeconvolutionSharpenEffect compiles
the matrix size into the shader. Instead, just set all the parameters
once right after the chain has been built, which includes the disable
parameter.
Brian Matherly [Tue, 14 Jan 2014 13:44:34 +0000 (07:44 -0600)]
Updates to vid.stab module.
* Clean up serialization/deserialization
* results are not published until the analysis step is complete
* results are stored in "results" property
* Misc changes for MLT conventions and consistency