Jesús Leganés | 29 Jun 2012 13:18

Set ProxyServerMediaSession::fProxyRTSPClient as protected

I'm needing to be able to detect and log the
connect/disconnect/playing/paused/etc events done on the
ProxyServerMediaSession against the remote camera, so i thought i
could do it inheriting the internal ProxyRTSPClient and using a custom
one (i don't know if there's a better way to do it).

The fact is that reviewing the code it seems to me it's the correct
aproach, just use a ProxyServerMediaSession child constructor that
inits ProxyServerMediaSession::fProxyRTSPClient to my own
ProxyRTSPClient child class and i'm ready, but the fact is that this
attribute is private, so i can't be able to access to it. Do you know
if there's another better way to do it? And if not, could you be able
to set it as protected? I know that ProxyServerMediaSession is
intended to be a black box, i only want it to be a little bit gray...
:-P

By the way, i don't know if it would be better to do what i want the
ProxyServerMediaSession::fClientMediaSession attribute (i don't
believe so), but it's also private, so i got the same problem here.

Greetings, Jesús Leganés Combarro.

--

-- 
Jesús Leganés Combarro
Software developer at Vaelsys
Jesús Leganés | 29 Jun 2012 14:16

Re: Set ProxyServerMediaSession::fProxyRTSPClient as protected

I have review the code and yes, it seems it's the correct way but i
would need another modification on the code: change
RTSPClient::sendRequest() from private to protected, too. This way i
could be able to inherit this method on a child class that send the
event to my subsystem, and later just to call to the original
RTSPClient method.

2012/6/29 Jesús Leganés <jesus.lc@...>:
> I'm needing to be able to detect and log the
> connect/disconnect/playing/paused/etc events done on the
> ProxyServerMediaSession against the remote camera, so i thought i
> could do it inheriting the internal ProxyRTSPClient and using a custom
> one (i don't know if there's a better way to do it).
>
> The fact is that reviewing the code it seems to me it's the correct
> aproach, just use a ProxyServerMediaSession child constructor that
> inits ProxyServerMediaSession::fProxyRTSPClient to my own
> ProxyRTSPClient child class and i'm ready, but the fact is that this
> attribute is private, so i can't be able to access to it. Do you know
> if there's another better way to do it? And if not, could you be able
> to set it as protected? I know that ProxyServerMediaSession is
> intended to be a black box, i only want it to be a little bit gray...
> :-P
>
> By the way, i don't know if it would be better to do what i want the
> ProxyServerMediaSession::fClientMediaSession attribute (i don't
> believe so), but it's also private, so i got the same problem here.
>
> Greetings, Jesús Leganés Combarro.
>
(Continue reading)

Ross Finlayson | 29 Jun 2012 23:26
Favicon

Re: Set ProxyServerMediaSession::fProxyRTSPClient as protected

I have review the code and yes, it seems it's the correct way but i
would need another modification on the code: change
RTSPClient::sendRequest() from private to protected, too.

Ugh - If I did this, I'd also need to make it "virtual", so you could redefine it in a subclass.

Once again, are you sure that this is something that you really want to do?


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

_______________________________________________
live-devel mailing list
live-devel@...
http://lists.live555.com/mailman/listinfo/live-devel
Ross Finlayson | 29 Jun 2012 23:26
Favicon

Re: Set ProxyServerMediaSession::fProxyRTSPClient as protected

I have review the code and yes, it seems it's the correct way but i
would need another modification on the code: change
RTSPClient::sendRequest() from private to protected, too.

Ugh - If I did this, I'd also need to make it "virtual", so you could redefine it in a subclass.

Once again, are you sure that this is something that you really want to do?


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

_______________________________________________
live-devel mailing list
live-devel <at> lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel
Jesús Leganés | 29 Jun 2012 14:16

Re: Set ProxyServerMediaSession::fProxyRTSPClient as protected

I have review the code and yes, it seems it's the correct way but i
would need another modification on the code: change
RTSPClient::sendRequest() from private to protected, too. This way i
could be able to inherit this method on a child class that send the
event to my subsystem, and later just to call to the original
RTSPClient method.

2012/6/29 Jesús Leganés <jesus.lc <at> vaelsys.com>:
> I'm needing to be able to detect and log the
> connect/disconnect/playing/paused/etc events done on the
> ProxyServerMediaSession against the remote camera, so i thought i
> could do it inheriting the internal ProxyRTSPClient and using a custom
> one (i don't know if there's a better way to do it).
>
> The fact is that reviewing the code it seems to me it's the correct
> aproach, just use a ProxyServerMediaSession child constructor that
> inits ProxyServerMediaSession::fProxyRTSPClient to my own
> ProxyRTSPClient child class and i'm ready, but the fact is that this
> attribute is private, so i can't be able to access to it. Do you know
> if there's another better way to do it? And if not, could you be able
> to set it as protected? I know that ProxyServerMediaSession is
> intended to be a black box, i only want it to be a little bit gray...
> :-P
>
> By the way, i don't know if it would be better to do what i want the
> ProxyServerMediaSession::fClientMediaSession attribute (i don't
> believe so), but it's also private, so i got the same problem here.
>
> Greetings, Jesús Leganés Combarro.
>
> --
> Jesús Leganés Combarro
> Software developer at Vaelsys

--

-- 
Jesús Leganés Combarro
Software developer at Vaelsys
Ross Finlayson | 29 Jun 2012 23:22
Favicon

Re: Set ProxyServerMediaSession::fProxyRTSPClient as protected

I'm needing to be able to detect and log the
connect/disconnect/playing/paused/etc events done on the
ProxyServerMediaSession against the remote camera

I'm not sure exactly what you mean by this, but if your intention is to detect/log every client connection (etc.) to the proxy server, then you need to know that if two or more clients are accessing the same proxy stream concurrently, then the code for "ProxyServerMediaSession" (and its related classes) is executed only for the *first* such client.  I.e., the "Proxy*" code is unaware of the second and subsequent clients.

So if you want to detect/log every client connection (etc.) to the proxy server, then you would not modify (or subclass) the "Proxy*" code at all.  Instead, you would subclass "RTSPServer" and "RTSPServer::RTSPClientSession", and reimplement the "handleCmd_SETUP()" (etc.) virtual functions.


But if your intention is instead to detect/log only connections from the proxy server to the 'back-end' server (which is only a subset of the number of connections from front-end clients to the proxy server), then:

The fact is that reviewing the code it seems to me it's the correct
aproach, just use a ProxyServerMediaSession child constructor that
inits ProxyServerMediaSession::fProxyRTSPClient to my own
ProxyRTSPClient child class

Yes, but note that the existing "ProxyServerMediaSession" constructor already initializes the "fProxyRTSPClient" field (to a new "ProxyRTSPClient" object), so you'll need to delete this (using "Medium::close()") first, before assigning your new "ProxyRTSPClient" subclass object.

But hold on: At present, the "ProxyRTSPClient" class is defined only inside the "ProxyServerMediaSession.cpp" file, not in a header file, so you shouldn't even have the ability to access it, let alone subclass it.  So, are you sure that this is something that you really want to do??


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

_______________________________________________
live-devel mailing list
live-devel@...
http://lists.live555.com/mailman/listinfo/live-devel
Jesús Leganés | 2 Jul 2012 09:46

Re: Set ProxyServerMediaSession::fProxyRTSPClient as protected

> So if you want to detect/log every client connection (etc.) to the proxy
> server, then you would not modify (or subclass) the "Proxy*" code at all.
> Instead, you would subclass "RTSPServer" and
> "RTSPServer::RTSPClientSession", and reimplement the "handleCmd_SETUP()"
> (etc.) virtual functions.
>
Correctly, and i have this done already :-) At this moment i'm able to
detect and log this way connections between clients and the proxy, and
now i need to detect and log connections between the proxy and the
remote camera (the 'back-end' server as you say).

> But if your intention is instead to detect/log only connections from the
> proxy server to the 'back-end' server (which is only a subset of the number
> of connections from front-end clients to the proxy server), then:
>
Yes, exactly what i want to do :-)

> The fact is that reviewing the code it seems to me it's the correct
> aproach, just use a ProxyServerMediaSession child constructor that
> inits ProxyServerMediaSession::fProxyRTSPClient to my own
> ProxyRTSPClient child class
>
>
> Yes, but note that the existing "ProxyServerMediaSession" constructor
> already initializes the "fProxyRTSPClient" field (to a new "ProxyRTSPClient"
> object), so you'll need to delete this (using "Medium::close()") first,
> before assigning your new "ProxyRTSPClient" subclass object.
>
Oh, i didn't thought about it, thanks for the advice... :-)

> But hold on: At present, the "ProxyRTSPClient" class is defined only inside
> the "ProxyServerMediaSession.cpp" file, not in a header file, so you
> shouldn't even have the ability to access it, let alone subclass it.  So,
> are you sure that this is something that you really want to do??
>
Well, i don't know if there's a better (or at least a different) way
to do this, but if it's the only way to be able to detect and log the
connections from the proxy to the remote back-end server (the camera)
and you can't be able to suggest to me any other way to do it, then
yes, this and the redefination of RTSPClient::sendRequest() method in
a subclass is what i want to do :-) But i'm open to ideas, too... :-D

--

-- 
Jesús Leganés Combarro
Software developer at Vaelsys
Bruno Babic | 2 Jul 2012 10:34
Picon
Favicon

Is there something like WindowsUsageEnvironment?

Hi!

What would be the best way to get openRTSP client to run as a GUI tool 
under Windows?
Should I try to create something like WindowsUsageEnvironment to handle 
Windows message pool? Has anyone already did anything like that?

--
2b||!2b?
Naresh Sankapelly | 2 Jul 2012 11:32

Re: Is there something like WindowsUsageEnvironment?

You could use VLC. 

Thanks
Naresh
Ph. 8884199804

-----Original Message-----
From: live-devel-bounces@...
[mailto:live-devel-bounces@...] On Behalf Of Bruno Babic
Sent: Monday, July 02, 2012 2:05 PM
To: LIVE555 Streaming Media - development & use
Subject: [Live-devel] Is there something like WindowsUsageEnvironment?

Hi!

What would be the best way to get openRTSP client to run as a GUI tool under
Windows?
Should I try to create something like WindowsUsageEnvironment to handle
Windows message pool? Has anyone already did anything like that?

--
2b||!2b?
_______________________________________________
live-devel mailing list
live-devel@...
http://lists.live555.com/mailman/listinfo/live-devel
Naresh Sankapelly | 2 Jul 2012 11:32

Re: Is there something like WindowsUsageEnvironment?

You could use VLC. 

Thanks
Naresh
Ph. 8884199804

-----Original Message-----
From: live-devel-bounces <at> ns.live555.com
[mailto:live-devel-bounces <at> ns.live555.com] On Behalf Of Bruno Babic
Sent: Monday, July 02, 2012 2:05 PM
To: LIVE555 Streaming Media - development & use
Subject: [Live-devel] Is there something like WindowsUsageEnvironment?

Hi!

What would be the best way to get openRTSP client to run as a GUI tool under
Windows?
Should I try to create something like WindowsUsageEnvironment to handle
Windows message pool? Has anyone already did anything like that?

--
2b||!2b?
_______________________________________________
live-devel mailing list
live-devel <at> lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel
Bruno Babic | 2 Jul 2012 10:34
Picon
Favicon

Is there something like WindowsUsageEnvironment?

Hi!

What would be the best way to get openRTSP client to run as a GUI tool 
under Windows?
Should I try to create something like WindowsUsageEnvironment to handle 
Windows message pool? Has anyone already did anything like that?

--
2b||!2b?
Jesús Leganés | 2 Jul 2012 18:28

Re: Set ProxyServerMediaSession::fProxyRTSPClient as protected

>> Yes, but note that the existing "ProxyServerMediaSession" constructor
>> already initializes the "fProxyRTSPClient" field (to a new "ProxyRTSPClient"
>> object), so you'll need to delete this (using "Medium::close()") first,
>> before assigning your new "ProxyRTSPClient" subclass object.
>>
> Oh, i didn't thought about it, thanks for the advice... :-)
>
I have been talking with my boss and we got a better solution to this:
instead of set the constructor to protected, redefine it and close the
previous connection before create the new one, have this connection
created on a protected method so only is needed to be overloaded just
this method, so the connection is only done one time and also the
constructor gets untouched :-)

--

-- 
Jesús Leganés Combarro
Software developer at Vaelsys
Ross Finlayson | 3 Jul 2012 06:28
Favicon

Re: Set ProxyServerMediaSession::fProxyRTSPClient as protected

OK, I've now installed a new version (2012.07.03) of the code that does the following:
- The definition of "ProxyRTSPClient" is now publicly accessible, in the "ProxyServerMediaSession.hh" header file - so you can subclass it if you wish.
- "ProxyServerMediaSession" now has a new virtual function "createNewProxyRTSPClient()", for creating its new "ProxyRTSPClient" object.  The default implementation of this function just creates a new "ProxyRTSPClient", but you can redefine this (in a subclass of "ProxyServerMediaSession") to create a new subclass object instead.
- The "fProxyRTSPClient" and "fClientMediaSession" member variables of "ProxyServerMediaSession" are now protected.
- "RTSPClient::sendRequest()" is now a virtual function, and "protected:", rather than "private:".

I hope this now allows you to do what you want with your subclasses...


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

_______________________________________________
live-devel mailing list
live-devel@...
http://lists.live555.com/mailman/listinfo/live-devel
Jesús Leganés | 4 Jul 2012 09:16

Re: Set ProxyServerMediaSession::fProxyRTSPClient as protected

> I hope this now allows you to do what you want with your subclasses...
>
It works like a charm... :-) Thank you! :-D

--

-- 
Jesús Leganés Combarro
Software developer at Vaelsys
Jesús Leganés | 4 Jul 2012 09:16

Re: Set ProxyServerMediaSession::fProxyRTSPClient as protected

> I hope this now allows you to do what you want with your subclasses...
>
It works like a charm... :-) Thank you! :-D

--

-- 
Jesús Leganés Combarro
Software developer at Vaelsys
Ross Finlayson | 3 Jul 2012 06:28
Favicon

Re: Set ProxyServerMediaSession::fProxyRTSPClient as protected

OK, I've now installed a new version (2012.07.03) of the code that does the following:
- The definition of "ProxyRTSPClient" is now publicly accessible, in the "ProxyServerMediaSession.hh" header file - so you can subclass it if you wish.
- "ProxyServerMediaSession" now has a new virtual function "createNewProxyRTSPClient()", for creating its new "ProxyRTSPClient" object.  The default implementation of this function just creates a new "ProxyRTSPClient", but you can redefine this (in a subclass of "ProxyServerMediaSession") to create a new subclass object instead.
- The "fProxyRTSPClient" and "fClientMediaSession" member variables of "ProxyServerMediaSession" are now protected.
- "RTSPClient::sendRequest()" is now a virtual function, and "protected:", rather than "private:".

I hope this now allows you to do what you want with your subclasses...


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

_______________________________________________
live-devel mailing list
live-devel <at> lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel
Jesús Leganés | 2 Jul 2012 18:28

Re: Set ProxyServerMediaSession::fProxyRTSPClient as protected

>> Yes, but note that the existing "ProxyServerMediaSession" constructor
>> already initializes the "fProxyRTSPClient" field (to a new "ProxyRTSPClient"
>> object), so you'll need to delete this (using "Medium::close()") first,
>> before assigning your new "ProxyRTSPClient" subclass object.
>>
> Oh, i didn't thought about it, thanks for the advice... :-)
>
I have been talking with my boss and we got a better solution to this:
instead of set the constructor to protected, redefine it and close the
previous connection before create the new one, have this connection
created on a protected method so only is needed to be overloaded just
this method, so the connection is only done one time and also the
constructor gets untouched :-)

--

-- 
Jesús Leganés Combarro
Software developer at Vaelsys
Jesús Leganés | 2 Jul 2012 09:46

Re: Set ProxyServerMediaSession::fProxyRTSPClient as protected

> So if you want to detect/log every client connection (etc.) to the proxy
> server, then you would not modify (or subclass) the "Proxy*" code at all.
> Instead, you would subclass "RTSPServer" and
> "RTSPServer::RTSPClientSession", and reimplement the "handleCmd_SETUP()"
> (etc.) virtual functions.
>
Correctly, and i have this done already :-) At this moment i'm able to
detect and log this way connections between clients and the proxy, and
now i need to detect and log connections between the proxy and the
remote camera (the 'back-end' server as you say).

> But if your intention is instead to detect/log only connections from the
> proxy server to the 'back-end' server (which is only a subset of the number
> of connections from front-end clients to the proxy server), then:
>
Yes, exactly what i want to do :-)

> The fact is that reviewing the code it seems to me it's the correct
> aproach, just use a ProxyServerMediaSession child constructor that
> inits ProxyServerMediaSession::fProxyRTSPClient to my own
> ProxyRTSPClient child class
>
>
> Yes, but note that the existing "ProxyServerMediaSession" constructor
> already initializes the "fProxyRTSPClient" field (to a new "ProxyRTSPClient"
> object), so you'll need to delete this (using "Medium::close()") first,
> before assigning your new "ProxyRTSPClient" subclass object.
>
Oh, i didn't thought about it, thanks for the advice... :-)

> But hold on: At present, the "ProxyRTSPClient" class is defined only inside
> the "ProxyServerMediaSession.cpp" file, not in a header file, so you
> shouldn't even have the ability to access it, let alone subclass it.  So,
> are you sure that this is something that you really want to do??
>
Well, i don't know if there's a better (or at least a different) way
to do this, but if it's the only way to be able to detect and log the
connections from the proxy to the remote back-end server (the camera)
and you can't be able to suggest to me any other way to do it, then
yes, this and the redefination of RTSPClient::sendRequest() method in
a subclass is what i want to do :-) But i'm open to ideas, too... :-D

--

-- 
Jesús Leganés Combarro
Software developer at Vaelsys
Ross Finlayson | 29 Jun 2012 23:22
Favicon

Re: Set ProxyServerMediaSession::fProxyRTSPClient as protected

I'm needing to be able to detect and log the
connect/disconnect/playing/paused/etc events done on the
ProxyServerMediaSession against the remote camera

I'm not sure exactly what you mean by this, but if your intention is to detect/log every client connection (etc.) to the proxy server, then you need to know that if two or more clients are accessing the same proxy stream concurrently, then the code for "ProxyServerMediaSession" (and its related classes) is executed only for the *first* such client.  I.e., the "Proxy*" code is unaware of the second and subsequent clients.

So if you want to detect/log every client connection (etc.) to the proxy server, then you would not modify (or subclass) the "Proxy*" code at all.  Instead, you would subclass "RTSPServer" and "RTSPServer::RTSPClientSession", and reimplement the "handleCmd_SETUP()" (etc.) virtual functions.


But if your intention is instead to detect/log only connections from the proxy server to the 'back-end' server (which is only a subset of the number of connections from front-end clients to the proxy server), then:

The fact is that reviewing the code it seems to me it's the correct
aproach, just use a ProxyServerMediaSession child constructor that
inits ProxyServerMediaSession::fProxyRTSPClient to my own
ProxyRTSPClient child class

Yes, but note that the existing "ProxyServerMediaSession" constructor already initializes the "fProxyRTSPClient" field (to a new "ProxyRTSPClient" object), so you'll need to delete this (using "Medium::close()") first, before assigning your new "ProxyRTSPClient" subclass object.

But hold on: At present, the "ProxyRTSPClient" class is defined only inside the "ProxyServerMediaSession.cpp" file, not in a header file, so you shouldn't even have the ability to access it, let alone subclass it.  So, are you sure that this is something that you really want to do??


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

_______________________________________________
live-devel mailing list
live-devel <at> lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Gmane