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

Side by Side Diff: media/gpu/android_video_decode_accelerator.h

Issue 2333983002: Reduce number of active codecs on low end devices. (Closed)
Patch Set: Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ 5 #ifndef MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_
6 #define MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ 6 #define MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // Callback that is called when the SurfaceView becomes available, if it's 136 // Callback that is called when the SurfaceView becomes available, if it's
137 // not during Initialize. |success| is true if it is now available, false 137 // not during Initialize. |success| is true if it is now available, false
138 // if initialization should stop. 138 // if initialization should stop.
139 void OnSurfaceAvailable(bool success); 139 void OnSurfaceAvailable(bool success);
140 140
141 // Initialize of the picture buffer manager. This is to be called when the 141 // Initialize of the picture buffer manager. This is to be called when the
142 // SurfaceView in |surface_id_|, if any, is no longer busy. It will return 142 // SurfaceView in |surface_id_|, if any, is no longer busy. It will return
143 // false on failure, and true if initialization was successful. This includes 143 // false on failure, and true if initialization was successful. This includes
144 // synchronous and asynchronous init; the AVDA might not yet have a codec on 144 // synchronous and asynchronous init; the AVDA might not yet have a codec on
145 // success, but async init will at least be in progress. 145 // success, but async init will at least be in progress.
146 bool InitializePictureBufferManager(); 146 bool InitializePictureBufferManager(bool force_async_init);
liberato (no reviews please) 2016/09/13 15:34:28 i think that it's almost the same if one has Initi
DaleCurtis 2016/09/15 23:03:55 Good point. Done.
147 147
148 // A part of destruction process that is sometimes postponed after the drain. 148 // A part of destruction process that is sometimes postponed after the drain.
149 void ActualDestroy(); 149 void ActualDestroy();
150 150
151 // Configures |media_codec_| with the given codec parameters from the client. 151 // Configures |media_codec_| with the given codec parameters from the client.
152 // This configuration will (probably) not be complete before this call 152 // This configuration will (probably) not be complete before this call
153 // returns. Multiple calls before completion will be ignored. |state_| 153 // returns. Multiple calls before completion will be ignored. |state_|
154 // must be NO_ERROR or WAITING_FOR_CODEC. Note that, once you call this, 154 // must be NO_ERROR or WAITING_FOR_CODEC. Note that, once you call this,
155 // you should be careful to avoid modifying members of |codec_config_| until 155 // you should be careful to avoid modifying members of |codec_config_| until
156 // |state_| is no longer WAITING_FOR_CODEC. 156 // |state_| is no longer WAITING_FOR_CODEC.
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 367
368 // True if and only if VDA initialization is deferred, and we have not yet 368 // True if and only if VDA initialization is deferred, and we have not yet
369 // called NotifyInitializationComplete. 369 // called NotifyInitializationComplete.
370 bool deferred_initialization_pending_; 370 bool deferred_initialization_pending_;
371 371
372 // Indicates if ResetCodecState() should be called upon the next call to 372 // Indicates if ResetCodecState() should be called upon the next call to
373 // Decode(). Allows us to avoid trashing the last few frames of a playback 373 // Decode(). Allows us to avoid trashing the last few frames of a playback
374 // when the EOS buffer is received. 374 // when the EOS buffer is received.
375 bool codec_needs_reset_; 375 bool codec_needs_reset_;
376 376
377 // True if surface creation and |picture_buffer_manager_| initialization has
378 // been defered until the first Decode() call.
379 bool defer_surface_creation_;
380
377 // Copy of the VDA::Config we were given. 381 // Copy of the VDA::Config we were given.
378 Config config_; 382 Config config_;
379 383
380 OnDestroyingSurfaceCallback on_destroying_surface_cb_; 384 OnDestroyingSurfaceCallback on_destroying_surface_cb_;
381 385
382 // WeakPtrFactory for posting tasks back to |this|. 386 // WeakPtrFactory for posting tasks back to |this|.
383 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; 387 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_;
384 388
385 friend class AndroidVideoDecodeAcceleratorTest; 389 friend class AndroidVideoDecodeAcceleratorTest;
386 }; 390 };
387 391
388 } // namespace media 392 } // namespace media
389 393
390 #endif // MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ 394 #endif // MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698