Home | History | Annotate | Download | only in media
      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 "base/memory/shared_memory.h"
      6 #include "content/common/content_export.h"
      7 #include "content/common/media/video_capture.h"
      8 #include "content/public/common/common_param_traits.h"
      9 #include "ipc/ipc_message_macros.h"
     10 #include "media/video/capture/video_capture_types.h"
     11 
     12 #undef IPC_MESSAGE_EXPORT
     13 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
     14 #define IPC_MESSAGE_START VideoCaptureMsgStart
     15 
     16 IPC_ENUM_TRAITS(content::VideoCaptureState)
     17 
     18 // Notify the renderer process about the state update such as
     19 // Start/Pause/Stop.
     20 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_StateChanged,
     21                      int /* device id */,
     22                      content::VideoCaptureState /* new state */)
     23 
     24 // Tell the renderer process that a new buffer is allocated for video capture.
     25 IPC_MESSAGE_CONTROL4(VideoCaptureMsg_NewBuffer,
     26                      int /* device id */,
     27                      base::SharedMemoryHandle /* handle */,
     28                      int /* length */,
     29                      int /* buffer_id */)
     30 
     31 // Tell the renderer process that a buffer is available from video capture.
     32 IPC_MESSAGE_CONTROL3(VideoCaptureMsg_BufferReady,
     33                      int /* device id */,
     34                      int /* buffer_id */,
     35                      base::Time /* timestamp */)
     36 
     37 // Tell the renderer process the width, height and frame rate the camera use.
     38 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_DeviceInfo,
     39                      int /* device_id */,
     40                      media::VideoCaptureParams)
     41 
     42 // Tell the renderer process the newly changed width, height and frame rate
     43 // the video capture device will use.
     44 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_DeviceInfoChanged,
     45                      int /* device_id */,
     46                      media::VideoCaptureParams)
     47 
     48 // Start the video capture specified by |device_id|.
     49 IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_Start,
     50                      int /* device_id */,
     51                      media::VideoCaptureParams)
     52 
     53 // Pause the video capture specified by |device_id|.
     54 IPC_MESSAGE_CONTROL1(VideoCaptureHostMsg_Pause,
     55                      int /* device_id */)
     56 
     57 // Close the video capture specified by |device_id|.
     58 IPC_MESSAGE_CONTROL1(VideoCaptureHostMsg_Stop,
     59                      int /* device_id */)
     60 
     61 // Tell the browser process that the video frame buffer |handle| is ready for
     62 // device |device_id| to fill up.
     63 IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_BufferReady,
     64                      int /* device_id */,
     65                      int /* buffer_id */)
     66