javauis/mmapi_qt/baseline/javasrc/com/nokia/microedition/media/control/VideoItem.java
changeset 26 dc7c549001d5
parent 23 98ccebc37403
child 47 f40128debb5d
--- a/javauis/mmapi_qt/baseline/javasrc/com/nokia/microedition/media/control/VideoItem.java	Fri May 14 15:47:24 2010 +0300
+++ b/javauis/mmapi_qt/baseline/javasrc/com/nokia/microedition/media/control/VideoItem.java	Thu May 27 12:49:31 2010 +0300
@@ -39,10 +39,13 @@
 
     private int iEventSourceHandle;
 
-    public VideoItem(int aEventSourceHandle)
+    private Player iPlayer = null;
+
+    public VideoItem(int aEventSourceHandle, Player aPlayer)
     {
         super("");   // we don't have title
         iEventSourceHandle = aEventSourceHandle;
+        iPlayer = aPlayer;
     }
 
     // from PlayerListener
@@ -158,6 +161,28 @@
         iNativeHandle = aHandle;
     }
 
+    int[] getSourceSize()
+    {
+        int[] size = new int[2];
+
+        if (iPlayer.getState() >= iPlayer.PREFETCHED)
+        {
+            int width = _getMinContentWidth(iEventSourceHandle,
+                                            iNativeHandle);
+            int height = _getMinContentHeight(iEventSourceHandle,
+                                              iNativeHandle);
+            size[0] = width;
+            size[1] = height;
+        }
+        else
+        {
+            size[0] = 0;
+            size[1] = 0;
+        }
+        return size;
+    }
+
+
     // Native methods
 
     /**