Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.

Welcome, Guest
Guest Settings

Thread: DSPack, Citrix and SetSyncSource()

This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Permlink Replies: 1 - Last Post: Sep 27, 2017 1:03 PM Last Post By: Clement Doss
Clement Doss

Posts: 76
Registered: 3/26/00
DSPack, Citrix and SetSyncSource()  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 25, 2017 12:25 PM

I using Delphi XE and DSPack 2.3.3.
I'm maintaining a desktop application with Webcam capture. The user is able to capture pictures of visitors and documents.
Everything is working fine. One of our largest customers is moving to Citrix 7.13 and the webcam is freezing.

Their support contacted Citrix and Citrix Engineering would like to know if the application is calling the IMediaFilter::SetSyncSource method to explicitly set the “reference clock” to the filter graph in their code regarding the webcam capturing.
I made a few test and in fact there's a call when the rendering starts. You can see the call when running DSPack demo "VideoCap":

  // now render streams
  with CaptureGraph as IcaptureGraphBuilder2 do
    // set the output filename
    SetOutputFileName(MEDIASUBTYPE_Avi, PWideChar(CapFile), multiplexer, Writer);
    // Connect Video preview (VideoWindow)
    if VideoSourceFilter.BaseFilter.DataLength > 0 then
      RenderStream(@PIN_CATEGORY_PREVIEW, nil, VideoSourceFilter as IBaseFilter,
        nil , VideoWindow as IBaseFilter);
    // Connect Video capture streams
    if VideoSourceFilter.FilterGraph <> nil then
      RenderStream(@PIN_CATEGORY_CAPTURE, nil, VideoSourceFilter as IBaseFilter,
        nil, multiplexer as IBaseFilter);
    // Connect Audio capture streams
    if AudioSourceFilter.FilterGraph <> nil then
      RenderStream(nil, nil, AudioSourceFilter as IBaseFilter,
        nil, multiplexer as IBaseFilter);

According to DSpack source comments:
    { The reference clock has changed. The filter graph manager sends this event
      when its IMediaFilter.SetSyncSource method is called.}
    property OnGraphClockChanged: TNotifyEvent read FOnGraphClockChanged write FOnGraphClockChanged;

And in fact OnGraphClockChanged gets fired after CaptureGraph.Play is called.

Is it possible to avoid calling SetSyncSource? Do you know if this will solve this issue?

Clement Doss

Posts: 76
Registered: 3/26/00
Re: DSPack, Citrix and SetSyncSource()  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 27, 2017 1:03 PM   in response to: Clement Doss in response to: Clement Doss
I'm still having problems. I built a small project with the absolute minimum component to start a video capture. No matter what I do, SetSyncSource is called. I thought for example that making the video display in a TPanel ( as opposed to correct sized form) might trigger SetSyncSource. I let the camera show in full screen, or in a floating window and it stills triggers SetSyncSource. I removed SampleGrabber, still triggers. "Niled" some parameters, still triggers.

I don't require Audio. Just video with low resolution.
I'm trying to find some article that explains how and when one would need to SetSyncSource, but even google doesn't know squat about it.
Is there an article describing the event handling cycle?

Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02