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

Unified Diff: ppapi/proxy/video_decoder_resource.cc

Issue 1207043002: Introduce a client minimum picture pool size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved constant to shared header, validate min_picture_size now in resource proxy as well as host co… Created 5 years, 4 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 | « ppapi/proxy/video_decoder_resource.h ('k') | ppapi/proxy/video_decoder_resource_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/video_decoder_resource.cc
diff --git a/ppapi/proxy/video_decoder_resource.cc b/ppapi/proxy/video_decoder_resource.cc
index bcc0e6e844a8428674bfb6076a1ddcaad397009e..0ea624d95d869c4c7f6307e0ad93fbce7f4384d4 100644
--- a/ppapi/proxy/video_decoder_resource.cc
+++ b/ppapi/proxy/video_decoder_resource.cc
@@ -62,6 +62,7 @@ VideoDecoderResource::VideoDecoderResource(Connection connection,
PP_Instance instance)
: PluginResource(connection, instance),
num_decodes_(0),
+ min_picture_count_(0),
get_picture_(NULL),
get_picture_0_1_(NULL),
gles2_impl_(NULL),
@@ -98,6 +99,19 @@ int32_t VideoDecoderResource::Initialize0_1(
allow_software_fallback
? PP_HARDWAREACCELERATION_WITHFALLBACK
: PP_HARDWAREACCELERATION_ONLY,
+ 0,
+ callback);
+}
+
+int32_t VideoDecoderResource::Initialize0_2(
+ PP_Resource graphics_context,
+ PP_VideoProfile profile,
+ PP_HardwareAcceleration acceleration,
+ scoped_refptr<TrackedCallback> callback) {
+ return Initialize(graphics_context,
+ profile,
+ acceleration,
+ 0,
callback);
}
@@ -105,16 +119,21 @@ int32_t VideoDecoderResource::Initialize(
PP_Resource graphics_context,
PP_VideoProfile profile,
PP_HardwareAcceleration acceleration,
+ uint32_t min_picture_count,
scoped_refptr<TrackedCallback> callback) {
if (initialized_)
return PP_ERROR_FAILED;
if (profile < 0 || profile > PP_VIDEOPROFILE_MAX)
return PP_ERROR_BADARGUMENT;
+ if (min_picture_count > kMaximumPictureCount)
+ return PP_ERROR_BADARGUMENT;
if (initialize_callback_.get())
return PP_ERROR_INPROGRESS;
if (!graphics_context)
return PP_ERROR_BADRESOURCE;
+ min_picture_count_ = min_picture_count;
+
HostResource host_resource;
if (!testing_) {
// Create a new Graphics3D resource that can create texture resources to
@@ -144,7 +163,7 @@ int32_t VideoDecoderResource::Initialize(
Call<PpapiPluginMsg_VideoDecoder_InitializeReply>(
RENDERER,
PpapiHostMsg_VideoDecoder_Initialize(
- host_resource, profile, acceleration),
+ host_resource, profile, acceleration, min_picture_count),
base::Bind(&VideoDecoderResource::OnPluginMsgInitializeComplete, this));
return PP_OK_COMPLETIONPENDING;
@@ -359,6 +378,7 @@ void VideoDecoderResource::OnPluginMsgRequestTextures(
uint32_t texture_target,
const std::vector<gpu::Mailbox>& mailboxes) {
DCHECK(num_textures);
+ DCHECK(num_textures >= min_picture_count_);
DCHECK(mailboxes.empty() || mailboxes.size() == num_textures);
std::vector<uint32_t> texture_ids(num_textures);
if (gles2_impl_) {
« no previous file with comments | « ppapi/proxy/video_decoder_resource.h ('k') | ppapi/proxy/video_decoder_resource_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698