Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24

Thread: Module for authorizing requests for all stream types - getting the client request url

  1. #21
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    No, HTTPStreamerSession does not span streams. Use IOPerformanceCounter in onHTTPSessionDestroy

    http://www.wowza.com/forums/content....nce-statistics

    Richard

  2. #22

    Default

    Ok, so let me make sure I have this right. Right now I have all my logging code triggered in onStreamDestroy as so:

    	public void onStreamDestroy(IMediaStream stream) {
    		if(stream.isPlay()) {
    			try
    			{
    				IClient client = stream.getClient();
    				IHTTPStreamerSession httpSession = stream.getHTTPStreamerSession();
    				RTPStream rtpStream = stream.getRTPStream();
    				MediaCommanderLogger logger = null;
    				
    				if(client != null && client.isAcceptConnection()) {
    					logger = getLogDetails(stream);
    				} 
    				else if(httpSession != null) {
    					logger = getHttpStreamerLogDetails(stream);
    				} 
    				else if(rtpStream != null) {
    					logger = getRtspStreamerLogDetails(stream);
    				}
    		 
    				if(logger != null)
    				{
    					AsyncLogExecutor logExecutor = AsyncLogExecutor.AsyncLogExecutorInstance;
    					logExecutor.sendLog(logger);
    				}
    			}
    			catch (Exception e)
    			{
    				getLogger().error("Error in onStreamDestroy method of MediaCommanderAuthorizationModule", e);
    			}
    		}
    	}
    Instead of sending the log here, I can put that logger object into the HttpSession/RTPSession properties collection and then pick it up in the onHTTPSessionDestroy/onRTPSessionDestroy method, then update the performance counters there and send the log. Is that the best way? Right now I'm getting the performance stats in the OnStreamDestroy method using the IOPerformanceCounter attached to the IMediaStream, but it sounds like I should be using the one tied to the Session, and I should be doing it later in the onsessiondestroy methods...

    How about flash? Should I continue to send the log in onStreamDestroy for flash streams? Also, for flash streams, I'm using the IOPerformanceCounter tied to the IMediaStream. Is that right, or should I be using the one tied to the client, or does it matter?

  3. #23
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Right, use the HTTP and RTP session handlers.

    For RTMP, IClient corresponds with the NetConnection, and IMediaStream corresponds with the NetStream. If the RTMP client connects then streams, then stops the stream and disconnects, the IOPerformanceCounter properties will be about the same. It is possible to have a NetConnection stay open and have several NetStreams associated with it, in which case the numbers will be different and there will be more than 1 IMediaStream associated with the IClient.

    Richard

  4. #24

    Default

    Thanks Richard, I think I have it now...

    Sean

Page 3 of 3 FirstFirst 123

Similar Threads

  1. Wowza module to start stream on HLS request
    By cipris in forum General Forum
    Replies: 4
    Last Post: 12-12-2014, 02:47 AM
  2. Samsung TV app: changing ordering of URL parameters for HLS requests
    By jules27 in forum Media Players and Devices Discussion
    Replies: 2
    Last Post: 06-19-2012, 05:00 PM
  3. Intercepting client requests for streams
    By michael401 in forum Server-side Modules and Code Samples Discussion
    Replies: 5
    Last Post: 02-26-2012, 08:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •