Index: trunk/src/VBox/Main/src-client/VideoRec.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/VideoRec.cpp	(revision 75048)
+++ trunk/src/VBox/Main/src-client/VideoRec.cpp	(revision 75066)
@@ -320,11 +320,11 @@
             PVIDEORECSTREAM pStream = (*it);
 
-            videoRecStreamLock(pStream);
-
-            int rc2 = videoRecStreamClose(pStream);
+            VideoRecStreamLock(pStream);
+
+            int rc2 = VideoRecStreamClose(pStream);
             if (RT_SUCCESS(rc))
                 rc = rc2;
 
-            rc2 = videoRecStreamUninit(pStream);
+            rc2 = VideoRecStreamUninit(pStream);
             if (RT_SUCCESS(rc))
                 rc = rc2;
@@ -333,5 +333,5 @@
             it = pCtx->vecStreams.begin();
 
-            videoRecStreamUnlock(pStream);
+            VideoRecStreamUnlock(pStream);
 
             RTCritSectDelete(&pStream->CritSect);
@@ -382,4 +382,29 @@
 
 /**
+ * Retrieves a specific recording stream of a recording context.
+ *
+ * @returns Pointer to recording stream if found, or NULL if not found.
+ * @param   pCtx                Recording context to look up stream for.
+ * @param   uScreen             Screen number of recording stream to look up.
+ */
+PVIDEORECSTREAM videoRecGetStream(PVIDEORECCONTEXT pCtx, uint32_t uScreen)
+{
+    AssertPtrReturn(pCtx, NULL);
+
+    PVIDEORECSTREAM pStream;
+
+    try
+    {
+        pStream = pCtx->vecStreams.at(uScreen);
+    }
+    catch (std::out_of_range &)
+    {
+        pStream = NULL;
+    }
+
+    return pStream;
+}
+
+/**
  * Checks if recording engine is ready to accept new recording data for a given screen.
  *
@@ -399,10 +424,10 @@
     bool fIsReady = false;
 
-    PVIDEORECSTREAM pStream = videoRecStreamGet(pCtx, uScreen);
+    PVIDEORECSTREAM pStream = videoRecGetStream(pCtx, uScreen);
     if (pStream)
     {
-        videoRecStreamLock(pStream);
+        VideoRecStreamLock(pStream);
         fIsReady = pStream->fEnabled;
-        videoRecStreamUnlock(pStream);
+        VideoRecStreamUnlock(pStream);
     }
 
@@ -438,5 +463,5 @@
 bool VideoRecIsLimitReached(PVIDEORECCONTEXT pCtx, uint32_t uScreen, uint64_t tsNowMs)
 {
-    PVIDEORECSTREAM pStream = videoRecStreamGet(pCtx, uScreen);
+    PVIDEORECSTREAM pStream = videoRecGetStream(pCtx, uScreen);
     if (   !pStream
         || !pStream->fEnabled)
@@ -583,5 +608,5 @@
     AssertRC(rc);
 
-    PVIDEORECSTREAM pStream = videoRecStreamGet(pCtx, uScreen);
+    PVIDEORECSTREAM pStream = videoRecGetStream(pCtx, uScreen);
     if (!pStream)
     {
@@ -592,5 +617,5 @@
     }
 
-    videoRecStreamLock(pStream);
+    VideoRecStreamLock(pStream);
 
     PVIDEORECVIDEOFRAME pFrame = NULL;
@@ -801,5 +826,5 @@
         VideoRecVideoFrameFree(pFrame);
 
-    videoRecStreamUnlock(pStream);
+    VideoRecStreamUnlock(pStream);
 
     int rc2 = RTCritSectLeave(&pCtx->CritSect);
Index: trunk/src/VBox/Main/src-client/VideoRecStream.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/VideoRecStream.cpp	(revision 75048)
+++ trunk/src/VBox/Main/src-client/VideoRecStream.cpp	(revision 75066)
@@ -43,34 +43,9 @@
 
 /**
- * Retrieves a specific recording stream of a recording context.
- *
- * @returns Pointer to recording stream if found, or NULL if not found.
- * @param   pCtx                Recording context to look up stream for.
- * @param   uScreen             Screen number of recording stream to look up.
- */
-PVIDEORECSTREAM videoRecStreamGet(PVIDEORECCONTEXT pCtx, uint32_t uScreen)
-{
-    AssertPtrReturn(pCtx, NULL);
-
-    PVIDEORECSTREAM pStream;
-
-    try
-    {
-        pStream = pCtx->vecStreams.at(uScreen);
-    }
-    catch (std::out_of_range &)
-    {
-        pStream = NULL;
-    }
-
-    return pStream;
-}
-
-/**
  * Locks a recording stream.
  *
  * @param   pStream             Recording stream to lock.
  */
-void videoRecStreamLock(PVIDEORECSTREAM pStream)
+void VideoRecStreamLock(PVIDEORECSTREAM pStream)
 {
     int rc = RTCritSectEnter(&pStream->CritSect);
@@ -83,5 +58,5 @@
  * @param   pStream             Recording stream to unlock.
  */
-void videoRecStreamUnlock(PVIDEORECSTREAM pStream)
+void VideoRecStreamUnlock(PVIDEORECSTREAM pStream)
 {
     int rc = RTCritSectLeave(&pStream->CritSect);
@@ -96,5 +71,5 @@
  * @param   pCfg                Recording configuration to use.
  */
-int videoRecStreamOpen(PVIDEORECSTREAM pStream, PVIDEORECCFG pCfg)
+int VideoRecStreamOpen(PVIDEORECSTREAM pStream, PVIDEORECCFG pCfg)
 {
     AssertPtrReturn(pStream, VERR_INVALID_POINTER);
@@ -209,9 +184,9 @@
     AssertPtrReturn(pStream, VERR_INVALID_POINTER);
 
-    videoRecStreamLock(pStream);
+    VideoRecStreamLock(pStream);
 
     if (!pStream->fEnabled)
     {
-        videoRecStreamUnlock(pStream);
+        VideoRecStreamUnlock(pStream);
         return VINF_SUCCESS;
     }
@@ -247,5 +222,5 @@
                 if (RT_SUCCESS(rc))
                 {
-                    rc = videoRecStreamWriteVideoVPX(pStream, uTimeStampMs, pVideoFrame);
+                    rc = VideoRecStreamWriteVideoVPX(pStream, uTimeStampMs, pVideoFrame);
                 }
                 else
@@ -325,5 +300,5 @@
 #endif
 
-    videoRecStreamUnlock(pStream);
+    VideoRecStreamUnlock(pStream);
 
     return rc;
@@ -331,13 +306,15 @@
 
 /**
- * VideoRec utility function to initialize video recording context.
- *
- * @returns IPRT status code.
- * @param   pCtx                Pointer to video recording context.
+ * Initializes a recording stream.
+ *
+ * @returns IPRT status code.
+ * @param   pStream             Recording stream to initialize.
+ * @param   pCtx                Recording context to use for initialization.
  * @param   uScreen             Screen number to record.
  */
-int VideoRecStreamInit(PVIDEORECCONTEXT pCtx, uint32_t uScreen)
-{
-    AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
+int VideoRecStreamInit(PVIDEORECSTREAM pStream, PVIDEORECCONTEXT pCtx, uint32_t uScreen)
+{
+    AssertPtrReturn(pStream, VERR_INVALID_POINTER);
+    AssertPtrReturn(pCtx,    VERR_INVALID_POINTER);
 
     PVIDEORECCFG pCfg = &pCtx->Cfg;
@@ -353,16 +330,10 @@
 #endif
 
-    PVIDEORECSTREAM pStream = videoRecStreamGet(pCtx, uScreen);
-    if (!pStream)
-        return VERR_NOT_FOUND;
-
-    int rc = videoRecStreamOpen(pStream, pCfg);
+    int rc = VideoRecStreamOpen(pStream, pCfg);
     if (RT_FAILURE(rc))
         return rc;
 
-    pStream->pCtx = pCtx;
-
     if (pCfg->Video.fEnabled)
-        rc = videoRecStreamInitVideo(pStream, pCfg);
+        rc = VideoRecStreamInitVideo(pStream, pCfg);
 
     switch (pStream->enmDst)
@@ -448,5 +419,5 @@
     if (RT_FAILURE(rc))
     {
-        int rc2 = videoRecStreamClose(pStream);
+        int rc2 = VideoRecStreamClose(pStream);
         AssertRC(rc2);
         return rc;
@@ -467,5 +438,5 @@
  *
  */
-int videoRecStreamClose(PVIDEORECSTREAM pStream)
+int VideoRecStreamClose(PVIDEORECSTREAM pStream)
 {
     int rc = VINF_SUCCESS;
@@ -548,5 +519,5 @@
  * @param   pStream             Recording stream to uninitialize.
  */
-int videoRecStreamUninit(PVIDEORECSTREAM pStream)
+int VideoRecStreamUninit(PVIDEORECSTREAM pStream)
 {
     int rc = VINF_SUCCESS;
@@ -554,5 +525,5 @@
     if (pStream->pCtx->Cfg.Video.fEnabled)
     {
-        int rc2 = videoRecStreamUnitVideo(pStream);
+        int rc2 = VideoRecStreamUnitVideo(pStream);
         if (RT_SUCCESS(rc))
             rc = rc2;
@@ -568,9 +539,9 @@
  * @param   pStream             Recording stream to uninitialize video recording for.
  */
-int videoRecStreamUnitVideo(PVIDEORECSTREAM pStream)
+int VideoRecStreamUnitVideo(PVIDEORECSTREAM pStream)
 {
 #ifdef VBOX_WITH_LIBVPX
     /* At the moment we only have VPX. */
-    return videoRecStreamUninitVideoVPX(pStream);
+    return VideoRecStreamUninitVideoVPX(pStream);
 #else
     return VERR_NOT_SUPPORTED;
@@ -585,5 +556,5 @@
  * @param   pStream             Recording stream to uninitialize VPX codec for.
  */
-int videoRecStreamUninitVideoVPX(PVIDEORECSTREAM pStream)
+int VideoRecStreamUninitVideoVPX(PVIDEORECSTREAM pStream)
 {
     vpx_img_free(&pStream->Video.Codec.VPX.RawImage);
@@ -602,9 +573,9 @@
  * @param   pCfg                Video recording configuration to use for initialization.
  */
-int videoRecStreamInitVideo(PVIDEORECSTREAM pStream, PVIDEORECCFG pCfg)
+int VideoRecStreamInitVideo(PVIDEORECSTREAM pStream, PVIDEORECCFG pCfg)
 {
 #ifdef VBOX_WITH_LIBVPX
     /* At the moment we only have VPX. */
-    return videoRecStreamInitVideoVPX(pStream, pCfg);
+    return VideoRecStreamInitVideoVPX(pStream, pCfg);
 #else
     return VERR_NOT_SUPPORTED;
@@ -620,5 +591,5 @@
  * @param   pCfg                Video recording configuration to use for initialization.
  */
-int videoRecStreamInitVideoVPX(PVIDEORECSTREAM pStream, PVIDEORECCFG pCfg)
+int VideoRecStreamInitVideoVPX(PVIDEORECSTREAM pStream, PVIDEORECCFG pCfg)
 {
     pStream->Video.uWidth                = pCfg->Video.uWidth;
@@ -687,5 +658,5 @@
  * @param   pFrame              Frame to encode and submit.
  */
-int videoRecStreamWriteVideoVPX(PVIDEORECSTREAM pStream, uint64_t uTimeStampMs, PVIDEORECVIDEOFRAME pFrame)
+int VideoRecStreamWriteVideoVPX(PVIDEORECSTREAM pStream, uint64_t uTimeStampMs, PVIDEORECVIDEOFRAME pFrame)
 {
     AssertPtrReturn(pStream, VERR_INVALID_POINTER);
