progdigy.com Forum Index progdigy.com

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GMFBridge usage in Delphi?
Goto page 1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    progdigy.com Forum Index -> DSPack Delphi
View previous topic :: View next topic  
Author Message
pbreneman
Newbie
Newbie


Joined: 19 Mar 2005
Posts: 5

PostPosted: Fri Jan 14, 2005 12:22 am    Post subject: Reply with quote

I am using DSPack in Delphi to capture using the Plextor ConvertX running Microsoft MPEG-4. I need to be able to pause the recording but pausing the graph doesn't work (the AVImux is the problem).

I found the web page for Geraint Davies, who was the original designer of the DirectShow technology ( http://www.gdcl.co.uk/index.htm ). It was on 24 November 2004 that he added an example ( http://www.gdcl.co.uk/articles/index.htm - Multiple Graphs in DirectShow) that provides the tools that I need to pause the recording.

Is anyone interested in helping me to be able to use this in Delphi?

Thanks,
Paul Breneman
http://www.BrenemanLabs.com
Back to top
View user's profile Send private message
pbreneman
Newbie
Newbie


Joined: 19 Mar 2005
Posts: 5

PostPosted: Fri Jan 14, 2005 12:56 am    Post subject: Reply with quote

I'm willing to pay a small reasonable amount to anyone who can quickly convert his preview example to Delphi. You don't need the ConvertX as any video capture device should work.

Or show me how I can do this a different way?

Thanks.
Back to top
View user's profile Send private message
Dinux
Member
Member


Joined: 19 Mar 2005
Posts: 16

PostPosted: Sun Jan 16, 2005 11:33 pm    Post subject: Reply with quote

Tried to ask Geraint Davies directly?

Back to top
View user's profile Send private message
Andrea08
Advanced Member
Advanced Member


Joined: 17 Sep 2005
Posts: 43

PostPosted: Thu Sep 22, 2005 2:50 pm    Post subject: Reply with quote

I'm interested in gmfbridge, especially in gmfPlay Demo. I have to playback mpeg2 files via XCard without the black video between files.

Do you have any Delphi sample code about it?

Thanks.
Andrea
Back to top
View user's profile Send private message
jianyu_21
Newbie
Newbie


Joined: 02 Oct 2005
Posts: 5

PostPosted: Wed Mar 08, 2006 2:40 am    Post subject: Reply with quote

register it and import into delphi, I have use it.

It has something amazing, about the return value, some function differ from the C declaration, Do you mean that?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
MrWest
Member
Member


Joined: 08 Nov 2005
Posts: 16

PostPosted: Wed Mar 08, 2006 1:57 pm    Post subject: Reply with quote

Hello.

I just wanted to say that I do have a GMFTest application made in Delphi6.
It allows to create a Video Playlist and then uses GMFBridge to switch between the clips.

If anyone would be interested contact me at jan@westmediasystems.com and I'll send it to you.

Regards,
Jan
_________________
West Mediasystems
Software solutions for the broadcast industry.
Back to top
View user's profile Send private message Visit poster's website
Paul Glagla
Advanced Member
Advanced Member


Joined: 19 Mar 2005
Posts: 67

PostPosted: Wed Mar 15, 2006 12:09 pm    Post subject: pausing the capture Reply with quote

To pause the capture and then resume it later IN THE SAME FILE you don't need the GMFBridge. It is very simple to build a custom trans-in-place filter doing nothing else then discarding the samples when you declare it to be paused.

The secret for that is to create a transform function that returns S_FALSE and not E_Fail. For instance the filter should have a flag Fpaused that may be changed in a custom interface, and the transform function looks just like

if Fpaused then return:=S_False else return:=S_Ok.

The only caveat of this simple method is that the graph is not really paused, but continues to run without delivering samples to the avimux.


Last edited by Paul Glagla on Wed Mar 15, 2006 1:26 pm; edited 2 times in total
Back to top
View user's profile Send private message
astral
Guest





PostPosted: Wed Mar 15, 2006 12:59 pm    Post subject: Re: pausing the capture Reply with quote

Paul Glagla wrote:
To pause the capture and then resume it later IN THE SAME FILE you don't need the GMFBridge. It is very simple to build a custom trans-in-place filter doing nothing else then discrding the samples when you declare it to be paused.

The secret for this to create a transform function that returns S_FALSE and not E_Fail. For instance the filter should have a flag Fpaused that may be changed in a custom interface, and the transform function looks just like

if Fpaused then return:=S_False else return:=S_Ok.

The only caveat of this simple method is that the graph is not really paused, but continues to run without delivering samples to the avimux.


Paul, do you have a sample with this kind of filter ?

Thanks
Back to top
newcka
Newbie
Newbie


Joined: 16 Apr 2006
Posts: 1

PostPosted: Sat Apr 22, 2006 8:44 am    Post subject: Gmfbridge Delphi Reply with quote

Please someone help me using Gmfbridge in Delphi.
A sample application would be a great help for me.

Thanks
Back to top
View user's profile Send private message
jianyu_21
Newbie
Newbie


Joined: 02 Oct 2005
Posts: 5

PostPosted: Fri Apr 28, 2006 9:47 am    Post subject: Reply with quote

I have use GMFBridge in a video sureillance demo project before. It is just a demo, full of urgly code, bugs. Embarassed

Now just working on a G.723.1 project, when I am not so busy, I will check the code, and put it here.

Using GMFBridge in delphi is easy as in VC, just error detection mode make diffrence. In VC return ErrorCode, but in Delphi it Raise Execptions. Hope this can help somebody. Very Happy
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Andrea08
Advanced Member
Advanced Member


Joined: 17 Sep 2005
Posts: 43

PostPosted: Fri Apr 28, 2006 4:13 pm    Post subject: Reply with quote

A friend send me this code but this play with 1.0.0.6 dll version.
the 1.0.0.12 has change some calls.

Andrea.


Code:

unit GMFBridgeUnit;

interface

uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, ExtCtrls, DirectShow9, ActiveX, FileCtrl,
GMFBridgeLib_TLB, ComCtrls;

type

   TMediaType = (smUndefined, smOverlay, smVideoFile, smWK2Overlay);

   TForm1 = class(TForm)
    Panel1: TPanel;
     procedure MSG_Handler( var Msg : TMsg; var Handled : boolean );
    procedure FormShow(Sender: TObject);
   private
     { Private declarations }
     fHWND                      : HWND;
     m_pController              : IGMFBridgeController;
     m_pRenderGraph             : IGraphBuilder;
     m_pSinkFilter              : IUnknown;
     m_pSinkFilter2             : IUnknown;
     m_pRenderGraphSourceFilter : IUnknown;
     m_pSourceGraph1            : IGraphBuilder;
     m_pSourceGraph2            : IGraphBuilder;
     m_pFilterGraph             : IFilterGraph;
     m_pCaptureGraphBuilder     : ICaptureGraphBuilder;
     m_pMediaControl            : IMediaControl;
     m_pRenderMediaControl      : IMediaControl;
     m_pMediaSeeking            : IMediaSeeking;
     m_pMediaEvent              : IMediaEventEx;
     pfMUX                      : IBaseFilter;
     fMediaType                 : TMediaType;
     m_pVideoWindow             : IVideoWIndow;
     Style                      : integer;

   public
     { Public declarations }
     MyGraphRegister : integer;

   end;

const MSG_GMFBRIDGE = WM_USER+176;

var
   Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.MSG_Handler( var Msg : TMsg; var Handled : boolean );
begin
    { Switch to next video clip }
    if Msg.message = MSG_GMFBRIDGE then
    begin
       // Connect sink filter and feeder filter
 
m_pController.BridgeGraphs(m_pSinkFilter2,m_pRenderGraphSourceFilter);
       Handled := True;
    end;
end;

procedure TForm1.FormShow(Sender: TObject);
var HRES : HResult;
     i : integer;
     fFileSinkFilter : IFileSinkFilter;
begin
   fHWND := 0;
   fMediaType := smUndefined;
   // Initialize COM
   CoInitialize(Nil);
   //===============================================

   HRES := CoCreateInstance(CLASS_GMFBridgeController,nil,CLSCTX_INPROC,
                             // Create Bridge Controller
     IID_IGMFBridgeController,m_pController);
   m_pController.SetNotify(Application.Handle,MSG_GMFBRIDGE);
                              // Receive end-of-segment notifications via posted Windows message
   m_pController.AddStream(1, eUncompressed, 0);
                              // Create BridgeStream object for video
   m_pController.AddStream(0, eUncompressed, 0);
                              // Create BridgeStream object for audio
   m_pController.SetBufferMinimum(200);
                              // Give application more time to perform change-over between graphs.

   HRES := CoCreateInstance(CLSID_FilterGraph, nil, CLSCTX_INPROC,
IID_IFilterGraph, m_pSourceGraph1);      // Create Graph Builder
   m_pController.CreateSourceGraph('E:\1.avi', m_pSourceGraph1, m_pSinkFilter);
              // Insert sink filter into graph, create playback graph, connects pins

   HRES := CoCreateInstance(CLSID_FilterGraph, nil, CLSCTX_INPROC,
IID_IFilterGraph, m_pSourceGraph2);      // Create Graph Builder
   m_pController.CreateSourceGraph('E:\2.avi', m_pSourceGraph2, m_pSinkFilter2);
               // Insert sink filter into graph, create playback graph, connects pins

   HRES := CoCreateInstance(CLSID_FilterGraph,nil,CLSCTX_INPROC,IID_IFilterGraph,m_pRenderGraph);
    // Create render graph object


m_pController.CreateRenderGraph(m_pSinkFilter,m_pRenderGraph,m_pRenderGraphSourceFilter);
         // Insert source filter & pins into render graph, & render each  stream

   HRES := m_pRenderGraph.QueryInterface(IID_IMediaEventEx,m_pMediaEvent);
// Get media events interface
   HRES := m_pRenderGraph.QueryInterface( IID_IVideoWindow, m_pVideoWindow );
// Get video window interface

   m_pVideoWindow.get_WindowStyle(style);
                              // Set up video output window
Style := Style AND NOT WS_OVERLAPPEDWINDOW;
Style := Style OR WS_CHILD;
m_pVideoWindow.put_WindowStyle(style);
   HRES := m_pVideoWindow.put_Owner( Panel1.Handle);
m_pVideoWindow.SetWindowPosition(0, 0, Panel1.Width, Panel1.Height);
   Application.OnMessage := MSG_Handler;
                             // Allow app to trap Bridge Controller's end-of-clip messages

   HRES := m_pRenderGraph.QueryInterface(IID_IMediaControl,
m_pRenderMediaControl);                              // Get media control interface
   m_pRenderMediaControl.Run;
                                    // Play back clip

   m_pController.BridgeGraphs(m_pSinkFilter,m_pRenderGraphSourceFilter);
                             // Connect sink filter and feeder filter

   HRES := m_pSourceGraph1.QueryInterface(IID_IMediaControl,
m_pMediaControl);                              // Get media control   interface
   m_pMediaControl.Run;
                              // Play back clip

   m_pSourceGraph2.QueryInterface(IID_IMediaControl, m_pMediaControl);
                             // Get media control interface
   m_pMediaControl.Run;


end;

end.
Back to top
View user's profile Send private message
jianyu_21
Newbie
Newbie


Joined: 02 Oct 2005
Posts: 5

PostPosted: Fri May 12, 2006 3:13 am    Post subject: Reply with quote

I have translate GMFPlay into Delphi, Here is the code.
[url]
http://www.panensoft.com/GMFPlay_Delphi.rar[/url]

It can be used now, some small bug will be fixed soon.
_________________
http://www.panensoft.com


Last edited by jianyu_21 on Mon May 29, 2006 2:34 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jianyu_21
Newbie
Newbie


Joined: 02 Oct 2005
Posts: 5

PostPosted: Mon May 29, 2006 2:31 am    Post subject: Reply with quote

As I say before, You must catch the exception as an EOleException, and then get an HResult value to determine what happened when error ocurred.

There is a small piece of code to show it.

try
m_pSinkFilter:= pController.CreateSourceGraph(StringToOleStr(path), m_pGraph);
result:= S_OK;
except
on e: EOleException do
begin
result:= EOleException(e).ErrorCode;
end;
end;



I'm not sure where to need add above code 8O , so I've just fix creatClip procedure and upload the code to

http://www.panensoft.com/files/GMFPlay_Delphi.rar
_________________
http://www.panensoft.com
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
clustermaster
Newbie
Newbie


Joined: 18 May 2006
Posts: 8

PostPosted: Mon Jun 12, 2006 6:11 pm    Post subject: Reply with quote

Hi,

where can i find the GMFBridgeLib_TLB unit ?

greetings

Mario
Back to top
View user's profile Send private message
dbertholini
Advanced Member
Advanced Member


Joined: 19 Mar 2005
Posts: 68

PostPosted: Tue Jun 20, 2006 10:05 pm    Post subject: Reply with quote

Why every time that I try to execute this sample, when the application has to change to the next video file, it stopped, and nothing happens.

How can I use this demo to play a list of files ?

regards,
Danilo Bertholini
dbertholini@gmail.com
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    progdigy.com Forum Index -> DSPack Delphi All times are GMT
Goto page 1, 2, 3, 4, 5  Next
Page 1 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group