Chromium Code Reviews| 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 fedb941f257c185e9f2a5312a423805300fb6e44..be9ded94b876386c2f47d90ef70b82c22ff49e91 100644 |
| --- a/content/renderer/media/rtc_video_decoder.h |
| +++ b/content/renderer/media/rtc_video_decoder.h |
| @@ -108,6 +108,7 @@ class CONTENT_EXPORT RTCVideoDecoder |
| FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, IsBufferAfterReset); |
| FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, IsFirstBufferAfterReset); |
| + FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, GetVDAErrorCounter); |
| RTCVideoDecoder(webrtc::VideoCodecType type, |
| media::GpuVideoAcceleratorFactories* factories); |
| @@ -125,6 +126,8 @@ class CONTENT_EXPORT RTCVideoDecoder |
| // |id_reset|. |
| bool IsFirstBufferAfterReset(int32_t id_buffer, int32_t id_reset); |
| + int GetVDAErrorCounter() { return vda_error_counter_; } |
|
mcasas
2016/04/05 21:32:01
GetVDAErrorCounterForTesting() ?
(The suffix ForTe
emircan
2016/04/05 23:18:06
Done.
|
| + |
| // Saves a WebRTC buffer in |decode_buffers_| for decode. |
| void SaveToDecodeBuffers_Locked(const webrtc::EncodedImage& input_image, |
| scoped_ptr<base::SharedMemory> shm_buffer, |
| @@ -156,7 +159,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(); |
| @@ -183,17 +186,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. |
| @@ -211,7 +217,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_; |
| @@ -246,7 +252,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_|. |