| Index: content/common/gpu/client/ipc/command_buffer_ipc_transport.h
|
| diff --git a/content/common/gpu/client/ipc/command_buffer_ipc_transport.h b/content/common/gpu/client/ipc/command_buffer_ipc_transport.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..292c46458418c92157b5bfdf37d07cc6ed963155
|
| --- /dev/null
|
| +++ b/content/common/gpu/client/ipc/command_buffer_ipc_transport.h
|
| @@ -0,0 +1,120 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_IPC_TRANSPORT_H_
|
| +#define CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_IPC_TRANSPORT_H_
|
| +
|
| +#include "gpu/command_buffer/common/command_buffer.h"
|
| +#include "media/video/video_decode_accelerator.h"
|
| +#include "media/video/video_encode_accelerator.h"
|
| +#include "ui/events/latency_info.h"
|
| +#include "ui/gfx/swap_result.h"
|
| +
|
| +namespace gpu {
|
| +struct Capabilities;
|
| +struct Mailbox;
|
| +struct SyncToken;
|
| +}
|
| +
|
| +namespace content {
|
| +
|
| +class GpuVideoDecodeAcceleratorHostIPCTransport;
|
| +class GpuVideoEncodeAcceleratorHostIPCTransport;
|
| +struct CommandBufferConsoleMessage;
|
| +struct CreateImageParams;
|
| +
|
| +class CommandBufferIPCTransport {
|
| + public:
|
| + class Client {
|
| + public:
|
| + virtual void OnConsoleMessage(
|
| + const CommandBufferConsoleMessage& message) = 0;
|
| +
|
| + virtual void OnChannelError() = 0;
|
| +
|
| + virtual void OnDestroyed(gpu::error::ContextLostReason reason,
|
| + gpu::error::Error error) = 0;
|
| +
|
| + virtual void OnDidHandleMessage() = 0;
|
| +
|
| + virtual void OnWillHandleMessage() = 0;
|
| +
|
| + virtual void OnSignalAck(uint32_t id) = 0;
|
| +
|
| + virtual void OnSwapBuffersCompleted(
|
| + const std::vector<ui::LatencyInfo>& latency_info,
|
| + gfx::SwapResult result) = 0;
|
| +
|
| + virtual void OnUpdateState(const gpu::CommandBuffer::State& state) = 0;
|
| +
|
| + virtual void OnUpdateVSyncParameters(base::TimeTicks timebase,
|
| + base::TimeDelta interval) = 0;
|
| +
|
| + protected:
|
| + virtual ~Client() {}
|
| + };
|
| +
|
| + virtual ~CommandBufferIPCTransport() {}
|
| +
|
| + virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) = 0;
|
| +
|
| + virtual bool CreateImage(const CreateImageParams& params) = 0;
|
| +
|
| + virtual bool CreateStreamTexture(uint32_t client_texture_id,
|
| + int32_t* stream_id,
|
| + bool* succeeded) = 0;
|
| +
|
| + virtual bool CreateVideoDecoder(
|
| + GpuVideoDecodeAcceleratorHostIPCTransport* transport,
|
| + const media::VideoDecodeAccelerator::Config& config,
|
| + bool* succeeded) = 0;
|
| +
|
| + virtual bool CreateVideoEncoder(
|
| + GpuVideoEncodeAcceleratorHostIPCTransport* transport,
|
| + media::VideoPixelFormat input_format,
|
| + const gfx::Size& input_visible_size,
|
| + media::VideoCodecProfile output_profile,
|
| + uint32_t initial_bitrate,
|
| + bool* succeeded) = 0;
|
| +
|
| + virtual bool DestroyImage(int32_t id) = 0;
|
| +
|
| + virtual bool DestroyTransferBuffer(int32_t id) = 0;
|
| +
|
| + // TODO(fsamuel): It's unclear whether we really need this here.
|
| + virtual uint64_t GetCommandBufferID() const = 0;
|
| +
|
| + virtual int32_t GetShareGroupID() const = 0;
|
| +
|
| + virtual bool Initialize(base::SharedMemoryHandle shared_state_handle,
|
| + bool* result,
|
| + gpu::Capabilities* capabilities) = 0;
|
| +
|
| + virtual bool ProduceFrontBuffer(const gpu::Mailbox& mailbox) = 0;
|
| +
|
| + virtual bool RegisterTransferBuffer(int32_t id,
|
| + base::SharedMemoryHandle transfer_buffer,
|
| + uint32_t size) = 0;
|
| +
|
| + virtual bool SetGetBuffer(int32_t shm_id) = 0;
|
| +
|
| + virtual void SetClient(Client* client) = 0;
|
| +
|
| + virtual bool SignalQuery(uint32_t query, uint32_t signal_id) = 0;
|
| +
|
| + virtual bool SignalSyncToken(const gpu::SyncToken& sync_token,
|
| + uint32_t signal_id) = 0;
|
| +
|
| + virtual bool WaitForGetOffsetInRange(int32_t start,
|
| + int32_t end,
|
| + gpu::CommandBuffer::State* state) = 0;
|
| +
|
| + virtual bool WaitForTokenInRange(int32_t start,
|
| + int32_t end,
|
| + gpu::CommandBuffer::State* state) = 0;
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_IPC_TRANSPORT_H_
|
|
|