Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with LumiaAnalyzerDefinition #24

Open
DaPete89 opened this issue Mar 6, 2016 · 9 comments
Open

Problem with LumiaAnalyzerDefinition #24

DaPete89 opened this issue Mar 6, 2016 · 9 comments

Comments

@DaPete89
Copy link

DaPete89 commented Mar 6, 2016

Hello Mr. Maitre,
i have an Problem with the LumiaAnalyzerDefinition class.
await capture.AddEffectAsync(MediaStreamType.VideoPreview, definition.ActivatableClassId, definition.Properties);
My App can't find any definition for "ActivatableClassId" and "Properties".

In my Package.appxmanifest is the binding for the VideoEffects:
<Extension Category="windows.activatableClass.inProcessServer"> <InProcessServer> <Path>VideoEffects.WindowsPhone.dll</Path> <ActivatableClass ActivatableClassId="VideoEffects.CanvasEffect" ThreadingModel="both"/> <ActivatableClass ActivatableClassId="VideoEffects.LumiaEffect" ThreadingModel="both"/> <ActivatableClass ActivatableClassId="VideoEffects.LumiaAnalyzer" ThreadingModel="both"/> <ActivatableClass ActivatableClassId="VideoEffects.ShaderEffectBgrx8" ThreadingModel="both"/> <ActivatableClass ActivatableClassId="VideoEffects.ShaderEffectNv12" ThreadingModel="both"/> <ActivatableClass ActivatableClassId="VideoEffects.SquareEffect" ThreadingModel="both"/> </InProcessServer> </Extension> </Extensions>

Do you know where the problem is?

Best regards from germany

Peter

@mmaitre314
Copy link
Owner

Could you be building a Win10 app by any chance? I haven't ported the NuGet to Win10 (Win10 offers similar functionalities built-in). Otherwise, would you have more details about what you mean by 'any definition for "Properties"'? What kind of errors do you get (build error log, exception callstack, etc.)?

@DaPete89
Copy link
Author

DaPete89 commented Mar 7, 2016

No Way to build it in a W10 App, because we have just W8.1 Phones here :)
Error Code is CS1061: I'll try to translate the text in english :)

" LumiaAnalyzerDefinition " contains no definition for " ActivatableClassId " , and it was not found ActivatableClassId extension method that takes a first argument of type ' LumiaAnalyzerDefinition " (are you missing a using directive or an assembly reference ) .

The same Text by "Properties".

But var definition = new LumiaAnalyzerDefinition(ColorMode.Yuv420Sp, 640, AnalyzeBitmap); works, so it knows the LumiaanalyzerDefinition, or not?

@mmaitre314
Copy link
Owner

Strange indeed. If you F12 on it or use Object Browser, does it show the class derive from Windows.Media.Effects.IVideoEffectDefinition? That interface is missing in Win81 so I added an extra definition there, but that should not impact WP81 (unless somehow wrong DLLs are getting picked up).

public ref class LumiaAnalyzerDefinition sealed
#if WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP
        : public Windows::Media::Effects::IVideoEffectDefinition
#else
        : public VideoEffects::IVideoEffectDefinition
#endif

@DaPete89
Copy link
Author

DaPete89 commented Mar 7, 2016

I'm new in VS and Windows programming, so i don't understand your example right.
Shell I copy the code into:
`
internal class LumiaAnalyzerDefinition
{

    private Action<Bitmap, TimeSpan> analyzeBitmap;
    private Action<Bitmap, TimeSpan> analyzeBitmap1;
    private int v;
    private object yuv420Sp;

    public LumiaAnalyzerDefinition(ColorMode yuv420Sp, int v, Action<Bitmap, TimeSpan> analyzeBitmap1)
    {
        this.yuv420Sp = yuv420Sp;
        this.v = v;
        this.analyzeBitmap1 = analyzeBitmap1;
    }

    public LumiaAnalyzerDefinition(object yuv420Sp, int v, Action<Bitmap, TimeSpan> analyzeBitmap)
    {
        this.yuv420Sp = yuv420Sp;
        this.v = v;
        this.analyzeBitmap = analyzeBitmap;
    }



}`

?

and yes, the IVideoEffectDefinition are available.

@mmaitre314
Copy link
Owner

Did you implement LumiaAnalyzerDefinition in your code? It should come from the DLLs in the NuGet package.

@DaPete89
Copy link
Author

DaPete89 commented Mar 7, 2016

Hallo,
without implementating the DLL
var definition = new LumiaAnalyzerDefinition(ColorMode.Yuv420Sp, 640, AnalyzeBitmap); won't work?
So I think its implementated :)

@DaPete89
Copy link
Author

DaPete89 commented Mar 8, 2016

Im such a big idiot, your right. I'm create my own LumiaAnalyzerClass.
Big thanks to you :)

@DaPete89
Copy link
Author

DaPete89 commented Apr 27, 2016

Not the right topic but i don't want to create a new topic.
Is there any way to run the VideoEffects on W10 UniversalApp?
Installed is LumiaImagingSDK.UWP and win2d.uwp/win2d.win81.

@mmaitre314
Copy link
Owner

In W10 IBasicVideoEffect makes VideoEffects mostly obsolete.Otherwise copying the VS project into your solution might work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants