VirtualBox

Changeset 75269 in vbox for trunk/src


Ignore:
Timestamp:
Nov 6, 2018 10:20:06 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
126371
Message:

Capturing: Added more per-screen attributes, such as audio parameters, video scaling and video rate control modes.

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r75258 r75269  
    47664766  </enum>
    47674767
     4768  <enum
     4769    name="CaptureVideoScalingMethod"
     4770    uuid="17DA29A9-3F41-482E-A9BB-3D183BA3EE59"
     4771    >
     4772    <desc>
     4773      Capturing video scaling method enumeration.
     4774    </desc>
     4775
     4776    <const name="None"                  value="0">
     4777      <desc>No scaling performed.</desc>
     4778    </const>
     4779    <const name="NearestNeighbor"       value="1">
     4780      <desc>Performs scaling via nearest-neighbor interpolation.
     4781        Not yet implemented.</desc>
     4782    </const>
     4783    <const name="Bilinear"              value="2">
     4784      <desc>Performs scaling via bilinear interpolation.
     4785        Not yet implemented.</desc>
     4786    </const>
     4787    <const name="Bicubic"               value="3">
     4788      <desc>Performs scaling via bicubic interpolation.
     4789        Not yet implemented.</desc>
     4790    </const>
     4791  </enum>
     4792
     4793  <enum
     4794    name="CaptureVideoRateControlMode"
     4795    uuid="5D392E29-04EC-4FD7-989C-82452F54414C"
     4796    >
     4797    <desc>
     4798      Capturing video rate control mode enumeration.
     4799    </desc>
     4800
     4801    <const name="CBR" value="0">
     4802      <desc>Constant bit rate (CBR).</desc>
     4803    </const>
     4804    <const name="VBR" value="1">
     4805      <desc>Variable bit rate (VBR). Not yet implemented.</desc>
     4806    </const>
     4807  </enum>
     4808
    47684809  <interface
    47694810    name="ICaptureScreenSettings" extends="$unknown"
    4770     uuid="9C8FE192-DD9A-45E9-B17B-2BA23B5951F7"
     4811    uuid="17DA29A9-3F41-482E-A9BB-3D183BA3EE59"
    47714812    wsmap="managed"
    47724813    >
     
    48594900    </attribute>
    48604901
     4902    <attribute name="audioCodec" type="CaptureAudioCodec">
     4903      <desc>
     4904        Determines the audio codec to use for encoding the
     4905        recorded audio data. This setting cannot be changed while capturing is
     4906        enabled.
     4907      </desc>
     4908    </attribute>
     4909
     4910    <attribute name="audioHz" type="unsigned long" default="22050">
     4911      <desc>
     4912        Determines the Hertz (Hz) rate of the recorded audio data. This setting
     4913        cannot be changed while capturing is enabled.
     4914      </desc>
     4915    </attribute>
     4916
     4917    <attribute name="audioBits" type="unsigned long" default="16">
     4918      <desc>
     4919        Determines the bits per sample of the recorded audio data. This setting
     4920        cannot be changed while capturing is enabled.
     4921      </desc>
     4922    </attribute>
     4923
     4924    <attribute name="audioChannels" type="unsigned long" default="2">
     4925      <desc>
     4926        Determines the audio channels of the recorded audio data.
     4927        Specifiy 2 for stereo or 1 for mono. More than stereo (2) channels
     4928        are not supported at the moment. This setting cannot be changed while
     4929        capturing is enabled.
     4930      </desc>
     4931    </attribute>
     4932
     4933    <attribute name="videoCodec" type="CaptureVideoCodec">
     4934      <desc>
     4935        Determines the video codec to use for encoding the recorded video data.
     4936        This setting cannot be changed while capturing is enabled.
     4937      </desc>
     4938    </attribute>
     4939
    48614940    <attribute name="videoWidth" type="unsigned long" default="1024">
    48624941      <desc>
    4863         This setting determines the horizontal resolution of the recorded
    4864         video. This setting cannot be changed while capturing is enabled.
     4942        Determines the horizontal resolution of the recorded video data. This
     4943        setting cannot be changed while capturing is enabled.
    48654944      </desc>
    48664945    </attribute>
     
    48684947    <attribute name="videoHeight" type="unsigned long" default="768">
    48694948      <desc>
    4870         This setting determines the vertical resolution of the recorded
    4871         video. This setting cannot be changed while capturing is enabled.
     4949        Determines the vertical resolution of the recorded video data. This
     4950        setting cannot be changed while capturing is enabled.
    48724951      </desc>
    48734952    </attribute>
     
    48754954    <attribute name="videoRate" type="unsigned long" default="512">
    48764955      <desc>
    4877         This setting determines the bitrate in kilobits per second.
    4878         Increasing this value makes the video look better for the
    4879         cost of an increased file size. This setting cannot be changed
     4956        Determines the bitrate in kilobits per second. Increasing this value
     4957        makes the video look better for the cost of an increased file size or
     4958        transfer rate. This setting cannot be changed while capturing is enabled.
     4959      </desc>
     4960    </attribute>
     4961
     4962    <attribute name="videoRateControlMode" type="CaptureVideoRateControlMode">
     4963      <desc>
     4964        Determines the rate control mode. This setting cannot be changed
    48804965        while capturing is enabled.
    48814966      </desc>
     
    48844969    <attribute name="videoFPS" type="unsigned long" default="25">
    48854970      <desc>
    4886         This setting determines the maximum number of frames per second.
    4887         Frames with a higher frequency will be skipped. Reducing this
    4888         value increases the number of skipped frames and reduces the
    4889         file size. This setting cannot be changed while capturing
    4890         is enabled.
     4971        Determines the maximum number of frames per second (FPS). Frames with
     4972        a higher frequency will be skipped. Reducing this value increases the
     4973        number of skipped frames and reduces the file size or transfer rate.
     4974        This setting cannot be changed while capturing is enabled.
     4975      </desc>
     4976    </attribute>
     4977
     4978    <attribute name="videoScalingMethod" type="CaptureVideoScalingMethod">
     4979      <desc>
     4980        Determines the video scaling method to use.
     4981        This setting cannot be changed while capturing is enabled.
    48914982      </desc>
    48924983    </attribute>
  • trunk/src/VBox/Main/include/CaptureScreenSettingsImpl.h

    r75251 r75269  
    7575    HRESULT setOptions(const com::Utf8Str &aOptions);
    7676
     77    HRESULT getAudioCodec(CaptureAudioCodec_T *aCodec);
     78    HRESULT setAudioCodec(CaptureAudioCodec_T aCodec);
     79    HRESULT getAudioHz(ULONG *aHz);
     80    HRESULT setAudioHz(ULONG aHz);
     81    HRESULT getAudioBits(ULONG *aBits);
     82    HRESULT setAudioBits(ULONG aBits);
     83    HRESULT getAudioChannels(ULONG *aChannels);
     84    HRESULT setAudioChannels(ULONG aChannels);
     85
     86    HRESULT getVideoCodec(CaptureVideoCodec_T *aCodec);
     87    HRESULT setVideoCodec(CaptureVideoCodec_T aCodec);
    7788    HRESULT getVideoWidth(ULONG *aVideoWidth);
    7889    HRESULT setVideoWidth(ULONG aVideoWidth);
     
    8192    HRESULT getVideoRate(ULONG *aVideoRate);
    8293    HRESULT setVideoRate(ULONG aVideoRate);
     94    HRESULT getVideoRateControlMode(CaptureVideoRateControlMode_T *aMode);
     95    HRESULT setVideoRateControlMode(CaptureVideoRateControlMode_T aMode);
    8396    HRESULT getVideoFPS(ULONG *aVideoFPS);
    8497    HRESULT setVideoFPS(ULONG aVideoFPS);
     98    HRESULT getVideoScalingMethod(CaptureVideoScalingMethod_T *aMode);
     99    HRESULT setVideoScalingMethod(CaptureVideoScalingMethod_T aMode);
    85100
    86101private:
  • trunk/src/VBox/Main/src-server/CaptureScreenSettingsImpl.cpp

    r75264 r75269  
    409409}
    410410
     411HRESULT CaptureScreenSettings::getAudioCodec(CaptureAudioCodec_T *aCodec)
     412{
     413    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     414
     415    *aCodec = m->bd->Audio.enmAudioCodec;
     416
     417    return S_OK;
     418}
     419
     420HRESULT CaptureScreenSettings::setAudioCodec(CaptureAudioCodec_T aCodec)
     421{
     422    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     423
     424    if (!i_canChangeSettings())
     425        return setError(E_INVALIDARG, tr("Cannot change audio codec while capturing is enabled"));
     426
     427    m->pMachine->i_setModified(Machine::IsModified_Capture);
     428    m->bd.backup();
     429
     430    m->bd->Audio.enmAudioCodec = aCodec;
     431
     432    return S_OK;
     433}
     434
     435HRESULT CaptureScreenSettings::getAudioHz(ULONG *aHz)
     436{
     437    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     438
     439    *aHz = m->bd->Audio.uHz;
     440
     441    return S_OK;
     442}
     443
     444HRESULT CaptureScreenSettings::setAudioHz(ULONG aHz)
     445{
     446    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     447
     448    if (!i_canChangeSettings())
     449        return setError(E_INVALIDARG, tr("Cannot change audio Hertz rate while capturing is enabled"));
     450
     451    m->pMachine->i_setModified(Machine::IsModified_Capture);
     452    m->bd.backup();
     453
     454    m->bd->Audio.uHz = (uint16_t)aHz;
     455
     456    return S_OK;
     457}
     458
     459HRESULT CaptureScreenSettings::getAudioBits(ULONG *aBits)
     460{
     461    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     462
     463    *aBits = m->bd->Audio.cBits;
     464
     465    return S_OK;
     466}
     467
     468HRESULT CaptureScreenSettings::setAudioBits(ULONG aBits)
     469{
     470    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     471
     472    if (!i_canChangeSettings())
     473        return setError(E_INVALIDARG, tr("Cannot change audio bits while capturing is enabled"));
     474
     475    m->pMachine->i_setModified(Machine::IsModified_Capture);
     476    m->bd.backup();
     477
     478    m->bd->Audio.cBits = (uint8_t)aBits;
     479
     480    return S_OK;
     481}
     482
     483HRESULT CaptureScreenSettings::getAudioChannels(ULONG *aChannels)
     484{
     485    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     486
     487    *aChannels = m->bd->Audio.cChannels;
     488
     489    return S_OK;
     490}
     491
     492HRESULT CaptureScreenSettings::setAudioChannels(ULONG aChannels)
     493{
     494    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     495
     496    if (!i_canChangeSettings())
     497        return setError(E_INVALIDARG, tr("Cannot change audio channels while capturing is enabled"));
     498
     499    m->pMachine->i_setModified(Machine::IsModified_Capture);
     500    m->bd.backup();
     501
     502    m->bd->Audio.cChannels = (uint8_t)aChannels;
     503
     504    return S_OK;
     505}
     506
     507HRESULT CaptureScreenSettings::getVideoCodec(CaptureVideoCodec_T *aCodec)
     508{
     509    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     510
     511    *aCodec = m->bd->Video.enmCodec;
     512
     513    return S_OK;
     514}
     515
     516HRESULT CaptureScreenSettings::setVideoCodec(CaptureVideoCodec_T aCodec)
     517{
     518    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     519
     520    if (!i_canChangeSettings())
     521        return setError(E_INVALIDARG, tr("Cannot change video codec while capturing is enabled"));
     522
     523    m->pMachine->i_setModified(Machine::IsModified_Capture);
     524    m->bd.backup();
     525
     526    m->bd->Video.enmCodec = aCodec;
     527
     528    return S_OK;
     529}
     530
    411531HRESULT CaptureScreenSettings::getVideoWidth(ULONG *aVideoWidth)
    412532{
     
    481601}
    482602
     603HRESULT CaptureScreenSettings::getVideoRateControlMode(CaptureVideoRateControlMode_T *aMode)
     604{
     605    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     606
     607    *aMode = CaptureVideoRateControlMode_CBR; /** @todo Implement VBR. */
     608
     609    return S_OK;
     610}
     611
     612HRESULT CaptureScreenSettings::setVideoRateControlMode(CaptureVideoRateControlMode_T aMode)
     613{
     614    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     615
     616    if (!i_canChangeSettings())
     617        return setError(E_INVALIDARG, tr("Cannot change video rate control mode while capturing is enabled"));
     618
     619    /** @todo Implement this. */
     620    RT_NOREF(aMode);
     621
     622    return E_NOTIMPL;
     623}
     624
    483625HRESULT CaptureScreenSettings::getVideoFPS(ULONG *aVideoFPS)
    484626{
     
    495637
    496638    if (!i_canChangeSettings())
    497         return setError(E_INVALIDARG, tr("Cannot change parameters while capturing is enabled"));
     639        return setError(E_INVALIDARG, tr("Cannot change video FPS while capturing is enabled"));
    498640
    499641    m->pMachine->i_setModified(Machine::IsModified_Capture);
     
    503645
    504646    return S_OK;
     647}
     648
     649HRESULT CaptureScreenSettings::getVideoScalingMethod(CaptureVideoScalingMethod_T *aMode)
     650{
     651    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     652
     653    *aMode = CaptureVideoScalingMethod_None; /** @todo Implement this. */
     654
     655    return S_OK;
     656}
     657
     658HRESULT CaptureScreenSettings::setVideoScalingMethod(CaptureVideoScalingMethod_T aMode)
     659{
     660    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     661
     662    if (!i_canChangeSettings())
     663        return setError(E_INVALIDARG, tr("Cannot change video rate scaling method while capturing is enabled"));
     664
     665    /** @todo Implement this. */
     666    RT_NOREF(aMode);
     667
     668    return E_NOTIMPL;
    505669}
    506670
Note: See TracChangeset for help on using the changeset viewer.

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