Example #1
0
 public VideoDecoder(string path)
 {
     decoder       = new MFDecoder.Decoder(path);
     checkVideo    = new ManualResetEvent(false);
     checkAudio    = new ManualResetEvent(false);
     checkQueue    = new ManualResetEvent(false);
     state         = State.Initialized;
     width         = decoder.GetWidth();
     height        = decoder.GetHeight();
     lumaTexture   = new Texture2D();
     chromaTexture = new Texture2D();
     texture       = new RenderTexture(width, height);
     audioQueue    = new Queue <Sample>();
     videoQueue    = new Queue <Sample>();
     if (material == null)
     {
         material     = new YUVtoRGBMaterial();
         mesh         = new Mesh <VertexPosUV>();
         mesh.Indices = new ushort[] {
             0, 1, 2, 2, 3, 0
         };
         mesh.Vertices = new VertexPosUV[] {
             new VertexPosUV()
             {
                 UV1 = new Vector2(0, 0), Pos = new Vector2(-1, 1)
             },
             new VertexPosUV()
             {
                 UV1 = new Vector2(1, 0), Pos = new Vector2(1, 1)
             },
             new VertexPosUV()
             {
                 UV1 = new Vector2(1, 1), Pos = new Vector2(1, -1)
             },
             new VertexPosUV()
             {
                 UV1 = new Vector2(0, 1), Pos = new Vector2(-1, -1)
             },
         };
         mesh.AttributeLocations = new[] { ShaderPrograms.Attributes.Pos1, ShaderPrograms.Attributes.UV1 };
         mesh.DirtyFlags         = MeshDirtyFlags.All;
     }
     audioPlayer = new AudioPlayer();
     Window.Current.InvokeOnRendering(() => {
         var rt = PlatformRenderer.CurrentRenderTarget;
         try {
             PlatformRenderer.SetRenderTarget(texture);
             PlatformRenderer.Clear(ClearOptions.All, new Color4(0, 0, 0, 0));
         } finally {
             PlatformRenderer.SetRenderTarget(rt);
         }
     });
 }
Example #2
0
 public static void Clear(ClearOptions options, Color4 color)
 {
     PlatformRenderer.Clear(options, color);
 }
Example #3
0
 public static void Clear(ClearOptions options, Color4 color, float depth, byte stencil)
 {
     PlatformRenderer.Clear(options, color, depth, stencil);
 }
Example #4
0
 public static void Clear(ClearTarget targets, float r, float g, float b, float a)
 {
     PlatformRenderer.Clear(targets, r, g, b, a);
 }