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

Unified Diff: media/gpu/ipc/client/gpu_video_encode_accelerator_host.cc

Issue 2395913003: Cleanup of passing GpuMemoryBuffer backed video frames (Closed)
Patch Set: Rebase Created 4 years, 2 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 | « media/gpu/ipc/client/gpu_video_encode_accelerator_host.h ('k') | media/gpu/ipc/common/media_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/ipc/client/gpu_video_encode_accelerator_host.cc
diff --git a/media/gpu/ipc/client/gpu_video_encode_accelerator_host.cc b/media/gpu/ipc/client/gpu_video_encode_accelerator_host.cc
index b32813103af08b3a81f682874651a72d26ce7efd..f245dd5290985a4a1b22cdc6a7d66f8d9921fac7 100644
--- a/media/gpu/ipc/client/gpu_video_encode_accelerator_host.cc
+++ b/media/gpu/ipc/client/gpu_video_encode_accelerator_host.cc
@@ -12,7 +12,6 @@
#include "media/gpu/gpu_video_accelerator_util.h"
#include "media/gpu/ipc/common/media_messages.h"
#include "media/video/video_encode_accelerator.h"
-#include "ui/gfx/gpu_memory_buffer.h"
namespace media {
@@ -115,6 +114,7 @@ void GpuVideoEncodeAcceleratorHost::Encode(
bool force_keyframe) {
DCHECK(CalledOnValidThread());
DCHECK_EQ(PIXEL_FORMAT_I420, frame->format());
+ DCHECK_EQ(VideoFrame::STORAGE_SHMEM, frame->storage_type());
if (!channel_)
return;
@@ -122,9 +122,6 @@ void GpuVideoEncodeAcceleratorHost::Encode(
case VideoFrame::STORAGE_SHMEM:
EncodeSharedMemoryFrame(frame, force_keyframe);
break;
- case VideoFrame::STORAGE_GPU_MEMORY_BUFFERS:
- EncodeGpuMemoryBufferFrame(frame, force_keyframe);
- break;
default:
PostNotifyError(FROM_HERE, kPlatformFailureError,
"Encode(): cannot encode frame with invalid handles");
@@ -184,33 +181,6 @@ void GpuVideoEncodeAcceleratorHost::OnWillDeleteImpl() {
OnChannelError();
}
-void GpuVideoEncodeAcceleratorHost::EncodeGpuMemoryBufferFrame(
- const scoped_refptr<VideoFrame>& frame,
- bool force_keyframe) {
- DCHECK_EQ(VideoFrame::NumPlanes(PIXEL_FORMAT_I420),
- frame->gpu_memory_buffer_handles().size());
- AcceleratedVideoEncoderMsg_Encode_Params2 params;
- params.frame_id = next_frame_id_;
- params.timestamp = frame->timestamp();
- bool requires_sync_point = false;
- for (const auto& handle : frame->gpu_memory_buffer_handles()) {
- gfx::GpuMemoryBufferHandle new_handle =
- channel_->ShareGpuMemoryBufferToGpuProcess(handle,
- &requires_sync_point);
- if (new_handle.is_null()) {
- PostNotifyError(FROM_HERE, kPlatformFailureError,
- "EncodeGpuMemoryBufferFrame(): failed to share gpu "
- "memory buffer handle for gpu process");
- return;
- }
- params.gpu_memory_buffer_handles.push_back(new_handle);
- }
- params.size = frame->coded_size();
- params.force_keyframe = force_keyframe;
-
- Send(new AcceleratedVideoEncoderMsg_Encode2(encoder_route_id_, params));
-}
-
void GpuVideoEncodeAcceleratorHost::EncodeSharedMemoryFrame(
const scoped_refptr<VideoFrame>& frame,
bool force_keyframe) {
« no previous file with comments | « media/gpu/ipc/client/gpu_video_encode_accelerator_host.h ('k') | media/gpu/ipc/common/media_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698