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

Side by Side Diff: content/common/gpu/media/v4l2_video_decode_accelerator.cc

Issue 1816203003: Add an additional VDA::Flush() mode to return all allocated buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include <dlfcn.h> 5 #include <dlfcn.h>
6 #include <errno.h> 6 #include <errno.h>
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <linux/videodev2.h> 8 #include <linux/videodev2.h>
9 #include <poll.h> 9 #include <poll.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 } 411 }
412 #endif 412 #endif
413 413
414 scoped_ptr<EGLSyncKHRRef> egl_sync_ref(new EGLSyncKHRRef( 414 scoped_ptr<EGLSyncKHRRef> egl_sync_ref(new EGLSyncKHRRef(
415 egl_display_, egl_sync)); 415 egl_display_, egl_sync));
416 decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind( 416 decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
417 &V4L2VideoDecodeAccelerator::ReusePictureBufferTask, 417 &V4L2VideoDecodeAccelerator::ReusePictureBufferTask,
418 base::Unretained(this), picture_buffer_id, base::Passed(&egl_sync_ref))); 418 base::Unretained(this), picture_buffer_id, base::Passed(&egl_sync_ref)));
419 } 419 }
420 420
421 void V4L2VideoDecodeAccelerator::Flush() { 421 void V4L2VideoDecodeAccelerator::Flush(bool return_buffers) {
422 DVLOG(3) << "Flush()"; 422 DVLOG(3) << "Flush()";
423 DCHECK(child_task_runner_->BelongsToCurrentThread()); 423 DCHECK(child_task_runner_->BelongsToCurrentThread());
424 decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind( 424 decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
425 &V4L2VideoDecodeAccelerator::FlushTask, base::Unretained(this))); 425 &V4L2VideoDecodeAccelerator::FlushTask, base::Unretained(this)));
426 } 426 }
427 427
428 void V4L2VideoDecodeAccelerator::Reset() { 428 void V4L2VideoDecodeAccelerator::Reset() {
429 DVLOG(3) << "Reset()"; 429 DVLOG(3) << "Reset()";
430 DCHECK(child_task_runner_->BelongsToCurrentThread()); 430 DCHECK(child_task_runner_->BelongsToCurrentThread());
431 decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind( 431 decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
(...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after
2027 2027
2028 void V4L2VideoDecodeAccelerator::PictureCleared() { 2028 void V4L2VideoDecodeAccelerator::PictureCleared() {
2029 DVLOG(3) << "PictureCleared(). clearing count=" << picture_clearing_count_; 2029 DVLOG(3) << "PictureCleared(). clearing count=" << picture_clearing_count_;
2030 DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current()); 2030 DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
2031 DCHECK_GT(picture_clearing_count_, 0); 2031 DCHECK_GT(picture_clearing_count_, 0);
2032 picture_clearing_count_--; 2032 picture_clearing_count_--;
2033 SendPictureReady(); 2033 SendPictureReady();
2034 } 2034 }
2035 2035
2036 } // namespace content 2036 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698