TvCardAnalog.SetupCaptureFormat(): Can only work on HW cards?

Discussion in '1.0 final and SVN Builds' started by tanstaafl, January 20, 2009.

  1. tanstaafl

    tanstaafl Portal Member

    Joined:
    December 19, 2007
    Messages:
    13
    Likes Received:
    0
    Occupation:
    Computational Linguist (unemployed)
    Location:
    Uppsala
    Ratings:
    +0 / 0
    Home Country:
    Sweden Sweden
    TV-Server Version: 1.0-SVN rev 21374

    TvCardAnalog.SetupCaptureFormat() immediately returns if (_pinCapture == null).
    Isn't this always the case with software encoding cards (needing AddXXXCompressor to get _pinCapture)?

    Suggestion: test against _filterCapture instead.

    This way, analog software encoding cards get set up with correct PAL format just like hardware cards.
    Unless this breaks anything else, this could help some people until mistedD gets time to implement his improvements for analog cards.

    Have done a quick test on my Asus MyCinema 7131 Hybrid (which defaults to 320X?? resolution), seems to work.

    Current code:
    Code (Text):
    1.  
    2. private void SetupCaptureFormat()
    3.     {
    4.       if (_pinCapture == null)
    5.         return;
    6.       Log.Log.Info("VideoCaptureDevice:get Video stream control interface (IAMStreamConfig)");
    7.       DsGuid cat = new DsGuid(PinCategory.Capture);
    8.       Guid iid = typeof(IAMStreamConfig).GUID;
    9.       object o;
    10.       int hr = _capBuilder.FindInterface(cat, null, _filterCapture, iid, out o);
    11.       if (hr == 0)
    12.       {
    13.         _interfaceStreamConfigVideoCapture = o as IAMStreamConfig;
    14.         if (_interfaceStreamConfigVideoCapture != null)
    15.         {
    16.           SetFrameRate(25d);
    17.           SetFrameSize(new Size(720, 576));
    18.           Size size = GetFrameSize();
    19.           if (size.Width != 720 || size.Height != 576)
    20.           {
    21.             SetFrameSize(new Size(640, 480));
    22.           }
    23.         }
    24.       }
    25.       return;
    26.     }
    27.  

    Suggested change
    Code (Text):
    1.  
    2. private void SetupCaptureFormat()
    3.     {
    4.       if (_filterCapture == null)  // tanstaafl: was _pinCapture, change to allow setup of SW encoding cards.
    5.         return;
    6.       Log.Log.Info("VideoCaptureDevice:get Video stream control interface (IAMStreamConfig)");
    7.       DsGuid cat = new DsGuid(PinCategory.Capture);
    8.       Guid iid = typeof(IAMStreamConfig).GUID;
    9.       object o;
    10.       int hr = _capBuilder.FindInterface(cat, null, _filterCapture, iid, out o);
    11.       if (hr == 0)
    12.       {
    13.           _interfaceStreamConfigVideoCapture = o as IAMStreamConfig;
    14.           if (_interfaceStreamConfigVideoCapture != null)
    15.           {
    16.  
    17.               SetFrameRate(25d);
    18.               SetFrameSize(new Size(720, 576));
    19.               Size size = GetFrameSize();
    20.               if (size.Width != 720 || size.Height != 576)
    21.               {
    22.                   SetFrameSize(new Size(640, 480));
    23.               }
    24.           }
    25.  
    26.       }
    27.       return;
    28.     }
    29.  



     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. misterd
    • Premium Supporter

    misterd Retired Team Member

    Joined:
    April 4, 2006
    Messages:
    1,597
    Likes Received:
    280
    Ratings:
    +298 / 0
    Home Country:
    Germany Germany
    We had something like this already in SVN by mistake and many users reported that their card wasn't working anymore after this. Therefor we can't add such a general solution to the code. We need a solution where the user can set these values.

    Hopefully in one of the next upcoming versions of MP we will have this solution.

    MisterD
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!