BBC BASIC for Windows
« Using Directshow through COM »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:56pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Using Directshow through COM  (Read 833 times)
kgoodyer
New Member
Image


member is offline

Avatar




PM


Posts: 5
xx Using Directshow through COM
« Thread started on: Nov 26th, 2013, 9:48pm »

I hope Richard or somebody could help me understand a couple of issues with accessing Directshow. I will use Richards example for playing a media file.

Code:
      REM Create a media control object
      
      IID_IMediaControl% = FNguid("{56a868b1-0ad4-11ce-b03a-0020af0ba770}")
      
      SYS !(!m_graphBuilder%), m_graphBuilder%, IID_IMediaControl%, ^m_mediaControl% TO hr%
      IF hr% THEN ERROR 100, "Could not instantiate media control object"
      : 


I'm a little unsure about the ^m_mediaControl% I understand this is effectively a pointer to m_mediaControl% where is m_mediaControl% declared or created?

The second issue is how did you figure out the indexing into these structures, for example the +44 in this segment of your code.

Code:
 REM Create a Filter Graph (mediafile$ = Full qualified Path to media file)
      
      SYS !(!m_mediaControl%+44), m_mediaControl%, FNwide(mediafile$), 0 TO hr%
      IF hr% THEN ERROR 100, "Could not render file "+mediafile$
      : 


I have searched the web and cant find any info, are they hidden dark inside a Microsoft c++ header file?

I am actually on a mission here, to prove to my work colleagues that basic, especially BBC basic is not a dead language.

Many Thanks in Advance

Keith
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Using Directshow through COM
« Reply #1 on: Nov 27th, 2013, 12:40am »

on Nov 26th, 2013, 9:48pm, kgoodyer wrote:
where is m_mediaControl% declared or created?

If the variable has already been declared, the ^ operator will return a pointer to it. If not, the ^ operator creates the variable.

Quote:
The second issue is how did you figure out the indexing into these structures, for example the +44 in this segment of your code... I have searched the web and cant find any info, are they hidden dark inside a Microsoft c++ header file?

They're in a header file, yes. You may want to install the relevant Microsoft SDK on your PC so you can search the header files easily. I've often thought about writing a little utility to convert the object declarations to BBC code automatically, but that's as far as it's ever got.

Using a constant like 44 saves some code, but I would encourage you to use the technique described on the Wiki here because it's more elegant:

http://bb4w.wikispaces.com/Calling+object+methods+using+structures

If you transfer the list of methods (in the correct order!) from the header file to the structure declaration all the offsets will be worked out automatically rather than requiring 'magic constants'.

Richard.
User IP Logged

kgoodyer
New Member
Image


member is offline

Avatar




PM


Posts: 5
xx Re: Using Directshow through COM
« Reply #2 on: Nov 27th, 2013, 8:28pm »

Thanks Richard, that a real help. I did manage to find the Media control and Event header files, and figure it all out. Going to spend the evening putting some structured procedures around them.

Keith
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls