Package net.sf.jdshow

Examples of net.sf.jdshow.ComException


         int hr;
        
      long[] p = new long[1];
      hr = Com.CoCreateInstance(Com.CLSID_FilterGraph, 0L, Com.CLSCTX_ALL, Com.IID_IGraphBuilder, p);
      if (Com.FAILED(hr))
        throw new ComException(hr);
     
      graphBuilder = new IGraphBuilder(p[0]);
     

       
      hr = graphBuilder.RenderFile(path, "");
      if (Com.FAILED(hr))
        throw new ComException(hr);
 
      hr = graphBuilder.QueryInterface(Com.IID_IMediaControl, p);
      if (Com.FAILED(hr))
        throw new ComException(hr);
      mediaControl = new IMediaControl(p[0]);
     
      hr = graphBuilder.QueryInterface(Com.IID_IMediaSeeking, p);
      if (Com.FAILED(hr))
        throw new ComException(hr);
      mediaSeeking = new IMediaSeeking(p[0]);
     
 
      hr = graphBuilder.QueryInterface(Com.IID_IVideoWindow, p);
      if (Com.FAILED(hr))
        throw new ComException(hr);
     
      // determine video size:
      final IVideoWindow videoWindow = new IVideoWindow(p[0]);

      {
        long[] width = new long[1];
        hr = videoWindow.get_Width(width);
        if (Com.FAILED(hr))
          throw new ComException(hr);
        //logger.fine("width: " + width[0]);
       
        long[] height = new long[1];
        hr = videoWindow.get_Height(height);
        if (Com.FAILED(hr))
          throw new ComException(hr);
        //logger.fine("height: " + height[0]);
       
        videoSize = new Dimension((int) width[0], (int) height[0]);
      }
     
View Full Code Here


      long[] current = new long[1];
      long[] stop = new long[1];
     
      int hr = mediaSeeking.GetPositions(current, stop);
      if (Com.FAILED(hr))
        throw new ComException(hr);
     
      current[0] = t.getNanoseconds() / 100// TODO: this assumes REFERENCE_TIME format is being used.
     
      hr = mediaSeeking.SetPositions(current, IMediaSeeking.AM_SEEKING_AbsolutePositioning, stop, IMediaSeeking.AM_SEEKING_NoPositioning);
      if (Com.FAILED(hr))
        throw new ComException(hr);     
     
     
    }
    catch (ComException e)
    {
View Full Code Here

   
    try
    {
      int hr = mediaSeeking.SetRate(rate);
      if (Com.FAILED(hr))
        throw new ComException(hr);
    }
    catch (ComException e)
    {
      logger.log(Level.WARNING, "" + e, e);
      return getRate()// TODO: what to return?
View Full Code Here

   
    try
    {
      int hr = mediaControl.Run();
      if (Com.FAILED(hr))
        throw new ComException(hr);
    }
    catch (ComException e)
    {
      logger.log(Level.WARNING, "" + e, e);
      return false;
View Full Code Here

      {
        long[] duration = new long[1];
       
        int hr = mediaSeeking.GetDuration(duration);
        if (Com.FAILED(hr))
          throw new ComException(hr);
       
        return new Time(duration[0] * 100)// TODO: this assumes REFERENCE_TIME format is being used.
       
      }
      catch (ComException e)
View Full Code Here

      {
        long[] current = new long[1];
       
        int hr = mediaSeeking.GetCurrentPosition(current);
        if (Com.FAILED(hr))
          throw new ComException(hr);
       
        return new Time(current[0] * 100)// TODO: this assumes REFERENCE_TIME format is being used.
       
      }
      catch (ComException e)
View Full Code Here

       
      try
      {
        final int hr = WindowedRendering.InitWindowedRendering2(hwnd, graphBuilder);
      if (Com.FAILED(hr))
        throw new ComException(hr);
      }
      catch (ComException e)
      {
        logger.log(Level.WARNING, "" + e, e);
        return false;
View Full Code Here

TOP

Related Classes of net.sf.jdshow.ComException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.