Well, i solved the problem creating another class, modeled after 
"H263plusVideoFileServerMediaSubsession", which starts my thread.
I don't know if it's the right solution, but I couldn't find another.

By the way, why createNewStreamSource() is called twice per requested 
stream? Now I'm testing if thread is already started, because starting 
it in createNewStreamSource would have it started twice. Am I doing the 
right thing?

Regards,

Cristiano Belloni.


Cristiano Belloni wrote:
>> I suggest defining a subclass of 
>> "H263plusVideoFileServerMediaSubsession", and redefining the 
>> "createNewStreamSource()" virtual function to start your encoder(sic) 
>> thread, and then call the parent class 
>> ("H263plusVideoFileServerMediaSubsession")'s 
>> "createNewStreamSource()"
>>     
>
> Uhm, I'm having an hard time subclassing 
> "H263plusVideoFileServerMediaSubsession".
> I just added this code:
>
> class EncH263plusVideoFileServerMediaSubsession: public 
> H263plusVideoFileServerMediaSubsession
> {
>     
> private:
>     
>    FramedSource* createNewStreamSource(unsigned clientSessionId, unsigned& 
> estBitrate);
>     
> };
>
> FramedSource* 
> EncH263plusVideoFileServerMediaSubsession::createNewStreamSource(unsigned 
> clientSessionId, unsigned& estBitrate)
> {
>         std::cout << "Started a new Stream Source" << std::endl;
>
>       /* Code to start the encoder thread */
>
>         return 
> H263plusVideoFileServerMediaSubsession::createNewStreamSource(clientSessionId,
>  estBitrate);
> }
>
> And i get these errors:
>  
> ~/develop/lib/live-debug/liveMedia/include/H263plusVideoFileServerMediaSubsession.hh:
>  In member function ‘virtual FramedSource* 
> EncH263plusVideoFileServerMediaSubsession::createNewStreamSource(unsigned 
> int, unsigned int&)’:
> ~/develop/lib/live-debug/liveMedia/include/H263plusVideoFileServerMediaSubsession.hh:42:
>  error: ‘virtual FramedSource* 
> H263plusVideoFileServerMediaSubsession::createNewStreamSource(unsigned int, 
> unsigned int&)’ is private
> rtspServer.cpp:56: error: within this context
> ~/develop/lib/live-debug/liveMedia/include/H263plusVideoFileServerMediaSubsession.hh:
>  In destructor ‘virtual 
> EncH263plusVideoFileServerMediaSubsession::~EncH263plusVideoFileServerMediaSubsession()’:
> ~/develop/lib/live-debug/liveMedia/include/H263plusVideoFileServerMediaSubsession.hh:38:
>  error: 
> ‘H263plusVideoFileServerMediaSubsession::~H263plusVideoFileServerMediaSubsession()’
>  is private
> rtspServer.cpp:44: error: within this context
> rtspServer.cpp: At global scope:
> rtspServer.cpp:114: note: synthesized method ‘virtual 
> EncH263plusVideoFileServerMediaSubsession::~EncH263plusVideoFileServerMediaSubsession()’
>  first required here
>
>
> Complaining that the destructor of H263plusVideoFileServerMediaSubsession is 
> private (and indeed it is).
> If I try to override the destructor in my class, I get similar errors.
>
> Where am I doing wrong? Can you point me to some sample code where it is done 
> right?
>
> Thanks,
>
> Regards,
>
> Cristiano Belloni.
>
> _______________________________________________
> live-devel mailing list
> live-devel@lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel
>
>   

_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to