Index: content/common/gpu/media/vaapi_video_decode_accelerator.h |
diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.h b/content/common/gpu/media/vaapi_video_decode_accelerator.h |
index 64a94d885780931bffef989a19b05b458006a200..65ef59f728fc7caf3101fe5e3c10bb63bf3d7a75 100644 |
--- a/content/common/gpu/media/vaapi_video_decode_accelerator.h |
+++ b/content/common/gpu/media/vaapi_video_decode_accelerator.h |
@@ -56,7 +56,10 @@ class CONTENT_EXPORT VaapiVideoDecodeAccelerator : |
virtual void Reset() OVERRIDE; |
virtual void Destroy() OVERRIDE; |
- private: |
+ // Do any necessary initialization before the sandbox is enabled. |
+ static void PreSandboxInitialization(); |
+ |
+private: |
// Ensure data has been synced with the output texture and notify |
// the client it is ready for displaying. |
void SyncAndNotifyPictureReady(int32 input_id, int32 output_id); |
@@ -121,6 +124,10 @@ class CONTENT_EXPORT VaapiVideoDecodeAccelerator : |
// Helper for Destroy(), doing all the actual work except for deleting self. |
void Cleanup(); |
+ // Lazily initialize static data after sandbox is enabled. Return false on |
+ // init failure. |
+ static bool PostSandboxInitialization(); |
+ |
// Client-provided X/GLX state. |
Display* x_display_; |
GLXContext glx_context_; |
@@ -195,6 +202,9 @@ class CONTENT_EXPORT VaapiVideoDecodeAccelerator : |
base::Thread decoder_thread_; |
content::VaapiH264Decoder decoder_; |
+ // Has static initialization of pre-sandbox components completed successfully? |
+ static bool pre_sandbox_init_done_; |
+ |
// Callback passed to the decoder, which it will use to signal readiness |
// of an output picture to be displayed. |
void OutputPicCallback(int32 input_id, int32 output_id); |