| Index: media/muxers/webm_muxer.h
|
| diff --git a/media/muxers/webm_muxer.h b/media/muxers/webm_muxer.h
|
| index e01998334949330b0b8a42f22a730aaee96e2a4b..e8ac3a4a855b38d501fd59e438d5eda01d23b9c4 100644
|
| --- a/media/muxers/webm_muxer.h
|
| +++ b/media/muxers/webm_muxer.h
|
| @@ -66,18 +66,20 @@ class MEDIA_EXPORT WebmMuxer : public NON_EXPORTED_BASE(mkvmuxer::IMkvWriter) {
|
| ~WebmMuxer() override;
|
|
|
| // Functions to add video and audio frames with |encoded_data.data()|
|
| - // to WebM Segment.
|
| - void OnEncodedVideo(const VideoParameters& params,
|
| + // to WebM Segment. Either one returns true on success.
|
| + bool OnEncodedVideo(const VideoParameters& params,
|
| std::unique_ptr<std::string> encoded_data,
|
| base::TimeTicks timestamp,
|
| bool is_key_frame);
|
| - void OnEncodedAudio(const media::AudioParameters& params,
|
| + bool OnEncodedAudio(const media::AudioParameters& params,
|
| std::unique_ptr<std::string> encoded_data,
|
| base::TimeTicks timestamp);
|
|
|
| void Pause();
|
| void Resume();
|
|
|
| + void ForceOneLibWebmErrorForTesting() { force_one_libwebm_error_ = true; }
|
| +
|
| private:
|
| friend class WebmMuxerTest;
|
|
|
| @@ -97,8 +99,8 @@ class MEDIA_EXPORT WebmMuxer : public NON_EXPORTED_BASE(mkvmuxer::IMkvWriter) {
|
| void ElementStartNotify(mkvmuxer::uint64 element_id,
|
| mkvmuxer::int64 position) override;
|
|
|
| - // Helper to simplify saving frames.
|
| - void AddFrame(std::unique_ptr<std::string> encoded_data,
|
| + // Helper to simplify saving frames. Returns true on success.
|
| + bool AddFrame(std::unique_ptr<std::string> encoded_data,
|
| uint8_t track_index,
|
| base::TimeDelta timestamp,
|
| bool is_key_frame);
|
| @@ -136,6 +138,8 @@ class MEDIA_EXPORT WebmMuxer : public NON_EXPORTED_BASE(mkvmuxer::IMkvWriter) {
|
|
|
| // The MkvMuxer active element.
|
| mkvmuxer::Segment segment_;
|
| + // Flag to force the next call to a |segment_| method to return false.
|
| + bool force_one_libwebm_error_;
|
|
|
| // Hold on to all encoded video frames to dump them with and when audio is
|
| // received, if expected, since WebM headers can only be written once.
|
|
|