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

Unified Diff: content/renderer/media/rtc_video_decoder.h

Issue 1850063003: Dynamic error tracking in RTCVideoDecoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | content/renderer/media/rtc_video_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/rtc_video_decoder.h
diff --git a/content/renderer/media/rtc_video_decoder.h b/content/renderer/media/rtc_video_decoder.h
index d1ea581d7175e8fa8c6e2faa93923d2ca5dd2ef0..6b86d25a3c766c4c09f121600affdd6abfee18d6 100644
--- a/content/renderer/media/rtc_video_decoder.h
+++ b/content/renderer/media/rtc_video_decoder.h
@@ -109,6 +109,7 @@ class CONTENT_EXPORT RTCVideoDecoder
FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, IsBufferAfterReset);
FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, IsFirstBufferAfterReset);
+ FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, GetVDAErrorCounterForTesting);
RTCVideoDecoder(webrtc::VideoCodecType type,
media::GpuVideoAcceleratorFactories* factories);
@@ -126,6 +127,8 @@ class CONTENT_EXPORT RTCVideoDecoder
// |id_reset|.
bool IsFirstBufferAfterReset(int32_t id_buffer, int32_t id_reset);
+ int GetVDAErrorCounterForTesting() { return vda_error_counter_; }
+
// Saves a WebRTC buffer in |decode_buffers_| for decode.
void SaveToDecodeBuffers_Locked(const webrtc::EncodedImage& input_image,
scoped_ptr<base::SharedMemory> shm_buffer,
@@ -157,7 +160,7 @@ class CONTENT_EXPORT RTCVideoDecoder
// Tells VDA that a picture buffer can be recycled.
void ReusePictureBuffer(int64_t picture_buffer_id);
- // Create |vda_| on |vda_loop_proxy_|.
+ // Creates |vda_| on |vda_loop_proxy_|.
void CreateVDA(media::VideoCodecProfile profile, base::WaitableEvent* waiter);
void DestroyTextures();
@@ -184,17 +187,20 @@ class CONTENT_EXPORT RTCVideoDecoder
// Records the result of InitDecode to UMA and returns |status|.
int32_t RecordInitDecodeUMA(int32_t status);
- // Assert the contract that this class is operated on the right thread.
+ // Asserts the contract that this class is operated on the right thread.
void DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() const;
- // Query factories_ whether |profile| is supported and return true is so,
+ // Queries factories_ whether |profile| is supported and return true is so,
// false otherwise. If true, also set resolution limits for |profile|
// in min/max_resolution_.
bool IsProfileSupported(media::VideoCodecProfile profile);
- // Clear the pending_buffers_ queue, freeing memory.
+ // Clears the pending_buffers_ queue, freeing memory.
void ClearPendingBuffers();
+ // Resets |vda_error_counter_| after a successfull run of decode.
+ void TryResetVDAErrorCounter_Locked();
+
enum State {
UNINITIALIZED, // The decoder has not initialized.
INITIALIZED, // The decoder has initialized.
@@ -212,7 +218,7 @@ class CONTENT_EXPORT RTCVideoDecoder
media::VideoCodecProfile vda_codec_profile_;
// Number of times that |vda_| notified of an error.
- uint32_t num_vda_errors_;
+ uint32_t vda_error_counter_;
// The video codec type, as reported by WebRTC.
const webrtc::VideoCodecType video_codec_type_;
@@ -247,7 +253,8 @@ class CONTENT_EXPORT RTCVideoDecoder
// Protects |state_|, |decode_complete_callback_| , |num_shm_buffers_|,
// |available_shm_segments_|, |pending_buffers_|, |decode_buffers_|,
- // |next_bitstream_buffer_id_| and |reset_bitstream_buffer_id_|.
+ // |next_bitstream_buffer_id_|, |reset_bitstream_buffer_id_| and
+ // |vda_error_counter_|.
base::Lock lock_;
// The state of RTCVideoDecoder. Guarded by |lock_|.
« no previous file with comments | « no previous file | content/renderer/media/rtc_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698