VirtualBox

Ignore:
Timestamp:
Jul 14, 2022 8:30:45 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
152283
Message:

Recording: Settings handling fixes / overhaul. This adds the ability to handle per-screen settings, which can be different from the first screen (screen 0). Also fixed a couple of bugs regarding snapshot handling and persistence (committing, rolling back, ++) in that area. FE/VBoxManage now can also list the per-screen settings. Added some further @todos. bugref:9286

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r95423 r95639  
    28242824#ifdef VBOX_WITH_RECORDING
    28252825    {
    2826         /* Video capture */
    2827         BOOL fCaptureVideo = FALSE;
     2826        BOOL fRecordVideo = FALSE;
    28282827# ifdef VBOX_WITH_AUDIO_RECORDING
    2829         BOOL fCaptureAudio = FALSE;
     2828        BOOL fRecordAudio = FALSE;
    28302829# endif
    28312830
     
    28332832        CHECK_ERROR_RET(machine, COMGETTER(RecordingSettings)(recordingSettings.asOutParam()), hrc);
    28342833
    2835         SafeIfaceArray <IRecordingScreenSettings> saRecordingScreenScreens;
    2836         CHECK_ERROR_RET(recordingSettings, COMGETTER(Screens)(ComSafeArrayAsOutParam(saRecordingScreenScreens)), hrc);
    2837 
    2838         /* For now all screens have the same configuration; so take screen 0 and work with that. */
    2839         ULONG fFeatures;
    2840         CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(Features)(&fFeatures), hrc);
    2841         ULONG Width;
    2842         CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(VideoWidth)(&Width), hrc);
    2843         ULONG Height;
    2844         CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(VideoHeight)(&Height), hrc);
    2845         ULONG Rate;
    2846         CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(VideoRate)(&Rate), hrc);
    2847         ULONG Fps;
    2848         CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(VideoFPS)(&Fps), hrc);
    2849         Bstr  bstrFile;
    2850         CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(Filename)(bstrFile.asOutParam()), hrc);
    2851         Bstr  bstrOptions;
    2852         CHECK_ERROR_RET(saRecordingScreenScreens[0], COMGETTER(Options)(bstrOptions.asOutParam()), hrc);
    2853 
    2854         Utf8Str strOptions(bstrOptions);
    2855         size_t pos = 0;
    2856         com::Utf8Str key, value;
    2857         while ((pos = strOptions.parseKeyValue(key, value, pos)) != com::Utf8Str::npos)
    2858         {
    2859             if (key.compare("vc_enabled", Utf8Str::CaseInsensitive) == 0)
    2860             {
    2861                 fCaptureVideo = value.compare("true", Utf8Str::CaseInsensitive) == 0;
    2862             }
    2863             else if (key.compare("ac_enabled", Utf8Str::CaseInsensitive) == 0)
    2864             {
     2834        BOOL  fEnabled;
     2835        CHECK_ERROR_RET(recordingSettings, COMGETTER(Enabled)(&fEnabled), hrc);
     2836        SHOW_BOOL_VALUE_EX("recording_enabled", Info::tr("Recording enabled:"), fEnabled, Info::tr("yes"), Info::tr("no"));
     2837
     2838        SafeIfaceArray <IRecordingScreenSettings> saScreenSettings;
     2839        CHECK_ERROR_RET(recordingSettings, COMGETTER(Screens)(ComSafeArrayAsOutParam(saScreenSettings)), hrc);
     2840
     2841        SHOW_ULONG_VALUE("recording_screens", Info::tr("Recording screens:"), saScreenSettings.size(), "");
     2842
     2843        for (size_t i = 0; i < saScreenSettings.size(); ++i)
     2844        {
     2845            ComPtr<IRecordingScreenSettings> screenSettings = saScreenSettings[i];
     2846
     2847            FmtNm(szNm, details == VMINFO_MACHINEREADABLE ? "rec_screen%zu" : Info::tr("Screen %u:"), i);
     2848            RTPrintf(Info::tr(" %s\n"), szNm);
     2849
     2850            CHECK_ERROR_RET(screenSettings, COMGETTER(Enabled)(&fEnabled), hrc);
     2851            ULONG idScreen;
     2852            CHECK_ERROR_RET(screenSettings, COMGETTER(Id)(&idScreen), hrc);
     2853            ULONG fFeatures;
     2854            CHECK_ERROR_RET(screenSettings, COMGETTER(Features)(&fFeatures), hrc);
     2855            ULONG Width;
     2856            CHECK_ERROR_RET(screenSettings, COMGETTER(VideoWidth)(&Width), hrc);
     2857            ULONG Height;
     2858            CHECK_ERROR_RET(screenSettings, COMGETTER(VideoHeight)(&Height), hrc);
     2859            ULONG Rate;
     2860            CHECK_ERROR_RET(screenSettings, COMGETTER(VideoRate)(&Rate), hrc);
     2861            ULONG Fps;
     2862            CHECK_ERROR_RET(screenSettings, COMGETTER(VideoFPS)(&Fps), hrc);
     2863            RecordingDestination_T enmDst;
     2864            CHECK_ERROR_RET(screenSettings, COMGETTER(Destination)(&enmDst), hrc);
     2865            Bstr  bstrFile;
     2866            CHECK_ERROR_RET(screenSettings, COMGETTER(Filename)(bstrFile.asOutParam()), hrc);
     2867            Bstr  bstrOptions;
     2868            CHECK_ERROR_RET(screenSettings, COMGETTER(Options)(bstrOptions.asOutParam()), hrc);
     2869
     2870            Utf8Str strOptions(bstrOptions);
     2871            size_t pos = 0;
     2872            com::Utf8Str key, value;
     2873            while ((pos = strOptions.parseKeyValue(key, value, pos)) != com::Utf8Str::npos)
     2874            {
     2875                if (key.compare("vc_enabled", Utf8Str::CaseInsensitive) == 0)
     2876                {
     2877                    fRecordVideo = value.compare("true", Utf8Str::CaseInsensitive) == 0;
     2878                }
     2879                else if (key.compare("ac_enabled", Utf8Str::CaseInsensitive) == 0)
     2880                {
    28652881# ifdef VBOX_WITH_AUDIO_RECORDING
    2866                 fCaptureAudio = value.compare("true", Utf8Str::CaseInsensitive) == 0;
     2882                    fRecordAudio = value.compare("true", Utf8Str::CaseInsensitive) == 0;
    28672883# endif
    2868             }
    2869         }
    2870 
    2871         SHOW_BOOL_VALUE_EX("videocap", Info::tr("Capturing:"), fCaptureVideo, Info::tr("active"), Info::tr("not active"));
     2884                }
     2885            }
     2886
     2887            SHOW_BOOL_VALUE_EX("rec_screen_enabled",         Info::tr("    Enabled:"), fEnabled,
     2888                                                             Info::tr("yes"), Info::tr("no"));
     2889            SHOW_ULONG_VALUE  ("rec_screen_id",              Info::tr("    ID:"), idScreen, "");
     2890            SHOW_BOOL_VALUE_EX("rec_screen_video_enabled",   Info::tr("    Record video:"), fRecordVideo,
     2891                                                             Info::tr("yes"), Info::tr("no"));
    28722892# ifdef VBOX_WITH_AUDIO_RECORDING
    2873         SHOW_BOOL_VALUE_EX("videocapaudio", Info::tr("Capture audio:"), fCaptureAudio, Info::tr("active"), Info::tr("not active"));
     2893            SHOW_BOOL_VALUE_EX("rec_screen_audio_enabled",   Info::tr("    Record audio:"), fRecordAudio,
     2894                                                             Info::tr("yes"), Info::tr("no"));
    28742895# endif
    2875         szValue[0] = '\0';
    2876         for (size_t i = 0, off = 0; i < saRecordingScreenScreens.size(); i++)
    2877         {
    2878             BOOL fEnabled;
    2879             CHECK_ERROR_RET(saRecordingScreenScreens[i], COMGETTER(Enabled)(&fEnabled), hrc);
    2880             if (fEnabled && off < sizeof(szValue) - 3)
    2881                 off += RTStrPrintf(&szValue[off], sizeof(szValue) - off, off ? ",%zu" : "%zu", i);
    2882         }
    2883         SHOW_UTF8_STRING("capturescreens", Info::tr("Capture screens:"), szValue);
    2884         SHOW_BSTR_STRING("capturefilename", Info::tr("Capture file:"), bstrFile);
    2885         RTStrPrintf(szValue, sizeof(szValue), "%ux%u", Width, Height);
    2886         SHOW_UTF8_STRING("captureres", Info::tr("Capture dimensions:"), szValue);
    2887         SHOW_ULONG_VALUE("capturevideorate", Info::tr("Capture rate:"), Rate, Info::tr("kbps"));
    2888         SHOW_ULONG_VALUE("capturevideofps", Info::tr("Capture FPS:"), Fps, Info::tr("kbps"));
    2889         SHOW_BSTR_STRING("captureopts", Info::tr("Capture options:"), bstrOptions);
    2890 
    2891         /** @todo Add more audio capturing profile / information here. */
     2896            SHOW_UTF8_STRING("rec_screen_dest",              Info::tr("    Destination:"),
     2897                                                               enmDst == RecordingDestination_File
     2898                                                             ? Info::tr("File") : Info::tr("Unknown"));
     2899            /** @todo Implement other destinations. */
     2900            if (enmDst == RecordingDestination_File)
     2901                SHOW_BSTR_STRING("rec_screen_dest_filename", Info::tr("    File:"), bstrFile);
     2902
     2903            SHOW_BSTR_STRING  ("rec_screen_opts",            Info::tr("    Options:"), bstrOptions);
     2904
     2905            /* Video properties. */
     2906            RTStrPrintf(szValue, sizeof(szValue), "%ux%u", Width, Height);
     2907            SHOW_UTF8_STRING  ("rec_screen_video_res_xy",    Info::tr("    Video dimensions:"), szValue);
     2908            SHOW_ULONG_VALUE  ("rec_screen_video_rate_kbps", Info::tr("    Video rate:"), Rate, Info::tr("kbps"));
     2909            SHOW_ULONG_VALUE  ("rec_screen_video_fps",       Info::tr("    Video FPS:"), Fps, Info::tr("fps"));
     2910
     2911            /** @todo Add more audio capturing profile / information here. */
     2912        }
    28922913    }
    28932914#endif /* VBOX_WITH_RECORDING */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette