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

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

Issue 1236663003: RTCVideoDecoder: Fixes for high resolutions and high pressure cases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
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 f2c240edc1d91a35b36662f17ba9b424141159c6..9a92aaca1687653574f16164b7224ef44e086618 100644
--- a/content/renderer/media/rtc_video_decoder.h
+++ b/content/renderer/media/rtc_video_decoder.h
@@ -162,8 +162,8 @@ class CONTENT_EXPORT RTCVideoDecoder
// Returns a shared-memory segment to the available pool.
void PutSHM_Locked(scoped_ptr<SHMBuffer> shm_buffer);
- // Allocates |number| shared memory of at least |min_size| bytes.
- void CreateSHM(int number, size_t min_size);
+ // Allocates |count| shared memory buffers of |size| bytes.
+ void CreateSHM(size_t count, size_t size);
// Stores the buffer metadata to |input_buffer_data_|.
void RecordBufferData(const BufferData& buffer_data);
@@ -181,6 +181,9 @@ class CONTENT_EXPORT RTCVideoDecoder
// in min/max_resolution_.
bool IsProfileSupported(media::VideoCodecProfile profile);
+ // Clear the pending_buffers_ queue, freeing memory.
+ void ClearPendingBuffers();
+
enum State {
UNINITIALIZED, // The decoder has not initialized.
INITIALIZED, // The decoder has initialized.
@@ -238,7 +241,7 @@ class CONTENT_EXPORT RTCVideoDecoder
webrtc::DecodedImageCallback* decode_complete_callback_;
// Total number of allocated SHM buffers. Guarded by |lock_|.
- int num_shm_buffers_;
+ size_t num_shm_buffers_;
// Shared-memory buffer pool. Since allocating SHM segments requires a
// round-trip to the browser process, we keep allocation out of the
« no previous file with comments | « no previous file | content/renderer/media/rtc_video_decoder.cc » ('j') | content/renderer/media/rtc_video_decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698