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

Side by Side Diff: ppapi/proxy/video_decoder_resource.h

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 unified diff | Download patch
« no previous file with comments | « ppapi/proxy/video_decoder_constants.h ('k') | ppapi/proxy/video_decoder_resource.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_ 5 #ifndef PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_
6 #define PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_ 6 #define PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_
7 7
8 #include <queue> 8 #include <queue>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 30 matching lines...) Expand all
41 41
42 // Resource overrides. 42 // Resource overrides.
43 thunk::PPB_VideoDecoder_API* AsPPB_VideoDecoder_API() override; 43 thunk::PPB_VideoDecoder_API* AsPPB_VideoDecoder_API() override;
44 44
45 // PPB_VideoDecoder_API implementation. 45 // PPB_VideoDecoder_API implementation.
46 int32_t Initialize0_1( 46 int32_t Initialize0_1(
47 PP_Resource graphics_context, 47 PP_Resource graphics_context,
48 PP_VideoProfile profile, 48 PP_VideoProfile profile,
49 PP_Bool allow_software_fallback, 49 PP_Bool allow_software_fallback,
50 scoped_refptr<TrackedCallback> callback) override; 50 scoped_refptr<TrackedCallback> callback) override;
51 int32_t Initialize0_2(
52 PP_Resource graphics_context,
53 PP_VideoProfile profile,
54 PP_HardwareAcceleration acceleration,
55 scoped_refptr<TrackedCallback> callback) override;
51 int32_t Initialize(PP_Resource graphics_context, 56 int32_t Initialize(PP_Resource graphics_context,
52 PP_VideoProfile profile, 57 PP_VideoProfile profile,
53 PP_HardwareAcceleration acceleration, 58 PP_HardwareAcceleration acceleration,
59 uint32_t min_picture_count,
54 scoped_refptr<TrackedCallback> callback) override; 60 scoped_refptr<TrackedCallback> callback) override;
55 int32_t Decode(uint32_t decode_id, 61 int32_t Decode(uint32_t decode_id,
56 uint32_t size, 62 uint32_t size,
57 const void* buffer, 63 const void* buffer,
58 scoped_refptr<TrackedCallback> callback) override; 64 scoped_refptr<TrackedCallback> callback) override;
59 int32_t GetPicture0_1( 65 int32_t GetPicture0_1(
60 PP_VideoPicture_0_1* picture, 66 PP_VideoPicture_0_1* picture,
61 scoped_refptr<TrackedCallback> callback) override; 67 scoped_refptr<TrackedCallback> callback) override;
62 int32_t GetPicture(PP_VideoPicture* picture, 68 int32_t GetPicture(PP_VideoPicture* picture,
63 scoped_refptr<TrackedCallback> callback) override; 69 scoped_refptr<TrackedCallback> callback) override;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 int32_t num_decodes_; 167 int32_t num_decodes_;
162 // The maximum delay (in Decode calls) before we receive a picture. If we 168 // The maximum delay (in Decode calls) before we receive a picture. If we
163 // haven't received a picture from a Decode call after this many successive 169 // haven't received a picture from a Decode call after this many successive
164 // calls to Decode, then we will never receive a picture from the call. 170 // calls to Decode, then we will never receive a picture from the call.
165 // Note that this isn't guaranteed by H264 or other codecs. In practice, this 171 // Note that this isn't guaranteed by H264 or other codecs. In practice, this
166 // number is less than 16. Make it much larger just to be safe. 172 // number is less than 16. Make it much larger just to be safe.
167 // NOTE: because we count decodes mod 2^31, this value must be a power of 2. 173 // NOTE: because we count decodes mod 2^31, this value must be a power of 2.
168 static const int kMaximumPictureDelay = 128; 174 static const int kMaximumPictureDelay = 128;
169 uint32_t decode_ids_[kMaximumPictureDelay]; 175 uint32_t decode_ids_[kMaximumPictureDelay];
170 176
177 uint32_t min_picture_count_;
178
171 // State for pending get_picture_callback_. 179 // State for pending get_picture_callback_.
172 PP_VideoPicture* get_picture_; 180 PP_VideoPicture* get_picture_;
173 PP_VideoPicture_0_1* get_picture_0_1_; 181 PP_VideoPicture_0_1* get_picture_0_1_;
174 182
175 ScopedPPResource graphics3d_; 183 ScopedPPResource graphics3d_;
176 gpu::gles2::GLES2Implementation* gles2_impl_; 184 gpu::gles2::GLES2Implementation* gles2_impl_;
177 185
178 bool initialized_; 186 bool initialized_;
179 bool testing_; 187 bool testing_;
180 int32_t decoder_last_error_; 188 int32_t decoder_last_error_;
181 189
182 DISALLOW_COPY_AND_ASSIGN(VideoDecoderResource); 190 DISALLOW_COPY_AND_ASSIGN(VideoDecoderResource);
183 }; 191 };
184 192
185 } // namespace proxy 193 } // namespace proxy
186 } // namespace ppapi 194 } // namespace ppapi
187 195
188 #endif // PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_ 196 #endif // PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_
OLDNEW
« no previous file with comments | « ppapi/proxy/video_decoder_constants.h ('k') | ppapi/proxy/video_decoder_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698