Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-28037

VideoDisplay with DynamicStreamingVideoSource leaks memory if stopped prior to being destroyed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Adobe Flex SDK 4.5.1 (Release)
    • None
    • Spark: VideoPlayer
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

    Description

      I am using the following test to confirm the leak:

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark">

      <fx:Script>
      <![CDATA[
      import spark.components.VideoDisplay;
      import spark.components.mediaClasses.DynamicStreamingVideoItem;
      import spark.components.mediaClasses.DynamicStreamingVideoSource;

      private static const STREAM_HOST:String = "rtmp://localhost/TestApp";

      private static const STREAM_NAME:String = "test_video";

      private static function getVideoSource(streamHost:String, streamName:String):DynamicStreamingVideoSource

      { var streamingSource:DynamicStreamingVideoSource = new DynamicStreamingVideoSource(); streamingSource.host = streamHost; var streamItems:Vector.<DynamicStreamingVideoItem> = new Vector.<DynamicStreamingVideoItem>(); var item:DynamicStreamingVideoItem = new DynamicStreamingVideoItem(); item.streamName = streamName; streamItems.push(item); streamingSource.streamItems = streamItems; return streamingSource; }

      [Bindable]
      private var _numCreated:int = 0;

      private var _videoElement:VideoDisplay;

      private function addVideo():void

      { trace("addVideo()"); if(_videoElement) return; _videoElement = new VideoDisplay(); _videoElement.source = getVideoSource(STREAM_HOST, STREAM_NAME); this.panel.addElement(_videoElement); _numCreated++; }

      private function removeVideo():void

      { trace("removeVideo()"); if(!_videoElement) return; //commenting out the line bellow stops the leak. _videoElement.stop(); _videoElement = null; this.panel.removeAllElements(); }

      ]]
      >
      </fx:Script>

      <s:Panel id="panel" top="0" left="0" bottom="0" right="0" title="Video Stream Test">
      <s:controlBarContent>
      <s:Button label="Add" click="this.addVideo()" />
      <s:Button label="Remove" click="this.removeVideo()" />
      <s:Label text="Video Elements Created: {_numCreated}" />
      </s:controlBarContent>
      </s:Panel>
      </s:Application>

      The problem does not exist when using a local video source.

      Workaround (if any):

      Use pause() if you need to stop playback before removing (while waiting for a transition to finish, for example)

      Attachments

        Activity

          People

            Unassigned Unassigned
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: