Bonjour,
J'utilise Live555, qui est une bibliothèque logicielle pour faire du streaming.
Je développe un serveur, et je voudrais modifier la réaction de mon serveur à la commande "GET_PARAMETER".
Cela implique de redéfinir une méthode qui se trouve dans une classe interne. Je n'ai pas réussi à le faire
Voici le code que j'ai récupéré (je ne l'ai pas modifié) :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 class RTSPServer: public GenericMediaServer { public: class RTSPClientSession: public GenericMediaServer::ClientSession { protected: virtual void handleCmd_GET_PARAMETER( ... ); } } void RTSPServer::RTSPClientSession::handleCmd_GET_PARAMETER( ... ) { // By default, we implement "GET_PARAMETER" just as a 'keep alive', and send back a dummy response. // (If you want to handle "GET_PARAMETER" properly, you can do so by defining a subclass of "RTSPServer" // and "RTSPServer::RTSPClientSession", and then reimplement this virtual function in your subclass.) setRTSPResponse(ourClientConnection, "200 OK", fOurSessionId, LIVEMEDIA_LIBRARY_VERSION_STRING); }
Et voici un extrait de mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 class DynamicRTSPServer: public RTSPServer { public: class RTSPClientSession: public RTSPServer::RTSPClientSession { protected: virtual void handleCmd_GET_PARAMETER( ... ); }; } void DynamicRTSPServer::RTSPClientSession::handleCmd_GET_PARAMETER( ... ) { cout << "Méthode surchargée avec succès" << endl; setRTSPResponse(ourClientConnection, "200 OK", fOurSessionId, LIVEMEDIA_LIBRARY_VERSION_STRING); };
Mon code compile, mais ne fonctionne pas car l'affichage avec cout n'est jamais réalisé. La surcharge est donc ratée.
Quelqu'un saurait comment faire ?
Partager