Commit 7c673f92 authored by Owen Lin's avatar Owen Lin Committed by Commit Bot

components/arc: Add Flush() to the video_encode_accelerator interface.

BUG=755889
TEST=None

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I1780b6b54fa6de50594c995170724d888abc64ae
Reviewed-on: https://chromium-review.googlesource.com/720737
Commit-Queue: Owen Lin <owenlin@chromium.org>
Reviewed-by: default avatarKuang-che Wu <kcwu@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512450}
parent 70875fdb
...@@ -225,6 +225,15 @@ void GpuArcVideoEncodeAccelerator::RequestEncodingParametersChange( ...@@ -225,6 +225,15 @@ void GpuArcVideoEncodeAccelerator::RequestEncodingParametersChange(
accelerator_->RequestEncodingParametersChange(bitrate, framerate); accelerator_->RequestEncodingParametersChange(bitrate, framerate);
} }
void GpuArcVideoEncodeAccelerator::Flush(FlushCallback callback) {
DVLOGF(2);
if (!accelerator_) {
DLOG(ERROR) << "Accelerator is not initialized.";
return;
}
accelerator_->Flush(std::move(callback));
}
base::ScopedFD GpuArcVideoEncodeAccelerator::UnwrapFdFromMojoHandle( base::ScopedFD GpuArcVideoEncodeAccelerator::UnwrapFdFromMojoHandle(
mojo::ScopedHandle handle) { mojo::ScopedHandle handle) {
DCHECK(client_); DCHECK(client_);
......
...@@ -65,6 +65,7 @@ class GpuArcVideoEncodeAccelerator ...@@ -65,6 +65,7 @@ class GpuArcVideoEncodeAccelerator
UseBitstreamBufferCallback callback) override; UseBitstreamBufferCallback callback) override;
void RequestEncodingParametersChange(uint32_t bitrate, void RequestEncodingParametersChange(uint32_t bitrate,
uint32_t framerate) override; uint32_t framerate) override;
void Flush(FlushCallback callback) override;
// Unwraps a file descriptor from the given mojo::ScopedHandle. // Unwraps a file descriptor from the given mojo::ScopedHandle.
// If an error is encountered, it returns an invalid base::ScopedFD and // If an error is encountered, it returns an invalid base::ScopedFD and
......
...@@ -72,7 +72,7 @@ struct VideoEncodeProfile { ...@@ -72,7 +72,7 @@ struct VideoEncodeProfile {
// Video encoder IPC interface. // Video encoder IPC interface.
// Next MinVersion: 1 // Next MinVersion: 1
// Next Method ID: 5 // Next Method ID: 6
interface VideoEncodeAccelerator { interface VideoEncodeAccelerator {
// The input buffer storage type. // The input buffer storage type.
...@@ -162,6 +162,14 @@ interface VideoEncodeAccelerator { ...@@ -162,6 +162,14 @@ interface VideoEncodeAccelerator {
// |framerate| is the requested new framerate, in frames per second. // |framerate| is the requested new framerate, in frames per second.
RequestEncodingParametersChange@4(uint32 bitrate, RequestEncodingParametersChange@4(uint32 bitrate,
uint32 framerate); uint32 framerate);
// Flushes the encoder: all pending inputs will be encoded and all bitstreams
// handed back to the client. The client should not invoke Flush() or
// Encode() before the previous Flush() is finished.
// Callback:
// Called with |true| if Flush() is complete; with |false| if Flush() is
// canceled.
Flush@5() => (bool flush_done);
}; };
// Interface for clients that use VideoEncodeAccelerator. These callbacks will // Interface for clients that use VideoEncodeAccelerator. These callbacks will
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment