 |
progdigy.com
|
| View previous topic :: View next topic |
| Author |
Message |
pbreneman Newbie


Joined: 19 Mar 2005 Posts: 5
|
Posted: Fri Jan 14, 2005 12:22 am Post subject: |
|
|
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 |
|
 |
pbreneman Newbie


Joined: 19 Mar 2005 Posts: 5
|
Posted: Fri Jan 14, 2005 12:56 am Post subject: |
|
|
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 |
|
 |
Dinux Member


Joined: 19 Mar 2005 Posts: 16
|
Posted: Sun Jan 16, 2005 11:33 pm Post subject: |
|
|
Tried to ask Geraint Davies directly?
|
|
| Back to top |
|
 |
Andrea08 Advanced Member


Joined: 17 Sep 2005 Posts: 43
|
Posted: Thu Sep 22, 2005 2:50 pm Post subject: |
|
|
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 |
|
 |
jianyu_21 Newbie


Joined: 02 Oct 2005 Posts: 5
|
Posted: Wed Mar 08, 2006 2:40 am Post subject: |
|
|
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 |
|
 |
MrWest Member


Joined: 08 Nov 2005 Posts: 16
|
Posted: Wed Mar 08, 2006 1:57 pm Post subject: |
|
|
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 |
|
 |
Paul Glagla Advanced Member

![]()
Joined: 19 Mar 2005 Posts: 67
|
Posted: Wed Mar 15, 2006 12:09 pm Post subject: pausing the capture |
|
|
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 |
|
 |
astral Guest
|
Posted: Wed Mar 15, 2006 12:59 pm Post subject: Re: pausing the capture |
|
|
| 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


Joined: 16 Apr 2006 Posts: 1
|
Posted: Sat Apr 22, 2006 8:44 am Post subject: Gmfbridge Delphi |
|
|
Please someone help me using Gmfbridge in Delphi.
A sample application would be a great help for me.
Thanks |
|
| Back to top |
|
 |
jianyu_21 Newbie


Joined: 02 Oct 2005 Posts: 5
|
Posted: Fri Apr 28, 2006 9:47 am Post subject: |
|
|
I have use GMFBridge in a video sureillance demo project before. It is just a demo, full of urgly code, bugs.
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.  |
|
| Back to top |
|
 |
Andrea08 Advanced Member


Joined: 17 Sep 2005 Posts: 43
|
Posted: Fri Apr 28, 2006 4:13 pm Post subject: |
|
|
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 |
|
 |
jianyu_21 Newbie


Joined: 02 Oct 2005 Posts: 5
|
|
| Back to top |
|
 |
jianyu_21 Newbie


Joined: 02 Oct 2005 Posts: 5
|
Posted: Mon May 29, 2006 2:31 am Post subject: |
|
|
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 |
|
 |
clustermaster Newbie


Joined: 18 May 2006 Posts: 8
|
Posted: Mon Jun 12, 2006 6:11 pm Post subject: |
|
|
Hi,
where can i find the GMFBridgeLib_TLB unit ?
greetings
Mario |
|
| Back to top |
|
 |
dbertholini Advanced Member


Joined: 19 Mar 2005 Posts: 68
|
Posted: Tue Jun 20, 2006 10:05 pm Post subject: |
|
|
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 |
|
 |
|
|
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
|