VirtualBox

Ignore:
Timestamp:
Aug 16, 2022 3:41:39 PM (2 years ago)
Author:
vboxsync
Message:

Recording/Main: Decoupled the WebM writer class from codec dependencies. Various bugfixes. bugref:10275

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/RecordingStream.h

    r96179 r96229  
    126126    uint16_t GetID(void) const { return this->uScreenID; };
    127127#ifdef VBOX_WITH_AUDIO_RECORDING
    128     PRECORDINGCODEC GetAudioCodec(void) { return &this->CodecAudio; };
     128    PRECORDINGCODEC GetAudioCodec(void) { return this->pCodecAudio; };
    129129#endif
    130130    PRECORDINGCODEC GetVideoCodec(void) { return &this->CodecVideo; };
     
    132132    bool IsReady(void) const;
    133133
     134public:
     135
     136    static DECLCALLBACK(int) codecWriteDataCallback(PRECORDINGCODEC pCodec, const void *pvData, size_t cbData, uint64_t msAbsPTS, uint32_t uFlags, void *pvUser);
     137
    134138protected:
    135139
    136     static DECLCALLBACK(int) codecWriteDataCallback(PRECORDINGCODEC pCodec, const void *pvData, size_t cbData, void *pvUser);
    137 
    138 protected:
    139 
    140     int open(const settings::RecordingScreenSettings &Settings);
     140    int open(const settings::RecordingScreenSettings &screenSettings);
    141141    int close(void);
    142142
    143     int initInternal(RecordingContext *pCtx, uint32_t uScreen, const settings::RecordingScreenSettings &Settings);
     143    int initInternal(RecordingContext *pCtx, uint32_t uScreen, const settings::RecordingScreenSettings &screenSettings);
    144144    int uninitInternal(void);
    145145
    146     int initVideo(const settings::RecordingScreenSettings &Settings);
     146    int initVideo(const settings::RecordingScreenSettings &screenSettings);
    147147    int unitVideo(void);
    148 
    149     int initAudio(const settings::RecordingScreenSettings &Settings);
    150148
    151149    bool isLimitReachedInternal(uint64_t msTimestamp) const;
    152150    int iterateInternal(uint64_t msTimestamp);
     151
     152    int codecWriteToWebM(PRECORDINGCODEC pCodec, const void *pvData, size_t cbData, uint64_t msAbsPTS, uint32_t uFlags);
    153153
    154154    void lock(void);
     
    171171
    172172    /** Recording context this stream is associated to. */
    173     RecordingContext       *pCtx;
     173    RecordingContext       *m_pCtx;
    174174    /** The current state. */
    175175    RECORDINGSTREAMSTATE    enmState;
     
    192192    /** Critical section to serialize access. */
    193193    RTCRITSECT          CritSect;
    194     /** Timestamp (in ms) of when recording has been start. */
     194    /** Timestamp (in ms) of when recording has been started. */
    195195    uint64_t            tsStartMs;
    196 
    197     /** Audio codec instance data to use. */
    198     RECORDINGCODEC                    CodecAudio;
     196#ifdef VBOX_WITH_AUDIO_RECORDING
     197    /** Pointer to audio codec instance data to use.
     198     *
     199     *  We multiplex audio data from the recording context to all streams,
     200     *  to avoid encoding the same audio data for each stream. We ASSUME that
     201     *  all audio data of a VM will be the same for each stream at a given
     202     *  point in time.
     203     *
     204     *  Might be NULL if not being used. */
     205    PRECORDINGCODEC     pCodecAudio;
     206#endif /* VBOX_WITH_AUDIO_RECORDING */
    199207    /** Video codec instance data to use. */
    200     RECORDINGCODEC                    CodecVideo;
     208    RECORDINGCODEC      CodecVideo;
    201209    /** Screen settings to use. */
    202     settings::RecordingScreenSettings ScreenSettings;
     210    settings::RecordingScreenSettings
     211                        ScreenSettings;
    203212    /** Common set of recording (data) blocks, needed for
    204213     *  multiplexing to all recording streams. */
    205     RecordingBlockSet                 Blocks;
     214    RecordingBlockSet   Blocks;
    206215};
    207216
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