Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(777)

Unified Diff: media/muxers/webm_muxer.h

Issue 2633623002: MediaRecorder: handle libwebm::Segment::AddFrame() errors and wire up to Blink (Closed)
Patch Set: I can haz moar testing? Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/media_recorder_handler_unittest.cc ('k') | media/muxers/webm_muxer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « content/renderer/media/media_recorder_handler_unittest.cc ('k') | media/muxers/webm_muxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698