OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 // IPC messages for the Cast Media Acceleration (CMA) pipeline. |
| 6 // Multiply-included message file, hence no include guard. |
| 7 |
| 8 #include "chromecast/common/media/cma_param_traits.h" |
| 9 #include "chromecast/media/cma/pipeline/load_type.h" |
| 10 #include "content/public/common/common_param_traits.h" |
| 11 #include "ipc/ipc_message_macros.h" |
| 12 #include "media/base/audio_decoder_config.h" |
| 13 #include "media/base/buffering_state.h" |
| 14 #include "media/base/pipeline_status.h" |
| 15 #include "media/base/video_decoder_config.h" |
| 16 #include "ui/gfx/ipc/gfx_param_traits.h" |
| 17 |
| 18 #undef IPC_MESSAGE_EXPORT |
| 19 #define IPC_MESSAGE_EXPORT |
| 20 #define IPC_MESSAGE_START CastMediaMsgStart |
| 21 |
| 22 IPC_ENUM_TRAITS_MIN_MAX_VALUE(chromecast::media::LoadType, |
| 23 chromecast::media::kLoadTypeURL, |
| 24 chromecast::media::kLoadTypeMediaStream) |
| 25 |
| 26 IPC_ENUM_TRAITS_MIN_MAX_VALUE(media::AudioCodec, |
| 27 media::kUnknownAudioCodec, |
| 28 media::kAudioCodecMax) |
| 29 |
| 30 IPC_ENUM_TRAITS_MIN_MAX_VALUE(media::SampleFormat, |
| 31 media::kUnknownSampleFormat, |
| 32 media::kSampleFormatMax) |
| 33 |
| 34 IPC_ENUM_TRAITS_MIN_MAX_VALUE(media::VideoCodec, |
| 35 media::kUnknownVideoCodec, |
| 36 media::kVideoCodecMax) |
| 37 |
| 38 IPC_ENUM_TRAITS_MIN_MAX_VALUE(media::BufferingState, |
| 39 media::BUFFERING_HAVE_NOTHING, |
| 40 media::BUFFERING_HAVE_ENOUGH) |
| 41 |
| 42 IPC_ENUM_TRAITS_MIN_MAX_VALUE(media::PipelineStatus, |
| 43 media::PIPELINE_OK, |
| 44 media::PIPELINE_STATUS_MAX) |
| 45 |
| 46 IPC_STRUCT_TRAITS_BEGIN(media::PipelineStatistics) |
| 47 IPC_STRUCT_TRAITS_MEMBER(audio_bytes_decoded) |
| 48 IPC_STRUCT_TRAITS_MEMBER(video_bytes_decoded) |
| 49 IPC_STRUCT_TRAITS_MEMBER(video_frames_decoded) |
| 50 IPC_STRUCT_TRAITS_MEMBER(video_frames_dropped) |
| 51 IPC_STRUCT_TRAITS_END() |
| 52 |
| 53 // Messages sent from the renderer to the browser process. |
| 54 |
| 55 IPC_MESSAGE_CONTROL2(CmaHostMsg_CreateMedia, |
| 56 int /* Media pipeline ID */, |
| 57 chromecast::media::LoadType /* Load type */) |
| 58 IPC_MESSAGE_CONTROL1(CmaHostMsg_DestroyMedia, |
| 59 int /* Media pipeline ID */) |
| 60 IPC_MESSAGE_CONTROL3(CmaHostMsg_SetCdm, |
| 61 int /* Media pipeline ID */, |
| 62 int /* render_frame_id */, |
| 63 int /* cdm_id */) |
| 64 IPC_MESSAGE_CONTROL2(CmaHostMsg_StartPlayingFrom, |
| 65 int /* Media pipeline ID */, |
| 66 base::TimeDelta /* Timestamp */) |
| 67 IPC_MESSAGE_CONTROL1(CmaHostMsg_Flush, |
| 68 int /* Media pipeline ID */) |
| 69 IPC_MESSAGE_CONTROL1(CmaHostMsg_Stop, |
| 70 int /* Media pipeline ID */) |
| 71 IPC_MESSAGE_CONTROL2(CmaHostMsg_SetPlaybackRate, |
| 72 int /* Media pipeline ID */, |
| 73 float /* Playback rate */) |
| 74 |
| 75 IPC_MESSAGE_CONTROL3(CmaHostMsg_CreateAvPipe, |
| 76 int /* Media pipeline ID */, |
| 77 int /* Track ID */, |
| 78 size_t /* Fifo size */); |
| 79 IPC_MESSAGE_CONTROL3(CmaHostMsg_AudioInitialize, |
| 80 int /* Media pipeline ID */, |
| 81 int /* Track ID */, |
| 82 media::AudioDecoderConfig /* Audio config */) |
| 83 IPC_MESSAGE_CONTROL3(CmaHostMsg_VideoInitialize, |
| 84 int /* Media pipeline ID */, |
| 85 int /* Track ID */, |
| 86 media::VideoDecoderConfig /* Video config */) |
| 87 IPC_MESSAGE_CONTROL3(CmaHostMsg_SetVolume, |
| 88 int /* Media pipeline ID */, |
| 89 int /* Track ID */, |
| 90 float /* Volume */) |
| 91 IPC_MESSAGE_CONTROL2(CmaHostMsg_NotifyPipeWrite, |
| 92 int /* Media pipeline ID */, |
| 93 int /* Track ID */) |
| 94 |
| 95 IPC_MESSAGE_CONTROL5(CmaHostMsg_NotifyExternalSurface, |
| 96 int /* Surface ID */, |
| 97 gfx::PointF /* Quad video top left */, |
| 98 gfx::PointF /* Quad video top right */, |
| 99 gfx::PointF /* Quad video bottim right */, |
| 100 gfx::PointF /* Quad video bottom left */) |
| 101 |
| 102 // Messages from the browser to the renderer process. |
| 103 |
| 104 IPC_MESSAGE_CONTROL2(CmaMsg_MediaStateChanged, |
| 105 int /* Media pipeline ID */, |
| 106 media::PipelineStatus /* Status */) |
| 107 IPC_MESSAGE_CONTROL4(CmaMsg_TimeUpdate, |
| 108 int /* Media pipeline ID */, |
| 109 base::TimeDelta /* Media time */, |
| 110 base::TimeDelta /* Max media time */, |
| 111 base::TimeTicks /* STC */) |
| 112 IPC_MESSAGE_CONTROL2(CmaMsg_BufferingNotification, |
| 113 int /* Media pipeline ID */, |
| 114 media::BufferingState /* Buffering state */) |
| 115 |
| 116 IPC_MESSAGE_CONTROL5(CmaMsg_AvPipeCreated, |
| 117 int /* Media pipeline ID */, |
| 118 int /* Track ID */, |
| 119 bool /* Status */, |
| 120 base::SharedMemoryHandle /* Shared memory */, |
| 121 base::FileDescriptor /* socket handle */) |
| 122 IPC_MESSAGE_CONTROL3(CmaMsg_TrackStateChanged, |
| 123 int /* Media pipeline ID */, |
| 124 int /* Track ID */, |
| 125 media::PipelineStatus /* Status */) |
| 126 IPC_MESSAGE_CONTROL2(CmaMsg_NotifyPipeRead, |
| 127 int /* Media pipeline ID */, |
| 128 int /* Track ID */) |
| 129 |
| 130 IPC_MESSAGE_CONTROL2(CmaMsg_Eos, |
| 131 int /* Media pipeline ID */, |
| 132 int /* Track ID */) |
| 133 IPC_MESSAGE_CONTROL3(CmaMsg_PlaybackError, |
| 134 int /* Media pipeline ID */, |
| 135 int /* Track ID */, |
| 136 media::PipelineStatus /* status */) |
| 137 IPC_MESSAGE_CONTROL3(CmaMsg_PlaybackStatistics, |
| 138 int /* Media pipeline ID */, |
| 139 int /* Track ID */, |
| 140 media::PipelineStatistics /* status */) |
| 141 IPC_MESSAGE_CONTROL3(CmaMsg_NaturalSizeChanged, |
| 142 int /* Media pipeline ID */, |
| 143 int /* Track ID */, |
| 144 gfx::Size /* Size */) |
OLD | NEW |