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

tanstaafl

Portal Member
December 19, 2007
13
0
Uppsala
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:
private void SetupCaptureFormat()
    {
      if (_pinCapture == null)
        return;
      Log.Log.Info("VideoCaptureDevice:get Video stream control interface (IAMStreamConfig)");
      DsGuid cat = new DsGuid(PinCategory.Capture);
      Guid iid = typeof(IAMStreamConfig).GUID;
      object o;
      int hr = _capBuilder.FindInterface(cat, null, _filterCapture, iid, out o);
      if (hr == 0)
      {
        _interfaceStreamConfigVideoCapture = o as IAMStreamConfig;
        if (_interfaceStreamConfigVideoCapture != null)
        {
          SetFrameRate(25d);
          SetFrameSize(new Size(720, 576));
          Size size = GetFrameSize();
          if (size.Width != 720 || size.Height != 576)
          {
            SetFrameSize(new Size(640, 480));
          }
        }
      }
      return;
    }


Suggested change
Code:
private void SetupCaptureFormat()
    {
      if (_filterCapture == null)  // tanstaafl: was _pinCapture, change to allow setup of SW encoding cards.
        return;
      Log.Log.Info("VideoCaptureDevice:get Video stream control interface (IAMStreamConfig)");
      DsGuid cat = new DsGuid(PinCategory.Capture);
      Guid iid = typeof(IAMStreamConfig).GUID;
      object o;
      int hr = _capBuilder.FindInterface(cat, null, _filterCapture, iid, out o);
	  if (hr == 0)
	  {
		  _interfaceStreamConfigVideoCapture = o as IAMStreamConfig;
		  if (_interfaceStreamConfigVideoCapture != null)
		  {

			  SetFrameRate(25d);
			  SetFrameSize(new Size(720, 576));
			  Size size = GetFrameSize();
			  if (size.Width != 720 || size.Height != 576)
			  {
				  SetFrameSize(new Size(640, 480));
			  }
		  }

	  }
      return;
    }
 

misterd

Retired Team Member
  • Premium Supporter
  • April 4, 2006
    1,597
    314
    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
     

    Users who are viewing this thread

    Top Bottom