🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.multimedia
20 messages
20 total messages Started by Jonathan Benedicto Fri, 31 Dec 2004 19:54
custom writer sink problem
#286
Author: Jonathan Benedicto
Date: Fri, 31 Dec 2004 19:54
12 lines
1428 bytes
I've tried to build my own custom writer sink using the windows media format 
sdk, but although the app runs fine, the writer sink's OnDataUnit method is 
never called.

The QueryInterface is called twice, neither time asking for IID_IUnknown or 
IID_IWMWriterSink or IID_IWMRegisterCallback. So I just return 
E_NOINTERFACE.

Does anyone have any ideas what I've done wrong ?

Jonathan
-- 
Re: custom writer sink problem
#287
Author: Remy Lebeau (TeamB)
Date: Sat, 01 Jan 2005 20:10
28 lines
1891 bytes
"Jonathan Benedicto" <incorrect@no.server> wrote in message
news:41d5ae65$1@newsgroups.borland.com...

> I've tried to build my own custom writer sink using the windows media
> format sdk, but although the app runs fine, the writer sink's OnDataUnit
> method is never called.

Did you register the sink with IWMWriter?  If it does not know about your
sink, it obviously can't use it.

> The QueryInterface is called twice, neither time asking for IID_IUnknown
> or IID_IWMWriterSink or IID_IWMRegisterCallback.

What exactly does it ask for?  My guess would be that it is looking for
either IID_IWMWriterFileSink, IID_IWMWriterNetworkSink, or
IID_IWMWriterPushSink.  Those are the three types that IWMWriter supports by
default.  If that turns out to be the case, then I would surmise that your
sink is not being set up correctly.

Have you read the following article yet?

    Working with Writer Sinks

http://msdn.microsoft.com/library/en-us/wmform95/htm/workingwithwritersinks.asp


Gambit
Re: custom writer sink problem
#288
Author: Jonathan Benedicto
Date: Mon, 03 Jan 2005 17:44
61 lines
3096 bytes
Here is the code that I use to add the custom sink to the writer.

        hr = pWriter->QueryInterface(IID_IWMWriterAdvanced, 
(void**)&pWriterAdvanced);
        if(FAILED(hr)){
                SendError("Couldn't initialize advanced writer.");
                pWriter->Release();
                return;
        }

        pCustomSink = new TWMCustomSink(FileName->Caption);

        hr = pWriterAdvanced->AddSink(pCustomSink);
        if(FAILED(hr)){
                SendError("Couldn't add sink.");
                pWriter->Release();
                pCustomSink->Release();
                return;
        }

I found out that the QueryInterface is requesting IID_IWMWriterFileSink3. So 
I just return E_NOINTERFACE.

I have read that article, yes.

-- 

Jonathan
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:41d70359$1@newsgroups.borland.com...
>
> "Jonathan Benedicto" <incorrect@no.server> wrote in message
> news:41d5ae65$1@newsgroups.borland.com...
>
>> I've tried to build my own custom writer sink using the windows media
>> format sdk, but although the app runs fine, the writer sink's OnDataUnit
>> method is never called.
>
> Did you register the sink with IWMWriter?  If it does not know about your
> sink, it obviously can't use it.
>
>> The QueryInterface is called twice, neither time asking for IID_IUnknown
>> or IID_IWMWriterSink or IID_IWMRegisterCallback.
>
> What exactly does it ask for?  My guess would be that it is looking for
> either IID_IWMWriterFileSink, IID_IWMWriterNetworkSink, or
> IID_IWMWriterPushSink.  Those are the three types that IWMWriter supports 
> by
> default.  If that turns out to be the case, then I would surmise that your
> sink is not being set up correctly.
>
> Have you read the following article yet?
>
>    Working with Writer Sinks
>
> http://msdn.microsoft.com/library/en-us/wmform95/htm/workingwithwritersinks.asp
>
>
> Gambit
>
> 
Re: custom writer sink problem
#289
Author: Remy Lebeau (TeamB)
Date: Mon, 03 Jan 2005 18:45
21 lines
1875 bytes
"Jonathan Benedicto" <incorrect@no.server> wrote in message
news:41d98468@newsgroups.borland.com...

> I found out that the QueryInterface is requesting
> IID_IWMWriterFileSink3. So I just return E_NOINTERFACE.

That makes sense.  According to the documentation, the Media SDK only
supports File, Network, and Push sinks.  Even for a custom sink, it would
appear that you need to implement one of those three types.  Which means
implementing either IWMWriterFileSink/2/3, IWMWriterNetworkSink, or
IWMWriterPushSink in addition to the base IWMWriterSink interface.

Is IID_IWMWriterFileSink3 being requested both times QueryInterface() is
called?

What exactly do you need your custom sink to do in the first place?  You
never did explain that part yet.


Gambit
Re: custom writer sink problem
#290
Author: Jonathan Benedicto
Date: Mon, 03 Jan 2005 18:49
35 lines
2223 bytes
I am building the sink to do specialized audio transfer between computers.

QueryInterface requests IWMWriterFileSink3 both times it is called.

So do you think that I should derive my custom sink from IWMWriterFileSink 
or IWMWriterNetworkSink or IWMWriterPushSink ?
-- 

Jonathan

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:41d99265$1@newsgroups.borland.com...
>
> "Jonathan Benedicto" <incorrect@no.server> wrote in message
> news:41d98468@newsgroups.borland.com...
>
>> I found out that the QueryInterface is requesting
>> IID_IWMWriterFileSink3. So I just return E_NOINTERFACE.
>
> That makes sense.  According to the documentation, the Media SDK only
> supports File, Network, and Push sinks.  Even for a custom sink, it would
> appear that you need to implement one of those three types.  Which means
> implementing either IWMWriterFileSink/2/3, IWMWriterNetworkSink, or
> IWMWriterPushSink in addition to the base IWMWriterSink interface.
>
> Is IID_IWMWriterFileSink3 being requested both times QueryInterface() is
> called?
>
> What exactly do you need your custom sink to do in the first place?  You
> never did explain that part yet.
>
>
> Gambit
>
> 
Re: custom writer sink problem
#291
Author: Remy Lebeau (TeamB)
Date: Mon, 03 Jan 2005 20:11
10 lines
1352 bytes
"Jonathan Benedicto" <incorrect@no.server> wrote in message
news:41d993a0$1@newsgroups.borland.com...

> I am building the sink to do specialized audio transfer between computers.

Transfer how exactly?


Gambit
Re: custom writer sink problem
#292
Author: Jonathan Benedicto
Date: Mon, 03 Jan 2005 20:50
21 lines
1563 bytes
Basically compress the audio into the wma format then send via network, 
internet etc. to another computer to be output there.

-- 
Jonathan

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:41d9a7a1$1@newsgroups.borland.com...
>
> "Jonathan Benedicto" <incorrect@no.server> wrote in message
> news:41d993a0$1@newsgroups.borland.com...
>
>> I am building the sink to do specialized audio transfer between 
>> computers.
>
> Transfer how exactly?
>
>
> Gambit
>
> 
Re: custom writer sink problem
#293
Author: Remy Lebeau (TeamB)
Date: Mon, 03 Jan 2005 21:19
19 lines
1955 bytes
"Jonathan Benedicto" <incorrect@no.server> wrote in message
news:41d9b010$1@newsgroups.borland.com...

> Basically compress the audio into the wma format then send
> via network, internet etc. to another computer to be output there.

What is wrong with using the native sinks for that?  ASF files already
contain WMA-compressed data.  What is your custom code going to be doing
that the native code does not already do?

Besides, you did not answer my previous question.  How is the actual
transfer itself being performed?  TCP/IP?  UDP?  Other?  And in what
direction?  Is your sink connecting to the target machine, or is the target
machine connecting to your sink?  It makes a difference on which kind of
sink you use.


Gambit
Re: custom writer sink problem
#294
Author: Jonathan Benedicto
Date: Mon, 03 Jan 2005 21:26
35 lines
2525 bytes
I want to use a TCP/IP connection, and have the target machine connecting to 
the sink. However, I needed the custom sink because I wanted to have 
encryption in the transfer so that no other machine could listen to the 
stream.

Maybe I should look into DRM for the encryption instead of using my own 
system.

-- 
Jonathan

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:41d9b690$1@newsgroups.borland.com...
>
> "Jonathan Benedicto" <incorrect@no.server> wrote in message
> news:41d9b010$1@newsgroups.borland.com...
>
>> Basically compress the audio into the wma format then send
>> via network, internet etc. to another computer to be output there.
>
> What is wrong with using the native sinks for that?  ASF files already
> contain WMA-compressed data.  What is your custom code going to be doing
> that the native code does not already do?
>
> Besides, you did not answer my previous question.  How is the actual
> transfer itself being performed?  TCP/IP?  UDP?  Other?  And in what
> direction?  Is your sink connecting to the target machine, or is the 
> target
> machine connecting to your sink?  It makes a difference on which kind of
> sink you use.
>
>
> Gambit
>
> 
Re: custom writer sink problem
#295
Author: Remy Lebeau (TeamB)
Date: Mon, 03 Jan 2005 21:45
24 lines
1963 bytes
"Jonathan Benedicto" <incorrect@no.server> wrote in message
news:41d9b885$1@newsgroups.borland.com...

> I want to use a TCP/IP connection, and have the target machine
> connecting to the sink.

Then you need IWMWriterNetworkSink for that.

> However, I needed the custom sink because I wanted to have
> encryption in the transfer so that no other machine could listen
> to the stream.

You did not say anything about encryption before.  That changes things a
bit.

> Maybe I should look into DRM for the encryption instead
> of using my own system.

That would be wise.  You should never implement encryption manually.  It is
too error-prone.  Use established encryption means instead.


Gambit
Re: custom writer sink problem
#296
Author: Jonathan Benedicto
Date: Mon, 03 Jan 2005 22:48
37 lines
2293 bytes
My problem with DRM is that I don't know how good at protecting streams it 
is. And it requires licencing from Microsoft.

I was going to use the OpenSSL libraries to do the encryption.

-- 
Jonathan

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:41d9bc8b$1@newsgroups.borland.com...
>
> "Jonathan Benedicto" <incorrect@no.server> wrote in message
> news:41d9b885$1@newsgroups.borland.com...
>
>> I want to use a TCP/IP connection, and have the target machine
>> connecting to the sink.
>
> Then you need IWMWriterNetworkSink for that.
>
>> However, I needed the custom sink because I wanted to have
>> encryption in the transfer so that no other machine could listen
>> to the stream.
>
> You did not say anything about encryption before.  That changes things a
> bit.
>
>> Maybe I should look into DRM for the encryption instead
>> of using my own system.
>
> That would be wise.  You should never implement encryption manually.  It 
> is
> too error-prone.  Use established encryption means instead.
>
>
> Gambit
>
> 
Re: custom writer sink problem
#297
Author: Remy Lebeau (TeamB)
Date: Tue, 04 Jan 2005 00:16
12 lines
1730 bytes
"Jonathan Benedicto" <incorrect@no.server> wrote in message
news:41d9cb9f@newsgroups.borland.com...

> I was going to use the OpenSSL libraries to do the encryption.

How would players be able to handle your custom data?  Since your code is
only on the sending side, the receivers would have no clue how you encrypted
the data.  Or are you planning on writing your own player as well?


Gambit
Re: custom writer sink problem
#298
Author: Jonathan Benedicto
Date: Tue, 04 Jan 2005 00:47
34 lines
2640 bytes
Yes, I was planning on building a player as well.

To be quite frank with you, I am actually trying to build a VoIP system that 
uses the Windows Media Audio format. A couple of months ago, before I even 
knew that VoIP existed, the Lord gave me the idea of building a phone system 
that would use the internet for audio transmission. With God's help, I chose 
Windows Media Audio because of the excellent quality / bandwidth that it was 
able to produce. I soon found out about VoIP, and although so many other 
companies are already doing it, I figured that the Windows Media would give 
me a substantial lead.

So, that is why I've been querying these groups like this. I've actually 
been using BCB for something like 2 years now.

-- 
Jonathan

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:41d9e09c$1@newsgroups.borland.com...
>
> "Jonathan Benedicto" <incorrect@no.server> wrote in message
> news:41d9cb9f@newsgroups.borland.com...
>
>> I was going to use the OpenSSL libraries to do the encryption.
>
> How would players be able to handle your custom data?  Since your code is
> only on the sending side, the receivers would have no clue how you
> encrypted
> the data.  Or are you planning on writing your own player as well?
>
>
> Gambit
>
>
Re: custom writer sink problem
#299
Author: Jonathan Benedicto
Date: Tue, 04 Jan 2005 20:00
36 lines
2452 bytes
I tried to use the WMWriterNetworkSink, but for some strange reason it does 
not work. There must be something I'm doing outside of the sink code that is 
stopping either the network writer, or my custom writer to work.

-- 
Jonathan

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:41d9bc8b$1@newsgroups.borland.com...
>
> "Jonathan Benedicto" <incorrect@no.server> wrote in message
> news:41d9b885$1@newsgroups.borland.com...
>
>> I want to use a TCP/IP connection, and have the target machine
>> connecting to the sink.
>
> Then you need IWMWriterNetworkSink for that.
>
>> However, I needed the custom sink because I wanted to have
>> encryption in the transfer so that no other machine could listen
>> to the stream.
>
> You did not say anything about encryption before.  That changes things a
> bit.
>
>> Maybe I should look into DRM for the encryption instead
>> of using my own system.
>
> That would be wise.  You should never implement encryption manually.  It 
> is
> too error-prone.  Use established encryption means instead.
>
>
> Gambit
>
> 
Re: custom writer sink problem
#300
Author: Remy Lebeau (TeamB)
Date: Tue, 04 Jan 2005 21:00
12 lines
1561 bytes
"Jonathan Benedicto" <incorrect@no.server> wrote in message
news:41daf5c8$1@newsgroups.borland.com...

> I tried to use the WMWriterNetworkSink, but for some strange
> reason it does not work.

Just saying that it does not work says nothing at all about the actual
problem that you are having.  You need to be more specifc.


Gambit
Re: custom writer sink problem
#301
Author: Jonathan Benedicto
Date: Tue, 04 Jan 2005 21:16
27 lines
2237 bytes
The app runs fine, and it opens port 8080, writing starts, but when I try to 
connect to it using WMP, it can't connect to the app.

netstat tells me that the port is still listening, even after WMP fails.

I've even copied the code from the help file and even that didn't work, but 
caused the same prob.

-- 
Jonathan

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:41db0385@newsgroups.borland.com...
>
> "Jonathan Benedicto" <incorrect@no.server> wrote in message
> news:41daf5c8$1@newsgroups.borland.com...
>
>> I tried to use the WMWriterNetworkSink, but for some strange
>> reason it does not work.
>
> Just saying that it does not work says nothing at all about the actual
> problem that you are having.  You need to be more specifc.
>
>
> Gambit
>
> 
Re: custom writer sink problem
#302
Author: Remy Lebeau (TeamB)
Date: Tue, 04 Jan 2005 22:34
13 lines
1929 bytes
"Jonathan Benedicto" <incorrect@no.server> wrote in message
news:41db07b9$1@newsgroups.borland.com...

> The app runs fine, and it opens port 8080, writing starts, but
> when I try to connect to it using WMP, it can't connect to the app.

Why not?  Again, specifics please.  Are there any errors in WMP?  Are you
using the standard IWMWriterNetworkSink implementation that is provided by
WMCreateWriterNetworkSink(), or are using your custom one?


Gambit
Re: custom writer sink problem
#303
Author: Jonathan Benedicto
Date: Tue, 04 Jan 2005 22:46
34 lines
2791 bytes
I am using WMCreateWriterNetworkSink to create a IWMWriterNetworkSink that 
opens port 8080.

I know that the app successfully opens that port because netstat tells me 
port 8080 is opened. Then the app starts to WriteSample the audio into the 
writer.

I then use WMP to connect to http://127.0.0.1:8080, but after a short delay, 
WMP displays this message: "Windows Media Player cannot connect to the 
server. The server name might not be correct, the server might not be 
available, or your proxy settings might not be correct.".

I hope that this is specific enough. Please tell me if you need more info.

-- 
Jonathan

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:41db198f$1@newsgroups.borland.com...
>
> "Jonathan Benedicto" <incorrect@no.server> wrote in message
> news:41db07b9$1@newsgroups.borland.com...
>
>> The app runs fine, and it opens port 8080, writing starts, but
>> when I try to connect to it using WMP, it can't connect to the app.
>
> Why not?  Again, specifics please.  Are there any errors in WMP?  Are you
> using the standard IWMWriterNetworkSink implementation that is provided by
> WMCreateWriterNetworkSink(), or are using your custom one?
>
>
> Gambit
>
> 
Re: custom writer sink problem
#348
Author: Mark Jacobs
Date: Tue, 08 Mar 2005 14:08
18 lines
2213 bytes
Jonathan Benedicto wrote:
> I am using WMCreateWriterNetworkSink to create a IWMWriterNetworkSink that 
> opens port 8080.
> 
> I know that the app successfully opens that port because netstat tells me 
> port 8080 is opened. Then the app starts to WriteSample the audio into the 
> writer.
> 
> I then use WMP to connect to http://127.0.0.1:8080, but after a short delay, 
> WMP displays this message: "Windows Media Player cannot connect to the 
> server. The server name might not be correct, the server might not be 
> available, or your proxy settings might not be correct.".
> 
> I hope that this is specific enough. Please tell me if you need more info.
> 
Perhaps you have a firewall blocking port 8080 - XP SP2 switches on the 
firewall by default.
MJ
Re: custom writer sink problem
#349
Author: Jonathan Benedicto
Date: Tue, 08 Mar 2005 16:24
5 lines
1657 bytes
> Perhaps you have a firewall blocking port 8080 - XP SP2 switches on 
> the firewall by default.

I don't know what was happening, but I'm not using wma anymore. Thank 
you for trying to help me. 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads