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

Unified Diff: media/cast/video_sender/codecs/vp8/vp8_encoder.h

Issue 138953009: Cast: Fix threading issues in VideoEncoderImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bad merge now fixed Created 6 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 | « media/cast/test/end2end_unittest.cc ('k') | media/cast/video_sender/codecs/vp8/vp8_encoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/video_sender/codecs/vp8/vp8_encoder.h
diff --git a/media/cast/video_sender/codecs/vp8/vp8_encoder.h b/media/cast/video_sender/codecs/vp8/vp8_encoder.h
index e39bc1615667c30770dda9d71447962f3a06599f..a6dd396507ae50d875f4fb99a7c3586ff05ced5a 100644
--- a/media/cast/video_sender/codecs/vp8/vp8_encoder.h
+++ b/media/cast/video_sender/codecs/vp8/vp8_encoder.h
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
+#include "base/threading/thread_checker.h"
#include "media/cast/cast_config.h"
#include "third_party/libvpx/source/libvpx/vpx/vpx_encoder.h"
@@ -29,6 +30,10 @@ class Vp8Encoder {
~Vp8Encoder();
+ // Initialize the encoder before Encode() can be called. This method
+ // must be called on the thread that Encode() is called.
+ void Initialize();
+
// Encode a raw image (as a part of a video stream).
bool Encode(const scoped_refptr<media::VideoFrame>& video_frame,
transport::EncodedVideoFrame* encoded_image);
@@ -83,6 +88,9 @@ class Vp8Encoder {
bool acked_frame_buffers_[kNumberOfVp8VideoBuffers];
Vp8Buffers last_used_vp8_buffer_;
int number_of_repeated_buffers_;
+
+ // This is bound to the thread where Initialize() is called.
+ base::ThreadChecker thread_checker_;
};
} // namespace cast
« no previous file with comments | « media/cast/test/end2end_unittest.cc ('k') | media/cast/video_sender/codecs/vp8/vp8_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698