| Index: content/common/media/encoded_video_source_messages.h
|
| diff --git a/content/common/media/encoded_video_source_messages.h b/content/common/media/encoded_video_source_messages.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..337e0ed0c56c4c687fd9ae2451e8c1820cc39df5
|
| --- /dev/null
|
| +++ b/content/common/media/encoded_video_source_messages.h
|
| @@ -0,0 +1,126 @@
|
| +// Copyright (c) 2012 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.
|
| +
|
| +#include "ipc/ipc_message_macros.h"
|
| +#include "media/video/encoded_video_source.h"
|
| +#include "media/video/video_encode_types.h"
|
| +
|
| +#undef IPC_MESSAGE_EXPORT
|
| +#define IPC_MESSAGE_EXPORT CONTENT_EXPORT
|
| +#define IPC_MESSAGE_START EncodedVideoSourceMsgStart
|
| +
|
| +#if !defined(OS_ANDROID)
|
| +IPC_ENUM_TRAITS(media::VideoCodec)
|
| +#endif // !defined(OS_ANDROID)
|
| +
|
| +IPC_STRUCT_TRAITS_BEGIN(media::VideoEncodingConfig)
|
| + IPC_STRUCT_TRAITS_MEMBER(codec_type)
|
| + IPC_STRUCT_TRAITS_MEMBER(codec_name)
|
| + IPC_STRUCT_TRAITS_MEMBER(max_resolution)
|
| + IPC_STRUCT_TRAITS_MEMBER(max_frames_per_second)
|
| + IPC_STRUCT_TRAITS_MEMBER(max_bitrate)
|
| +IPC_STRUCT_TRAITS_END()
|
| +
|
| +IPC_STRUCT_TRAITS_BEGIN(media::RuntimeVideoEncodingParameters)
|
| + IPC_STRUCT_TRAITS_MEMBER(target_bitrate)
|
| + IPC_STRUCT_TRAITS_MEMBER(max_bitrate)
|
| + IPC_STRUCT_TRAITS_MEMBER(frames_per_second)
|
| +IPC_STRUCT_TRAITS_END()
|
| +
|
| +IPC_STRUCT_TRAITS_BEGIN(media::VideoEncodingParameters)
|
| + IPC_STRUCT_TRAITS_MEMBER(codec_name)
|
| + IPC_STRUCT_TRAITS_MEMBER(resolution)
|
| + IPC_STRUCT_TRAITS_MEMBER(runtime_params)
|
| +IPC_STRUCT_TRAITS_END()
|
| +
|
| +IPC_STRUCT_TRAITS_BEGIN(media::BufferEncodingMetadata)
|
| + IPC_STRUCT_TRAITS_MEMBER(timestamp)
|
| + IPC_STRUCT_TRAITS_MEMBER(key_frame)
|
| +IPC_STRUCT_TRAITS_END()
|
| +
|
| +// Need to typedef BitstreamBufferMap in order to prevent the IPC message macros
|
| +// from choking on the comma.
|
| +typedef std::map<int, base::SharedMemoryHandle> BitstreamBufferMap;
|
| +
|
| +//------------------------------------------------------------------------------
|
| +// Renderer Source Messages
|
| +// These are messages from the Renderer to the Browser process.
|
| +
|
| +// Queries the encoding capabilities for the device. A successful request
|
| +// results in EncoderVideoSourceMessage_CapabilitiesAvailable message.
|
| +IPC_MESSAGE_CONTROL1(EncodedVideoSourceHostMsg_GetCapabilities,
|
| + int /* device_id */)
|
| +
|
| +// Opens a bitstream with specific parameters. A successful request results in
|
| +// beginning of streaming and EncoderVideoSourceMsg_BitstreamOpened message.
|
| +// A failed request triggers EncodedVideoSourceMsg_BitstreamClosed message. As
|
| +// this set of messages is designed to work with existing device, device_id is
|
| +// determined on the basis which device is providing the encoded video source
|
| +// functionality. Only one bitstream can be opened for a given device.
|
| +IPC_MESSAGE_CONTROL2(EncodedVideoSourceHostMsg_OpenBitstream,
|
| + int /* device_id */,
|
| + media::VideoEncodingParameters /* params */)
|
| +
|
| +// Stops streaming a bitstream. When Browser has finalized the bitstream it will
|
| +// trigger EncodedVideoSourceMsg_BitstreamClosed message back to Renderer.
|
| +// Renderer must be prepared to receive EncodedVideoSourceMsg_BitstreamReady
|
| +// messages until it receives the EncodedVideoSourceMsg_BitstreamClosed message.
|
| +IPC_MESSAGE_CONTROL1(EncodedVideoSourceHostMsg_CloseBitstream,
|
| + int /* device_id */)
|
| +
|
| +// Sets a stream's bitstream configuration. Will always result in
|
| +// EncodedVideoSourceMsg_BitstreamConfigChanged message containing
|
| +// currently active parameters, regardless of whether this call succeeded or
|
| +// not.
|
| +IPC_MESSAGE_CONTROL2(EncodedVideoSourceHostMsg_TryConfigureBitstream,
|
| + int /* device_id */,
|
| + media::RuntimeVideoEncodingParameters /* params */)
|
| +
|
| +// Notifies that the data within a buffer has been processed and it can be
|
| +// reused to encode upcoming bitstream.
|
| +IPC_MESSAGE_CONTROL2(EncodedVideoSourceHostMsg_BitstreamBufferConsumed,
|
| + int /* device_id */,
|
| + int /* buffer_id */)
|
| +
|
| +//------------------------------------------------------------------------------
|
| +// Renderer Messages
|
| +// These are messages from the Browser to the Renderer process.
|
| +
|
| +// Reports the encoding capabilities of the device.
|
| +IPC_MESSAGE_CONTROL2(EncodedVideoSourceMsg_CapabilitiesAvailable,
|
| + int /* device id */,
|
| + media::VideoEncodingCapabilities /* capabilities */)
|
| +
|
| +// Acknowledges a request to open an encoded video bitstream. When this message
|
| +// occurs, bitstream can be considered to be streaming, and Renderer should be
|
| +// ready to start accepting EncodedVideoSourceMsg_BitstreamReady messages and
|
| +// buffers contained within them. Shared memory buffers used to deliver the
|
| +// bitstream are assigned with buffer ids as specified by the buffers parameter.
|
| +IPC_MESSAGE_CONTROL3(EncodedVideoSourceMsg_BitstreamOpened,
|
| + int /* device_id */,
|
| + media::VideoEncodingParameters /* params */,
|
| + BitstreamBufferMap /* buffers */)
|
| +
|
| +// Acknowledges a request to close an encoded video bitstream.
|
| +IPC_MESSAGE_CONTROL1(EncodedVideoSourceMsg_BitstreamClosed,
|
| + int /* device_id */)
|
| +
|
| +// Informs the clients of the current encoding parameters, regardless of whether
|
| +// the previous request to change them has been successful or not. This is
|
| +// called usually in response to EncodedVideoSourceHostMsg_TryConfigureBitstream
|
| +// at runtime, but can occur also as a result of config change initiated by
|
| +// encoder or other clients in the system, e.g. if there are multiple clients
|
| +// and bitstream config change is requested from one client, all clients should
|
| +// be prepared to handle the configuration change.
|
| +IPC_MESSAGE_CONTROL2(EncodedVideoSourceMsg_BitstreamConfigChanged,
|
| + int /* device_id */,
|
| + media::RuntimeVideoEncodingParameters /* current_params */)
|
| +
|
| +// Indicates that a bitstream buffer is available for the stream. The value of
|
| +// |size| indicates the amount of valid bitstream data (in bytes).
|
| +IPC_MESSAGE_CONTROL4(EncodedVideoSourceMsg_BitstreamReady,
|
| + int /* device_id */,
|
| + int /* buffer_id */,
|
| + int /* size */,
|
| + media::BufferEncodingMetadata /* metadata */)
|
|
|