1 // Copyright 2014 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.
5 // IPC messages for the Cast Media Acceleration (CMA) pipeline.
6 // Multiply-included message file, hence no include guard.
8 #include "chromecast/common/media/cma_ipc_common.h"
9 #include "chromecast/common/media/cma_param_traits.h"
10 #include "chromecast/common/media/cma_param_traits_macros.h"
11 #include "chromecast/media/cma/pipeline/load_type.h"
12 #include "content/public/common/common_param_traits.h"
13 #include "ipc/ipc_message_macros.h"
14 #include "media/base/audio_decoder_config.h"
15 #include "media/base/buffering_state.h"
16 #include "media/base/pipeline_status.h"
17 #include "media/base/video_decoder_config.h"
18 #include "ui/gfx/ipc/gfx_param_traits.h"
20 #undef IPC_MESSAGE_EXPORT
21 #define IPC_MESSAGE_EXPORT
22 #define IPC_MESSAGE_START CastMediaMsgStart
24 // Messages sent from the renderer to the browser process.
26 IPC_MESSAGE_CONTROL2(CmaHostMsg_CreateMedia
,
27 int /* Media pipeline ID */,
28 chromecast::media::LoadType
/* Load type */)
29 IPC_MESSAGE_CONTROL1(CmaHostMsg_DestroyMedia
,
30 int /* Media pipeline ID */)
31 IPC_MESSAGE_CONTROL3(CmaHostMsg_SetCdm
,
32 int /* Media pipeline ID */,
33 int /* render_frame_id */,
35 IPC_MESSAGE_CONTROL2(CmaHostMsg_StartPlayingFrom
,
36 int /* Media pipeline ID */,
37 base::TimeDelta
/* Timestamp */)
38 IPC_MESSAGE_CONTROL1(CmaHostMsg_Flush
,
39 int /* Media pipeline ID */)
40 IPC_MESSAGE_CONTROL1(CmaHostMsg_Stop
,
41 int /* Media pipeline ID */)
42 IPC_MESSAGE_CONTROL2(CmaHostMsg_SetPlaybackRate
,
43 int /* Media pipeline ID */,
44 float /* Playback rate */)
46 IPC_MESSAGE_CONTROL3(CmaHostMsg_CreateAvPipe
,
47 int /* Media pipeline ID */,
48 chromecast::media::TrackId
/* Track ID */,
49 size_t /* Fifo size */);
50 IPC_MESSAGE_CONTROL3(CmaHostMsg_AudioInitialize
,
51 int /* Media pipeline ID */,
52 chromecast::media::TrackId
/* Track ID */,
53 media::AudioDecoderConfig
/* Audio config */)
54 IPC_MESSAGE_CONTROL3(CmaHostMsg_VideoInitialize
,
55 int /* Media pipeline ID */,
56 chromecast::media::TrackId
/* Track ID */,
57 media::VideoDecoderConfig
/* Video config */)
58 IPC_MESSAGE_CONTROL3(CmaHostMsg_SetVolume
,
59 int /* Media pipeline ID */,
60 chromecast::media::TrackId
/* Track ID */,
62 IPC_MESSAGE_CONTROL2(CmaHostMsg_NotifyPipeWrite
,
63 int /* Media pipeline ID */,
64 chromecast::media::TrackId
/* Track ID */)
66 IPC_MESSAGE_CONTROL5(CmaHostMsg_NotifyExternalSurface
,
68 gfx::PointF
/* Quad video top left */,
69 gfx::PointF
/* Quad video top right */,
70 gfx::PointF
/* Quad video bottim right */,
71 gfx::PointF
/* Quad video bottom left */)
73 // Messages from the browser to the renderer process.
75 IPC_MESSAGE_CONTROL2(CmaMsg_MediaStateChanged
,
76 int /* Media pipeline ID */,
77 media::PipelineStatus
/* Status */)
78 IPC_MESSAGE_CONTROL4(CmaMsg_TimeUpdate
,
79 int /* Media pipeline ID */,
80 base::TimeDelta
/* Media time */,
81 base::TimeDelta
/* Max media time */,
82 base::TimeTicks
/* STC */)
83 IPC_MESSAGE_CONTROL2(CmaMsg_BufferingNotification
,
84 int /* Media pipeline ID */,
85 media::BufferingState
/* Buffering state */)
87 IPC_MESSAGE_CONTROL5(CmaMsg_AvPipeCreated
,
88 int /* Media pipeline ID */,
89 chromecast::media::TrackId
/* Track ID */,
91 base::SharedMemoryHandle
/* Shared memory */,
92 base::FileDescriptor
/* socket handle */)
93 IPC_MESSAGE_CONTROL3(CmaMsg_TrackStateChanged
,
94 int /* Media pipeline ID */,
95 chromecast::media::TrackId
/* Track ID */,
96 media::PipelineStatus
/* Status */)
97 IPC_MESSAGE_CONTROL2(CmaMsg_NotifyPipeRead
,
98 int /* Media pipeline ID */,
99 chromecast::media::TrackId
/* Track ID */)
101 IPC_MESSAGE_CONTROL2(CmaMsg_Eos
,
102 int /* Media pipeline ID */,
103 chromecast::media::TrackId
/* Track ID */)
104 IPC_MESSAGE_CONTROL3(CmaMsg_PlaybackError
,
105 int /* Media pipeline ID */,
106 chromecast::media::TrackId
/* Track ID */,
107 media::PipelineStatus
/* status */)
108 IPC_MESSAGE_CONTROL3(CmaMsg_PlaybackStatistics
,
109 int /* Media pipeline ID */,
110 chromecast::media::TrackId
/* Track ID */,
111 media::PipelineStatistics
/* status */)
112 IPC_MESSAGE_CONTROL3(CmaMsg_NaturalSizeChanged
,
113 int /* Media pipeline ID */,
114 chromecast::media::TrackId
/* Track ID */,
115 gfx::Size
/* Size */)