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

Side by Side Diff: content/common/media/encoded_video_source_messages.h

Issue 15906019: Hook up EncodedVideoSource on the browser side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screencast_cl_6
Patch Set: bbd3b746f Rebase. Created 7 years, 6 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
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ipc/ipc_message_macros.h"
6 #include "media/video/capture/video_capture_types.h"
7 #include "media/video/encoded_video_source.h"
8 #include "media/video/video_encode_types.h"
9
10 #undef IPC_MESSAGE_EXPORT
11 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
12 #define IPC_MESSAGE_START EncodedVideoSourceMsgStart
13
14 #if !defined(OS_ANDROID)
15 IPC_ENUM_TRAITS(media::VideoCodec)
16 #endif // !defined(OS_ANDROID)
17
18 IPC_STRUCT_TRAITS_BEGIN(media::VideoEncodingConfig)
19 IPC_STRUCT_TRAITS_MEMBER(codec_type)
20 IPC_STRUCT_TRAITS_MEMBER(codec_name)
21 IPC_STRUCT_TRAITS_MEMBER(max_resolution)
22 IPC_STRUCT_TRAITS_MEMBER(max_frames_per_second)
23 IPC_STRUCT_TRAITS_MEMBER(max_bitrate)
24 IPC_STRUCT_TRAITS_END()
25
26 IPC_STRUCT_TRAITS_BEGIN(media::RuntimeVideoEncodingParameters)
27 IPC_STRUCT_TRAITS_MEMBER(average_bitrate)
28 IPC_STRUCT_TRAITS_MEMBER(max_bitrate)
29 IPC_STRUCT_TRAITS_END()
30
31 IPC_STRUCT_TRAITS_BEGIN(media::VideoEncodingParameters)
32 IPC_STRUCT_TRAITS_MEMBER(codec_name)
33 IPC_STRUCT_TRAITS_MEMBER(resolution)
34 IPC_STRUCT_TRAITS_MEMBER(frames_per_second)
35 IPC_STRUCT_TRAITS_MEMBER(runtime_params)
36 IPC_STRUCT_TRAITS_END()
37
38 IPC_STRUCT_TRAITS_BEGIN(media::BufferEncodingMetadata)
39 IPC_STRUCT_TRAITS_MEMBER(timestamp)
40 IPC_STRUCT_TRAITS_MEMBER(key_frame)
41 IPC_STRUCT_TRAITS_END()
42
43 // Message from Renderer to Browser process to query the encoding capability
44 // for the capture session. A successful request results in
45 // EncoderVideoSourceMessage_CapabilityAvailable message.
46 IPC_MESSAGE_CONTROL1(EncodedVideoSourceHostMsg_GetCapability,
47 media::VideoCaptureSessionId /* session_id */)
48
49 // Message from Renderer to Browser process to create a bitstream with specific
50 // parameters. A successful request results in beginning of streaming and
51 // EncoderVideoSourceMsg_BitstreamCreated message to Renderer. A failed request
52 // triggers EncodedVideoSourceMsg_BitstreamDestroyed message. |session_id| is
53 // the capture session id returned by the MediaStreamManager. The renderer is
54 // responsible for generating unique |device_id| within its context that will be
55 // used to identify bitstreams in IPC.
56 IPC_MESSAGE_CONTROL3(EncodedVideoSourceHostMsg_CreateBitstream,
57 int /* device_id */,
58 media::VideoCaptureSessionId /* session_id */,
59 media::VideoEncodingParameters /* params */)
60
61 // Message from Renderer to Browser process to stop streaming a bitstream. When
62 // Browser has finalized the bitstream it will trigger
63 // EncodedVideoSourceMsg_BitstreamDestroyed message back from Browser to
64 // Renderer. Renderer must be prepared to receive
65 // EncodedVideoSourceMsg_BitstreamReady messages until it has received the
66 // EncodedVideoSourceMsg_BitstreamDestroyed message.
67 IPC_MESSAGE_CONTROL1(EncodedVideoSourceHostMsg_DestroyBitstream,
68 int /* device_id */)
69
70 // Message from Renderer to Browser process to set a stream's bitstream config.
71 // Will always result in EncodedVideoSourceMsg_BitstreamConfigChanged containing
72 // currently active parameters, regardless of whether this call succeeded or
73 // not.
74 IPC_MESSAGE_CONTROL2(EncodedVideoSourceHostMsg_TryConfigureBitstream,
75 int /* device_id */,
76 media::RuntimeVideoEncodingParameters /* params */)
77
78 // Message from Renderer to Browser process to tell that the data within a
79 // buffer has been processed and it can be reused to encode upcoming bitstream.
80 IPC_MESSAGE_CONTROL2(EncodedVideoSourceHostMsg_BitstreamBufferConsumed,
81 int /* device_id */,
82 int /* buffer_id */)
83
84 // Message from Browser to Renderer process to report the encoding capability
85 // of the device.
86 IPC_MESSAGE_CONTROL2(EncodedVideoSourceMsg_CapabilityAvailable,
87 media::VideoCaptureSessionId /* session_id */,
hshi1 2013/06/12 20:16:32 You're using session_id instead of device_id here,
sheu 2013/06/12 20:58:08 I suppose we could respec the IPC to say: GetCapa
88 media::VideoEncodingCapability /* capability */)
89
90 // Message from Browser to Renderer process to acknowledge a request to create
91 // an encoded video bitstream. When this message occurs bitstream can be
92 // considered to be streaming and Renderer should be ready to start accepting
93 // EncodedVideoSourceMsg_BitstreamReady messages and buffers contained within
94 // them. Shared memory buffers used to deliver the bitstream are assigned with
95 // buffer ids as specified by the buffers parameter.
96 IPC_MESSAGE_CONTROL4(EncodedVideoSourceMsg_BitstreamCreated,
97 int /* device id */,
98 media::VideoEncodingParameters /* params */,
99 std::vector<base::SharedMemoryHandle> /* buffers */,
100 size_t /* buffer_size */)
hshi1 2013/06/12 18:30:45 What does |buffer_size| represent? I guess it is t
sheu 2013/06/12 19:51:18 Right. The assumption is that they all share the
101
102 // Message from Browser to Renderer process to acknowledge a request to destroy
103 // an encoded video bitstream.
104 IPC_MESSAGE_CONTROL1(EncodedVideoSourceMsg_BitstreamDestroyed,
105 int /* device id */)
106
107 // Message from Browser to Renderer process to inform the clients of the current
108 // encoding parameters, regardless of whether the previous request to change
109 // them has been successful or not. This is called usually as a response to
110 // EncodedVideoSourceHostMsg_TryConfigureBitstream during runtime, but can occur
111 // also as a result of config change initiated by encoder or other clients in
112 // the system. E.g. if there are multiple clients and bitstream config change is
113 // requested from one client, all clients should be prepared to handle the
114 // configuration change.
115 IPC_MESSAGE_CONTROL2(EncodedVideoSourceMsg_BitstreamConfigChanged,
116 int /* device id */,
117 media::RuntimeVideoEncodingParameters /* current_params */)
118
119 // Message from Browser to Renderer process indicating that a bitstream buffer
120 // is available for the stream. The value of |size| indicates the amount of
121 // valid bitstream data (in bytes).
122 IPC_MESSAGE_CONTROL4(EncodedVideoSourceMsg_BitstreamReady,
123 int /* device id */,
124 int /* buffer_id */,
125 size_t /* size */,
126 media::BufferEncodingMetadata /* metadata */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698