| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_VIDEO_CAPTURE_CONTROLLER_EVENT_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_VIDEO_CAPTURE_CONTROLLER_EVENT_HANDLER_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "base/time.h" |
| 11 #include "ui/gfx/surface/transport_dib.h" |
| 12 |
| 13 // ID used for identifying an object of VideoCaptureController. |
| 14 struct VideoCaptureControllerID { |
| 15 public: |
| 16 VideoCaptureControllerID(); |
| 17 VideoCaptureControllerID(int32 rid, int did); |
| 18 ~VideoCaptureControllerID(); |
| 19 bool operator<(const VideoCaptureControllerID& vc) const; |
| 20 |
| 21 int32 routing_id; |
| 22 int device_id; |
| 23 }; |
| 24 |
| 25 // VideoCaptureControllerEventHandler is the interface for |
| 26 // VideoCaptureController to notify clients about the events such as |
| 27 // BufferReady, FrameInfo, Error, etc. |
| 28 class VideoCaptureControllerEventHandler { |
| 29 public: |
| 30 // An Error have occurred in the VideoCaptureDevice. |
| 31 virtual void OnError(const VideoCaptureControllerID& id) = 0; |
| 32 |
| 33 // An TransportDIB have been filled with I420 video. |
| 34 virtual void OnBufferReady(const VideoCaptureControllerID& id, |
| 35 TransportDIB::Handle handle, |
| 36 base::Time timestamp) = 0; |
| 37 |
| 38 // The frame resolution the VideoCaptureDevice capture video in. |
| 39 virtual void OnFrameInfo(const VideoCaptureControllerID& id, |
| 40 int width, |
| 41 int height, |
| 42 int frame_rate) = 0; |
| 43 |
| 44 // Report that this object can be deleted. |
| 45 virtual void OnReadyToDelete(const VideoCaptureControllerID& id) = 0; |
| 46 |
| 47 protected: |
| 48 virtual ~VideoCaptureControllerEventHandler() {} |
| 49 }; |
| 50 |
| 51 #endif // CONTENT_BROWSER_RENDERER_HOST_VIDEO_CAPTURE_CONTROLLER_EVENT_HANDLER_
H_ |
| OLD | NEW |